diff options
author | Chris Craik <ccraik@google.com> | 2012-05-10 17:12:47 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-05-10 17:12:47 -0700 |
commit | e35dd347e6dd4854f19a7700488e8d35f3ad1135 (patch) | |
tree | a3f829334805e0123ee47b6d4910defae3fcd6fe /Source/WebCore/platform/graphics | |
parent | a7d428000041f56a22b7bbe41a772d76d91dfcff (diff) | |
parent | bd3f93b66934582acd0b6c70bcf60ca643b36ead (diff) | |
download | external_webkit-e35dd347e6dd4854f19a7700488e8d35f3ad1135.zip external_webkit-e35dd347e6dd4854f19a7700488e8d35f3ad1135.tar.gz external_webkit-e35dd347e6dd4854f19a7700488e8d35f3ad1135.tar.bz2 |
Merge "dirty all tiles when entering/exiting single surface mode" into jb-dev
Diffstat (limited to 'Source/WebCore/platform/graphics')
5 files changed, 37 insertions, 1 deletions
diff --git a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp index bdd8028..1fe30de 100644 --- a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp +++ b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp @@ -369,8 +369,10 @@ int GLWebViewState::drawGL(IntRect& invScreenRect, SkRect& visibleContentRect, nbTexturesNeeded.full += nbTexturesForImages; nbTexturesNeeded.clipped += nbTexturesForImages; - if (setLayersRenderingMode(nbTexturesNeeded)) + if (setLayersRenderingMode(nbTexturesNeeded)) { + TilesManager::instance()->dirtyAllTiles(); returnFlags |= uirenderer::DrawGlInfo::kStatusDraw | uirenderer::DrawGlInfo::kStatusInvoke; + } glBindBuffer(GL_ARRAY_BUFFER, 0); diff --git a/Source/WebCore/platform/graphics/android/rendering/Tile.cpp b/Source/WebCore/platform/graphics/android/rendering/Tile.cpp index 3af05f4..2e2c397 100644 --- a/Source/WebCore/platform/graphics/android/rendering/Tile.cpp +++ b/Source/WebCore/platform/graphics/android/rendering/Tile.cpp @@ -146,6 +146,13 @@ bool Tile::removeTexture(TileTexture* texture) return true; } +void Tile::markAsDirty() +{ + android::AutoMutex lock(m_atomicSync); + m_dirtyArea.setEmpty(); // empty dirty rect prevents fast blit path + markAsDirtyInternal(); +} + void Tile::markAsDirty(const SkRegion& dirtyArea) { if (dirtyArea.isEmpty()) @@ -171,6 +178,13 @@ void Tile::markAsDirty(const SkRegion& dirtyArea) if (!intersect) return; + markAsDirtyInternal(); +} + +void Tile::markAsDirtyInternal() +{ + // NOTE: callers must hold lock on m_atomicSync + m_dirty = true; if (m_state == UpToDate) { // We only mark a tile as unpainted in 'markAsDirty' if its status is diff --git a/Source/WebCore/platform/graphics/android/rendering/Tile.h b/Source/WebCore/platform/graphics/android/rendering/Tile.h index 9697b61..4c8052c 100644 --- a/Source/WebCore/platform/graphics/android/rendering/Tile.h +++ b/Source/WebCore/platform/graphics/android/rendering/Tile.h @@ -114,6 +114,7 @@ public: SkRect& realTileRect); bool isTileVisible(const IntRect& viewTileBounds); + void markAsDirty(); void markAsDirty(const SkRegion& dirtyArea); bool isDirty(); const SkRegion& dirtyArea() { return m_dirtyArea; } @@ -140,6 +141,7 @@ public: virtual bool removeTexture(TileTexture* texture); private: + void markAsDirtyInternal(); void validatePaint(); int m_x; diff --git a/Source/WebCore/platform/graphics/android/rendering/TilesManager.cpp b/Source/WebCore/platform/graphics/android/rendering/TilesManager.cpp index 6e22d25..66c4bf3 100644 --- a/Source/WebCore/platform/graphics/android/rendering/TilesManager.cpp +++ b/Source/WebCore/platform/graphics/android/rendering/TilesManager.cpp @@ -235,6 +235,21 @@ void TilesManager::gatherTexturesNumbers(int* nbTextures, int* nbAllocatedTextur } } +void TilesManager::dirtyTexturesVector(WTF::Vector<TileTexture*>& textures) +{ + for (unsigned int i = 0; i < textures.size(); i++) { + Tile* currentOwner = static_cast<Tile*>(textures[i]->owner()); + if (currentOwner) + currentOwner->markAsDirty(); + } +} + +void TilesManager::dirtyAllTiles() +{ + dirtyTexturesVector(m_textures); + dirtyTexturesVector(m_tilesTextures); +} + void TilesManager::printTextures() { #ifdef DEBUG diff --git a/Source/WebCore/platform/graphics/android/rendering/TilesManager.h b/Source/WebCore/platform/graphics/android/rendering/TilesManager.h index 295acf6..5ad508c 100644 --- a/Source/WebCore/platform/graphics/android/rendering/TilesManager.h +++ b/Source/WebCore/platform/graphics/android/rendering/TilesManager.h @@ -77,6 +77,8 @@ public: TileTexture* getAvailableTexture(Tile* owner); + void dirtyAllTiles(); + void printTextures(); // m_highEndGfx is written/read only on UI thread, no need for a lock. @@ -164,6 +166,7 @@ private: void discardTexturesVector(unsigned long long sparedDrawCount, WTF::Vector<TileTexture*>& textures, bool deallocateGLTextures); + void dirtyTexturesVector(WTF::Vector<TileTexture*>& textures); void markAllGLTexturesZero(); bool updateContextIfChanged(); int getMaxTextureAllocation(); |