diff options
author | Derek Sollenberger <djsollen@google.com> | 2010-11-02 11:15:08 -0400 |
---|---|---|
committer | Derek Sollenberger <djsollen@google.com> | 2010-11-04 09:53:33 -0400 |
commit | fc92ca2409a95b539274985812d88016b6b84b7e (patch) | |
tree | f7e226a3dc2ea59204b6556845962e431ca9dbd0 /WebCore/platform/graphics/android/BackedDoubleBufferedTexture.cpp | |
parent | 2689b38c74169006cadfbce7184976223bc13afc (diff) | |
download | external_webkit-fc92ca2409a95b539274985812d88016b6b84b7e.zip external_webkit-fc92ca2409a95b539274985812d88016b6b84b7e.tar.gz external_webkit-fc92ca2409a95b539274985812d88016b6b84b7e.tar.bz2 |
Support partial invalidation of tiles based on webkit's inval rect.
This CL causes the selective repainting of BaseTiles (and their
associated GL textures) using the information provided by Webkit.
If tiles need repainted they are marked with as dirty and the
thread painting and uploading the textures will only operate on
dirty tiles. This change resulted in some significant refactoring
most of which revolved around these changes...
(1) Removed PaintingInfo from the Texture object and instead track
the state of the tile in Tile object.
(2) Removed all pending TileSets for a TiledPage when the page
produces a new set. This ensures that the tiles currently visible
to the user are painted instead of ones that may already be offscreen.
Change-Id: I93845d8e6e7b066e6bab84bcde11be4a6940002f
Diffstat (limited to 'WebCore/platform/graphics/android/BackedDoubleBufferedTexture.cpp')
-rw-r--r-- | WebCore/platform/graphics/android/BackedDoubleBufferedTexture.cpp | 38 |
1 files changed, 6 insertions, 32 deletions
diff --git a/WebCore/platform/graphics/android/BackedDoubleBufferedTexture.cpp b/WebCore/platform/graphics/android/BackedDoubleBufferedTexture.cpp index 7cecddd..1a8e686 100644 --- a/WebCore/platform/graphics/android/BackedDoubleBufferedTexture.cpp +++ b/WebCore/platform/graphics/android/BackedDoubleBufferedTexture.cpp @@ -56,28 +56,27 @@ BackedDoubleBufferedTexture::~BackedDoubleBufferedTexture() TextureInfo* BackedDoubleBufferedTexture::producerLock() { - m_varLock.lock(); + m_busyLock.lock(); m_busy = true; - m_varLock.unlock(); + m_busyLock.unlock(); return DoubleBufferedTexture::producerLock(); } void BackedDoubleBufferedTexture::producerRelease() { DoubleBufferedTexture::producerRelease(); - android::Mutex::Autolock lock(m_varLock); + android::Mutex::Autolock lock(m_busyLock); m_busy = false; } void BackedDoubleBufferedTexture::producerReleaseAndSwap() { DoubleBufferedTexture::producerReleaseAndSwap(); - android::Mutex::Autolock lock(m_varLock); + android::Mutex::Autolock lock(m_busyLock); m_busy = false; } -void BackedDoubleBufferedTexture::producerUpdate(BaseTile* painter, - TextureInfo* textureInfo, PaintingInfo& info) +void BackedDoubleBufferedTexture::producerUpdate(TextureInfo* textureInfo) { // no need to upload a texture since the bitmap is empty if (!m_bitmap.width() && !m_bitmap.height()) { @@ -93,34 +92,9 @@ void BackedDoubleBufferedTexture::producerUpdate(BaseTile* painter, textureInfo->m_height = m_bitmap.height(); } - m_varLock.lock(); - // set the painting information for this texture - if (equalsIdTextureA(textureInfo->m_textureId)) - m_paintingInfoA = info; - else if (equalsIdTextureB(textureInfo->m_textureId)) - m_paintingInfoB = info; - m_varLock.unlock(); - producerReleaseAndSwap(); } -// Compare the current texture displayed with some PaintingInfo. -bool BackedDoubleBufferedTexture::consumerTextureUpToDate(PaintingInfo& info) -{ - android::Mutex::Autolock lock(m_varLock); - if (isTextureAReadable()) - return info == m_paintingInfoA; - return info == m_paintingInfoB; -} - -bool BackedDoubleBufferedTexture::consumerTextureSimilar(PaintingInfo& info) -{ - android::Mutex::Autolock lock(m_varLock); - if (isTextureAReadable()) - return info.similar(m_paintingInfoA); - return info.similar(m_paintingInfoB); -} - bool BackedDoubleBufferedTexture::acquire(BaseTile* owner) { if (m_owner == owner) @@ -128,7 +102,7 @@ bool BackedDoubleBufferedTexture::acquire(BaseTile* owner) // if the writable texture is busy (i.e. currently being written to) then we // can't change the owner out from underneath that texture - android::Mutex::Autolock lock(m_varLock); + android::Mutex::Autolock lock(m_busyLock); if (!m_busy) { if (m_owner) m_owner->removeTexture(); |