From 3c43cf1c406e2ee48de881bed6f56a6685d5e31b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Sat, 1 Feb 2014 23:15:21 +0100 Subject: [PATCH] OffscreenDrawingContext: Implement ResyncDrawState() This is called whenever the DrawState is modified, so that it gets applied to the DrawingEngine. Otherwise, the DrawingEngine works with an out-dated state. --- src/servers/app/DrawingContext.cpp | 8 ++++++++ src/servers/app/DrawingContext.h | 19 ++++++++++--------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/src/servers/app/DrawingContext.cpp b/src/servers/app/DrawingContext.cpp index 676a00e79c..b259f5e98e 100644 --- a/src/servers/app/DrawingContext.cpp +++ b/src/servers/app/DrawingContext.cpp @@ -320,6 +320,14 @@ OffscreenContext::OffscreenContext(DrawingEngine* engine, : DrawingContext(state), fDrawingEngine(engine) +{ + ResyncDrawState(); +} + + +void +OffscreenContext::ResyncDrawState() { fDrawingEngine->SetDrawState(fDrawState); } + diff --git a/src/servers/app/DrawingContext.h b/src/servers/app/DrawingContext.h index f2aa499aaf..621ed0a920 100644 --- a/src/servers/app/DrawingContext.h +++ b/src/servers/app/DrawingContext.h @@ -90,17 +90,18 @@ public: // Screen and View coordinates are the same for us. // DrawState already takes care of World<>View // conversions. - void ConvertToScreen(BPoint*) const {} - void ConvertToScreen(IntPoint*) const {} - void ConvertToScreen(BRect*) const {} - void ConvertToScreen(IntRect*) const {} - void ConvertToScreen(BRegion*) const {} - void ConvertFromScreen(BPoint*) const {} + virtual void ConvertToScreen(BPoint*) const {} + virtual void ConvertToScreen(IntPoint*) const {} + virtual void ConvertToScreen(BRect*) const {} + virtual void ConvertToScreen(IntRect*) const {} + virtual void ConvertToScreen(BRegion*) const {} + virtual void ConvertFromScreen(BPoint*) const {} - DrawingEngine* GetDrawingEngine() const { return fDrawingEngine; } + virtual DrawingEngine* GetDrawingEngine() const { return fDrawingEngine; } - void RebuildClipping(bool deep) { /* TODO */ } - ServerPicture* GetPicture(int32 token) const + virtual void RebuildClipping(bool deep) { /* TODO */ } + virtual void ResyncDrawState(); + virtual ServerPicture* GetPicture(int32 token) const { /* TODO */ return NULL; } private: DrawingEngine* fDrawingEngine;