diff options
Diffstat (limited to 'libs/hwui/FrameBuilder.cpp')
| -rw-r--r-- | libs/hwui/FrameBuilder.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libs/hwui/FrameBuilder.cpp b/libs/hwui/FrameBuilder.cpp index 0ebb8866bdb3..b1314feebf34 100644 --- a/libs/hwui/FrameBuilder.cpp +++ b/libs/hwui/FrameBuilder.cpp @@ -699,7 +699,17 @@ void FrameBuilder::deferTextOnPathOp(const TextOnPathOp& op) { void FrameBuilder::deferTextureLayerOp(const TextureLayerOp& op) { if (CC_UNLIKELY(!op.layer->isRenderable())) return; - BakedOpState* bakedState = tryBakeOpState(op); + + const TextureLayerOp* textureLayerOp = &op; + // Now safe to access transform (which was potentially unready at record time) + if (!op.layer->getTransform().isIdentity()) { + // non-identity transform present, so 'inject it' into op by copying + replacing matrix + Matrix4 combinedMatrix(op.localMatrix); + combinedMatrix.multiply(op.layer->getTransform()); + textureLayerOp = mAllocator.create<TextureLayerOp>(op, combinedMatrix); + } + BakedOpState* bakedState = tryBakeOpState(*textureLayerOp); + if (!bakedState) return; // quick rejected currentLayer().deferUnmergeableOp(mAllocator, bakedState, OpBatchType::TextureLayer); } |