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:
@@ -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()
|
||||
{
|
||||
|
||||
@@ -68,6 +68,7 @@ public:
|
||||
{ return fTransform; }
|
||||
BAffineTransform CombinedTransform() const
|
||||
{ return fCombinedTransform; }
|
||||
void SetTransformEnabled(bool enabled);
|
||||
|
||||
DrawState* Squash();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user