app_server: allow disabling affine transforms in DrawState

* New method DrawState::SetTransformEnabled allows to temporarily
  disable all BAffineTransforms in the state stack (up to 'this').
  Later, the same method can be used to reenable the transforms.

  Needed for layers support: when drawing the finished layer bitmap
  onto the view, the affine transforms must not be applied again --
  they have already been applied while drawing the bitmap's contents.
This commit is contained in:
Julian Harnath
2015-07-25 16:31:20 +02:00
parent 65a54d2892
commit edc0b5e9db
2 changed files with 17 additions and 0 deletions
+16
View File
@@ -370,6 +370,22 @@ DrawState::SetTransform(BAffineTransform transform)
}
/* Can be used to temporarily disable all BAffineTransforms in the state
stack, and later reenable them.
*/
void
DrawState::SetTransformEnabled(bool enabled)
{
if (enabled) {
BAffineTransform temp = fTransform;
SetTransform(BAffineTransform());
SetTransform(temp);
}
else
fCombinedTransform = BAffineTransform();
}
DrawState*
DrawState::Squash()
{
+1
View File
@@ -68,6 +68,7 @@ public:
{ return fTransform; }
BAffineTransform CombinedTransform() const
{ return fCombinedTransform; }
void SetTransformEnabled(bool enabled);
DrawState* Squash();