diff options
author | Chris Craik <ccraik@google.com> | 2014-08-21 19:03:24 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-08-21 19:03:25 +0000 |
commit | 88180d269e5356db11e84a53755e470f430eceec (patch) | |
tree | 93616ab1eda31986521b75be93fd2cb209351ed2 /libs | |
parent | fffe00dfda10fa2c121f955bcfd84a4886c2dd32 (diff) | |
parent | c71bfcaa182e3d4fd9874362d3b4781fda934a21 (diff) | |
download | frameworks_base-88180d269e5356db11e84a53755e470f430eceec.zip frameworks_base-88180d269e5356db11e84a53755e470f430eceec.tar.gz frameworks_base-88180d269e5356db11e84a53755e470f430eceec.tar.bz2 |
Merge "Fix layer shadow transform crash" into lmp-dev
Diffstat (limited to 'libs')
-rw-r--r-- | libs/hwui/DamageAccumulator.cpp | 2 | ||||
-rw-r--r-- | libs/hwui/DamageAccumulator.h | 2 | ||||
-rw-r--r-- | libs/hwui/RenderNode.cpp | 13 |
3 files changed, 8 insertions, 9 deletions
diff --git a/libs/hwui/DamageAccumulator.cpp b/libs/hwui/DamageAccumulator.cpp index 054a164..420e331 100644 --- a/libs/hwui/DamageAccumulator.cpp +++ b/libs/hwui/DamageAccumulator.cpp @@ -214,7 +214,7 @@ void DamageAccumulator::dirty(float left, float top, float right, float bottom) mHead->pendingDirty.join(left, top, right, bottom); } -void DamageAccumulator::peekAtDirty(SkRect* dest) { +void DamageAccumulator::peekAtDirty(SkRect* dest) const { *dest = mHead->pendingDirty; } diff --git a/libs/hwui/DamageAccumulator.h b/libs/hwui/DamageAccumulator.h index 6f0bd8c..dd3365a 100644 --- a/libs/hwui/DamageAccumulator.h +++ b/libs/hwui/DamageAccumulator.h @@ -50,7 +50,7 @@ public: void dirty(float left, float top, float right, float bottom); // Returns the current dirty area, *NOT* transformed by pushed transforms - void peekAtDirty(SkRect* dest); + void peekAtDirty(SkRect* dest) const; void computeCurrentTransform(Matrix4* outMatrix) const; diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp index 0db6198..dca7520 100644 --- a/libs/hwui/RenderNode.cpp +++ b/libs/hwui/RenderNode.cpp @@ -179,13 +179,6 @@ void RenderNode::pushLayerUpdate(TreeInfo& info) { transformUpdateNeeded = true; } - if (transformUpdateNeeded) { - // update the transform in window of the layer to reset its origin wrt light source position - Matrix4 windowTransform; - info.damageAccumulator->computeCurrentTransform(&windowTransform); - mLayer->setWindowTransform(windowTransform); - } - SkRect dirty; info.damageAccumulator->peekAtDirty(&dirty); @@ -198,6 +191,12 @@ void RenderNode::pushLayerUpdate(TreeInfo& info) { return; } + if (transformUpdateNeeded) { + // update the transform in window of the layer to reset its origin wrt light source position + Matrix4 windowTransform; + info.damageAccumulator->computeCurrentTransform(&windowTransform); + mLayer->setWindowTransform(windowTransform); + } if (dirty.intersect(0, 0, getWidth(), getHeight())) { dirty.roundOut(); |