From 244796701b8c8768712cdaf6d1fb0690f2c05d08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Mon, 17 Mar 2014 22:55:47 +0100 Subject: [PATCH] app_server: store and restore fill rule... ...when sending the whole view state over the link. Also inherit the fill rule when pushing states (DrawState copy constructor). A somewhat sloppy oversight, I must add. --- headers/private/app/ServerProtocolStructs.h | 1 + src/kits/interface/View.cpp | 4 +++- src/servers/app/DrawState.cpp | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/headers/private/app/ServerProtocolStructs.h b/headers/private/app/ServerProtocolStructs.h index 853473348e..8eec0aa9c1 100644 --- a/headers/private/app/ServerProtocolStructs.h +++ b/headers/private/app/ServerProtocolStructs.h @@ -26,6 +26,7 @@ struct ViewSetStateInfo { join_mode lineJoin; cap_mode lineCap; float miterLimit; + int32 fillRule; source_alpha alphaSourceMode; alpha_function alphaFunctionMode; bool fontAntialiasing; diff --git a/src/kits/interface/View.cpp b/src/kits/interface/View.cpp index c7395ddb69..0371f4131f 100644 --- a/src/kits/interface/View.cpp +++ b/src/kits/interface/View.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2001-2013 Haiku, Inc. All rights reserved. + * Copyright 2001-2014 Haiku, Inc. All rights reserved. * Distributed under the terms of the MIT License. * * Authors: @@ -227,6 +227,7 @@ ViewState::UpdateServerState(BPrivate::PortLink &link) info.lineJoin = line_join; info.lineCap = line_cap; info.miterLimit = miter_limit; + info.fillRule = fill_rule; info.alphaSourceMode = alpha_source_mode; info.alphaFunctionMode = alpha_function_mode; info.fontAntialiasing = font_aliasing; @@ -291,6 +292,7 @@ ViewState::UpdateFrom(BPrivate::PortLink &link) line_join = info.viewStateInfo.lineJoin; line_cap = info.viewStateInfo.lineCap; miter_limit = info.viewStateInfo.miterLimit; + fill_rule = info.viewStateInfo.fillRule; alpha_source_mode = info.viewStateInfo.alphaSourceMode; alpha_function_mode = info.viewStateInfo.alphaFunctionMode; font_aliasing = info.viewStateInfo.fontAntialiasing; diff --git a/src/servers/app/DrawState.cpp b/src/servers/app/DrawState.cpp index 6d1dd32231..23c358fe6e 100644 --- a/src/servers/app/DrawState.cpp +++ b/src/servers/app/DrawState.cpp @@ -92,6 +92,7 @@ DrawState::DrawState(const DrawState& other) fLineCapMode(other.fLineCapMode), fLineJoinMode(other.fLineJoinMode), fMiterLimit(other.fMiterLimit), + fFillRule(other.fFillRule), // Since fScale is reset to 1.0, the unscaled // font size is the current size of the font @@ -223,6 +224,7 @@ DrawState::ReadFromLink(BPrivate::LinkReceiver& link) fLineJoinMode = info.lineJoin; fLineCapMode = info.lineCap; fMiterLimit = info.miterLimit; + fFillRule = info.fillRule; fAlphaSrcMode = info.alphaSourceMode; fAlphaFncMode = info.alphaFunctionMode; fFontAliasing = info.fontAntialiasing; @@ -287,6 +289,7 @@ DrawState::WriteToLink(BPrivate::LinkSender& link) const info.viewStateInfo.lineJoin = fLineJoinMode; info.viewStateInfo.lineCap = fLineCapMode; info.viewStateInfo.miterLimit = fMiterLimit; + info.viewStateInfo.fillRule = fFillRule; info.viewStateInfo.alphaSourceMode = fAlphaSrcMode; info.viewStateInfo.alphaFunctionMode = fAlphaFncMode; info.viewStateInfo.fontAntialiasing = fFontAliasing;