diff options
author | Nicolas Roard <nicolas@android.com> | 2011-01-25 19:01:55 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-01-25 19:01:55 -0800 |
commit | 85e27b62cf6f85f2e8d5694b285be78a3a090b22 (patch) | |
tree | 9817a3dd85737fa3a4fbf78c02e06e520e4c74eb /WebCore/platform/graphics/android/LayerAndroid.cpp | |
parent | 71895be64040f1060c51740c999a3747372d3c35 (diff) | |
parent | bc87f888df256a489e174b10c22d270f64903a3e (diff) | |
download | external_webkit-85e27b62cf6f85f2e8d5694b285be78a3a090b22.zip external_webkit-85e27b62cf6f85f2e8d5694b285be78a3a090b22.tar.gz external_webkit-85e27b62cf6f85f2e8d5694b285be78a3a090b22.tar.bz2 |
Merge "Implement a workaround for the texture corruption" into honeycomb
Diffstat (limited to 'WebCore/platform/graphics/android/LayerAndroid.cpp')
-rw-r--r-- | WebCore/platform/graphics/android/LayerAndroid.cpp | 30 |
1 files changed, 12 insertions, 18 deletions
diff --git a/WebCore/platform/graphics/android/LayerAndroid.cpp b/WebCore/platform/graphics/android/LayerAndroid.cpp index 2f55292..03bb11d 100644 --- a/WebCore/platform/graphics/android/LayerAndroid.cpp +++ b/WebCore/platform/graphics/android/LayerAndroid.cpp @@ -636,8 +636,7 @@ void LayerAndroid::createGLTextures() m_atomicSync.unlock(); if (reservedTexture && - (reservedTexture != m_drawingTexture) && - reservedTexture->isReady()) { + (reservedTexture != m_drawingTexture)) { if (m_drawingTexture) { TilesManager::instance()->removeOperationsForTexture(m_drawingTexture); m_drawingTexture->release(this); @@ -652,8 +651,8 @@ void LayerAndroid::createGLTextures() if (!m_requestSent) { m_requestSent = true; m_atomicSync.unlock(); - XLOG("We schedule a paint for layer %d (%x), because isReady %d or m_dirty %d, using texture %x (%d, %d)", - uniqueId(), this, m_reservedTexture->isReady(), m_dirty, m_reservedTexture, + XLOG("We schedule a paint for layer %d (%x), because m_dirty %d, using texture %x (%d, %d)", + uniqueId(), this, m_dirty, m_reservedTexture, m_reservedTexture->rect().width(), m_reservedTexture->rect().height()); PaintLayerOperation* operation = new PaintLayerOperation(this); TilesManager::instance()->scheduleOperation(operation); @@ -669,18 +668,16 @@ bool LayerAndroid::needsScheduleRepaint(LayerTexture* texture) if (!texture) return false; - if (!m_pictureUsed == -1 || texture->pictureUsed() != m_pictureUsed) { + if (m_pictureUsed == -1 || + texture->pictureUsed() == -1 || + texture->pictureUsed() != m_pictureUsed) { XLOG("We mark layer %d (%x) as dirty because: m_pictureUsed(%d == 0?), texture picture used %x", uniqueId(), this, m_pictureUsed, texture->pictureUsed()); if (m_pictureUsed == -1) m_pictureUsed = 0; - texture->setPictureUsed(m_pictureUsed); m_dirty = true; } - if (!texture->isReady()) - m_dirty = true; - return m_dirty; } @@ -701,7 +698,7 @@ bool LayerAndroid::drawGL(SkMatrix& matrix) if (prepareContext() && m_drawingTexture) { TextureInfo* textureInfo = m_drawingTexture->consumerLock(); - if (textureInfo && m_drawingTexture->isReady()) { + if (textureInfo) { SkRect bounds; IntRect textureRect = m_drawingTexture->rect(); bounds.set(0, 0, textureRect.width(), textureRect.height()); @@ -805,18 +802,15 @@ void LayerAndroid::paintBitmapGL() contentDraw(canvas); canvas->restore(); - XLOG("LayerAndroid %d paintBitmapGL PAINTING DONE, updating the texture", uniqueId()); - texture->producerUpdate(textureInfo); - - while (!texture->isReady()) { - TextureInfo* textureInfo = texture->producerLock(); - texture->producerUpdate(textureInfo); - } - m_atomicSync.lock(); m_dirty = false; m_requestSent = false; + texture->setPictureUsed(m_pictureUsed); m_atomicSync.unlock(); + + XLOG("LayerAndroid %d paintBitmapGL PAINTING DONE, updating the texture", uniqueId()); + texture->producerUpdate(textureInfo); + XLOG("LayerAndroid %d paintBitmapGL UPDATING DONE", uniqueId()); } |