diff options
author | Chris Craik <ccraik@google.com> | 2012-03-09 15:36:40 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-03-09 15:36:40 -0800 |
commit | 8cad9237eafa714432d1fea7d73049bcbbf58150 (patch) | |
tree | 8d6f1a0ff4763f4d461f900df5b3c00d6387844a | |
parent | 1a3ed28020480a9db46e41b02a48db209e3d9560 (diff) | |
parent | 03dc91a83094490393aea0c809e6c472ab414949 (diff) | |
download | external_webkit-8cad9237eafa714432d1fea7d73049bcbbf58150.zip external_webkit-8cad9237eafa714432d1fea7d73049bcbbf58150.tar.gz external_webkit-8cad9237eafa714432d1fea7d73049bcbbf58150.tar.bz2 |
Merge "add bounds check in layer merging"
-rw-r--r-- | Source/WebCore/platform/graphics/android/LayerGroup.cpp | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/Source/WebCore/platform/graphics/android/LayerGroup.cpp b/Source/WebCore/platform/graphics/android/LayerGroup.cpp index 5ec41f8..0061a3a 100644 --- a/Source/WebCore/platform/graphics/android/LayerGroup.cpp +++ b/Source/WebCore/platform/graphics/android/LayerGroup.cpp @@ -102,19 +102,21 @@ bool LayerGroup::tryUpdateLayerGroup(LayerGroup* oldLayerGroup) m_dualTiledTexture->markAsDirty(*layerInval); } else { SkRegion invalRegion; - bool fullInval = false; - for (unsigned int i = 0; i < m_layers.size(); i++) { - if (m_layers[i]->uniqueId() != oldLayerGroup->m_layers[i]->uniqueId()) { - // layer list has changed, fully invalidate - // TODO: partially invalidate based on layer size/position - fullInval = true; - break; - } else if (!m_layers[i]->getInvalRegion()->isEmpty()) { - // merge layer inval - translate the layer's inval region into group coordinates - SkPoint pos = m_layers[i]->getPosition(); - m_layers[i]->getInvalRegion()->translate(pos.fX, pos.fY); - invalRegion.op(*(m_layers[i]->getInvalRegion()), SkRegion::kUnion_Op); - break; + bool fullInval = m_layers.size() != oldLayerGroup->m_layers.size(); + if (!fullInval) { + for (unsigned int i = 0; i < m_layers.size(); i++) { + if (m_layers[i]->uniqueId() != oldLayerGroup->m_layers[i]->uniqueId()) { + // layer list has changed, fully invalidate + // TODO: partially invalidate based on layer size/position + fullInval = true; + break; + } else if (!m_layers[i]->getInvalRegion()->isEmpty()) { + // merge layer inval - translate the layer's inval region into group coordinates + SkPoint pos = m_layers[i]->getPosition(); + m_layers[i]->getInvalRegion()->translate(pos.fX, pos.fY); + invalRegion.op(*(m_layers[i]->getInvalRegion()), SkRegion::kUnion_Op); + break; + } } } |