app_server: allow replacing the DrawState in a Canvas

* Needed for layers support. The previously set DrawState and its
  stack predecessors are not freed, so take care to not leak memory
  when using this.
This commit is contained in:
Julian Harnath
2015-07-25 16:31:20 +02:00
parent c34cbf2878
commit b5c7f936de
2 changed files with 8 additions and 0 deletions
+7
View File
@@ -88,6 +88,13 @@ Canvas::PopState()
}
void
Canvas::SetDrawState(DrawState* newState)
{
fDrawState = newState;
}
void
Canvas::SetDrawingOrigin(BPoint origin)
{
+1
View File
@@ -41,6 +41,7 @@ public:
virtual void PushState();
virtual void PopState();
DrawState* CurrentState() const { return fDrawState; }
void SetDrawState(DrawState* newState);
void SetDrawingOrigin(BPoint origin);
BPoint DrawingOrigin() const;