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.
This commit is contained in:
Stephan Aßmus
2014-02-01 23:15:21 +01:00
parent b971358df3
commit 3c43cf1c40
2 changed files with 18 additions and 9 deletions
+8
View File
@@ -320,6 +320,14 @@ OffscreenContext::OffscreenContext(DrawingEngine* engine,
: :
DrawingContext(state), DrawingContext(state),
fDrawingEngine(engine) fDrawingEngine(engine)
{
ResyncDrawState();
}
void
OffscreenContext::ResyncDrawState()
{ {
fDrawingEngine->SetDrawState(fDrawState); fDrawingEngine->SetDrawState(fDrawState);
} }
+10 -9
View File
@@ -90,17 +90,18 @@ public:
// Screen and View coordinates are the same for us. // Screen and View coordinates are the same for us.
// DrawState already takes care of World<>View // DrawState already takes care of World<>View
// conversions. // conversions.
void ConvertToScreen(BPoint*) const {} virtual void ConvertToScreen(BPoint*) const {}
void ConvertToScreen(IntPoint*) const {} virtual void ConvertToScreen(IntPoint*) const {}
void ConvertToScreen(BRect*) const {} virtual void ConvertToScreen(BRect*) const {}
void ConvertToScreen(IntRect*) const {} virtual void ConvertToScreen(IntRect*) const {}
void ConvertToScreen(BRegion*) const {} virtual void ConvertToScreen(BRegion*) const {}
void ConvertFromScreen(BPoint*) const {} virtual void ConvertFromScreen(BPoint*) const {}
DrawingEngine* GetDrawingEngine() const { return fDrawingEngine; } virtual DrawingEngine* GetDrawingEngine() const { return fDrawingEngine; }
void RebuildClipping(bool deep) { /* TODO */ } virtual void RebuildClipping(bool deep) { /* TODO */ }
ServerPicture* GetPicture(int32 token) const virtual void ResyncDrawState();
virtual ServerPicture* GetPicture(int32 token) const
{ /* TODO */ return NULL; } { /* TODO */ return NULL; }
private: private:
DrawingEngine* fDrawingEngine; DrawingEngine* fDrawingEngine;