diff options
Diffstat (limited to 'WebCore/platform')
-rw-r--r-- | WebCore/platform/graphics/android/BaseTile.cpp | 17 | ||||
-rw-r--r-- | WebCore/platform/graphics/android/LayerAndroid.cpp | 12 |
2 files changed, 15 insertions, 14 deletions
diff --git a/WebCore/platform/graphics/android/BaseTile.cpp b/WebCore/platform/graphics/android/BaseTile.cpp index 5701486..789cbe0 100644 --- a/WebCore/platform/graphics/android/BaseTile.cpp +++ b/WebCore/platform/graphics/android/BaseTile.cpp @@ -168,8 +168,12 @@ void BaseTile::draw(float transparency, SkRect& rect) } // Early return if set to un-usable in purpose! - if (!m_usable) { - XLOG("early return at BaseTile::draw b/c tile set to unusable !"); + m_atomicSync.lock(); + bool usable = m_usable; + bool isTexturePainted = m_lastPaintedPicture; + m_atomicSync.unlock(); + if (!usable || !isTexturePainted) { + XLOG("early return at BaseTile::draw b/c tile set to unusable or not painted !"); return; } @@ -180,13 +184,8 @@ void BaseTile::draw(float transparency, SkRect& rect) return; } - m_atomicSync.lock(); - bool isTexturePainted = m_lastPaintedPicture; - m_atomicSync.unlock(); - - if (isTexturePainted) - TilesManager::instance()->shader()->drawQuad(rect, textureInfo->m_textureId, - transparency); + TilesManager::instance()->shader()->drawQuad(rect, textureInfo->m_textureId, + transparency); m_texture->consumerRelease(); } diff --git a/WebCore/platform/graphics/android/LayerAndroid.cpp b/WebCore/platform/graphics/android/LayerAndroid.cpp index b71f525..15b992a 100644 --- a/WebCore/platform/graphics/android/LayerAndroid.cpp +++ b/WebCore/platform/graphics/android/LayerAndroid.cpp @@ -316,10 +316,10 @@ public: bool drewText() { return m_findCheck.drewText(); } - void setBest(const LayerAndroid* best) { + void setBest(const LayerAndroid* best, int x, int y) { m_best = best; - m_bestX = m_x; - m_bestY = m_y; + m_bestX = x; + m_bestY = y; } int x() const { return m_x; } int y() const { return m_y; } @@ -354,12 +354,14 @@ void LayerAndroid::findInner(LayerAndroid::FindState& state) const for (int i = 0; i < countChildren(); i++) getChild(i)->findInner(state); // Move back into the parent coordinates. + int testX = state.x(); + int testY = state.y(); state.setLocation(x + localBounds.fLeft, y + localBounds.fTop); if (!m_recordingPicture) return; - if (!state.drew(m_recordingPicture, localBounds)) + if (!contentIsScrollable() && !state.drew(m_recordingPicture, localBounds)) return; - state.setBest(this); // set last match (presumably on top) + state.setBest(this, testX, testY); // set last match (presumably on top) } const LayerAndroid* LayerAndroid::find(int* xPtr, int* yPtr, SkPicture* root) const |