diff options
-rw-r--r-- | Source/WebCore/platform/graphics/android/BaseTile.cpp | 20 | ||||
-rw-r--r-- | Source/WebCore/platform/graphics/android/TilesManager.cpp | 24 | ||||
-rw-r--r-- | Source/WebKit/android/RenderSkinMediaButton.cpp | 2 | ||||
-rw-r--r-- | Source/WebKit/android/jni/PictureSet.cpp | 21 |
4 files changed, 33 insertions, 34 deletions
diff --git a/Source/WebCore/platform/graphics/android/BaseTile.cpp b/Source/WebCore/platform/graphics/android/BaseTile.cpp index dc17a21..a4ce788 100644 --- a/Source/WebCore/platform/graphics/android/BaseTile.cpp +++ b/Source/WebCore/platform/graphics/android/BaseTile.cpp @@ -135,13 +135,12 @@ void BaseTile::reserveTexture() if (texture && m_backTexture != texture) { m_swapDrawCount = 0; // no longer ready to swap m_backTexture = texture; - - // this is to catch when the front texture is stolen from beneath us. We - // should refine the stealing method to be simpler, and not require last - // moment checks like this - if (!m_frontTexture) - m_dirty = true; } + + // a texture reservation will only happen if we're dirty, or ready to + // swap. if it's the former, ensure it's marked dirty. + if (!m_swapDrawCount) + m_dirty = true; } bool BaseTile::removeTexture(BaseTileTexture* texture) @@ -150,12 +149,15 @@ bool BaseTile::removeTexture(BaseTileTexture* texture) this, m_backTexture, m_frontTexture, m_page); // We update atomically, so paintBitmap() can see the correct value android::AutoMutex lock(m_atomicSync); - if (m_frontTexture == texture) { + if (m_frontTexture == texture) m_frontTexture = 0; - m_dirty = true; - } if (m_backTexture == texture) m_backTexture = 0; + + // mark dirty regardless of which texture was taken - the back texture may + // have been ready to swap + m_dirty = true; + return true; } diff --git a/Source/WebCore/platform/graphics/android/TilesManager.cpp b/Source/WebCore/platform/graphics/android/TilesManager.cpp index ee35ce2..e1d7665 100644 --- a/Source/WebCore/platform/graphics/android/TilesManager.cpp +++ b/Source/WebCore/platform/graphics/android/TilesManager.cpp @@ -267,11 +267,13 @@ BaseTileTexture* TilesManager::getAvailableTexture(BaseTile* owner) } // The heuristic for selecting a texture is as follows: - // 1. If a tile isn't owned, break with that one - // 2. Don't let tiles acquire their front textures - // 3. If we find a tile in the same page with a different scale, + // 1. Skip textures currently being painted, they can't be painted while + // busy anyway + // 2. If a tile isn't owned, break with that one + // 3. Don't let tiles acquire their front textures + // 4. If we find a tile in the same page with a different scale, // it's old and not visible. Break with that one - // 4. Otherwise, use the least recently prepared tile, but ignoring tiles + // 5. Otherwise, use the least recently prepared tile, but ignoring tiles // drawn in the last frame to avoid flickering BaseTileTexture* farthestTexture = 0; @@ -280,15 +282,23 @@ BaseTileTexture* TilesManager::getAvailableTexture(BaseTile* owner) for (unsigned int i = 0; i < max; i++) { BaseTileTexture* texture = (*availableTexturePool)[i]; TextureOwner* currentOwner = texture->owner(); + + if (texture->busy()) { + // don't bother, since the acquire() will likely fail + continue; + } + if (!currentOwner) { + // unused texture! take it! farthestTexture = texture; break; } - // Don't let a tile acquire its own front texture, as the acquisition - // logic doesn't handle that - if (currentOwner == owner) + if (currentOwner == owner) { + // Don't let a tile acquire its own front texture, as the + // acquisition logic doesn't handle that continue; + } if (currentOwner->page() == owner->page() && texture->scale() != owner->scale()) { // if we render the back page with one scale, then another while diff --git a/Source/WebKit/android/RenderSkinMediaButton.cpp b/Source/WebKit/android/RenderSkinMediaButton.cpp index 294dec5..ef4b313 100644 --- a/Source/WebKit/android/RenderSkinMediaButton.cpp +++ b/Source/WebKit/android/RenderSkinMediaButton.cpp @@ -62,7 +62,7 @@ static const PatchData gFiles[] = { "ic_media_video_poster.png", 0, 0 }, // VIDEO { "btn_media_player_disabled.9.png", 0, 0 }, // BACKGROUND_SLIDER { "scrubber_track_holo_dark.9.png", 0, 0 }, // SLIDER_TRACK - { "scrubber_control_holo.png", 0, 0 } // SLIDER_THUMB + { "scrubber_control_normal_holo.png", 0, 0 } // SLIDER_THUMB }; static SkBitmap gButton[sizeof(gFiles)/sizeof(gFiles[0])]; diff --git a/Source/WebKit/android/jni/PictureSet.cpp b/Source/WebKit/android/jni/PictureSet.cpp index e6a9ed5..f61e0f1 100644 --- a/Source/WebKit/android/jni/PictureSet.cpp +++ b/Source/WebKit/android/jni/PictureSet.cpp @@ -356,23 +356,10 @@ void PictureSet::splitAdd(const SkIRect& rect) SkIRect newRect; int deltaX = i * maxSize; int deltaY = j * maxSize; - int left, top, right, bottom; - if (i == firstTileX) - left = rect.fLeft; - else - left = 0; - if (j == firstTileY) - top = rect.fTop; - else - top = 0; - if (i == lastTileX) - right = rect.fRight % maxSize; - else - right = maxSize; - if (j == lastTileY) - bottom = rect.fBottom % maxSize; - else - bottom = maxSize; + int left = (i == firstTileX) ? rect.fLeft - deltaX : 0; + int top = (j == firstTileY) ? rect.fTop - deltaY : 0; + int right = (i == lastTileX) ? rect.fRight % maxSize : maxSize; + int bottom = (j == lastTileY) ? rect.fBottom % maxSize : maxSize; newRect.set(left, top, right, bottom); addToBucket(bucket, deltaX, deltaY, newRect); |