From 3e9999bd866fac71c72e6b484a9836c87c328a08 Mon Sep 17 00:00:00 2001 From: sergeyv Date: Thu, 19 Jan 2017 15:37:02 -0800 Subject: Explicitly destroy Layer in DeferredLayerUpdater on destroyHardwareResources() Change-Id: I0987104eabda9a2a302b9e765213aad48f93aea4 Test: refactoring CL. Existing tests still pass bug:33753499 --- libs/hwui/FrameBuilder.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'libs/hwui/FrameBuilder.cpp') diff --git a/libs/hwui/FrameBuilder.cpp b/libs/hwui/FrameBuilder.cpp index 1d8b021274fe..35ff635930ab 100644 --- a/libs/hwui/FrameBuilder.cpp +++ b/libs/hwui/FrameBuilder.cpp @@ -16,6 +16,7 @@ #include "FrameBuilder.h" +#include "DeferredLayerUpdater.h" #include "LayerUpdateQueue.h" #include "RenderNode.h" #include "VectorDrawable.h" @@ -784,14 +785,15 @@ void FrameBuilder::deferTextOnPathOp(const TextOnPathOp& op) { } void FrameBuilder::deferTextureLayerOp(const TextureLayerOp& op) { - if (CC_UNLIKELY(!op.layer->isRenderable())) return; + GlLayer* layer = static_cast(op.layerHandle->backingLayer()); + if (CC_UNLIKELY(!layer || !layer->isRenderable())) return; const TextureLayerOp* textureLayerOp = &op; // Now safe to access transform (which was potentially unready at record time) - if (!op.layer->getTransform().isIdentity()) { + if (!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()); + combinedMatrix.multiply(layer->getTransform()); textureLayerOp = mAllocator.create(op, combinedMatrix); } BakedOpState* bakedState = tryBakeOpState(*textureLayerOp); -- cgit v1.2.3-59-g8ed1b