summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/android/rendering
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/platform/graphics/android/rendering')
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/GLUtils.cpp12
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/Tile.cpp14
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/Tile.h2
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/TilesManager.cpp15
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/TilesManager.h3
5 files changed, 42 insertions, 4 deletions
diff --git a/Source/WebCore/platform/graphics/android/rendering/GLUtils.cpp b/Source/WebCore/platform/graphics/android/rendering/GLUtils.cpp
index 19dc1f8..bfa0789 100644
--- a/Source/WebCore/platform/graphics/android/rendering/GLUtils.cpp
+++ b/Source/WebCore/platform/graphics/android/rendering/GLUtils.cpp
@@ -533,9 +533,11 @@ void GLUtils::createTextureWithBitmap(GLuint texture, const SkBitmap& bitmap, GL
#ifndef DEBUG
if (allowGLLog())
#endif
- ALOGE("GL ERROR: glTexImage2D parameters are : bitmap.width() %d, bitmap.height() %d,"
+ ALOGE("GL ERROR: glTexImage2D parameters are : textureId %d,"
+ " bitmap.width() %d, bitmap.height() %d,"
" internalformat 0x%x, type 0x%x, bitmap.getPixels() %p",
- bitmap.width(), bitmap.height(), internalformat, type, bitmap.getPixels());
+ texture, bitmap.width(), bitmap.height(), internalformat, type,
+ bitmap.getPixels());
}
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter);
@@ -563,9 +565,11 @@ void GLUtils::updateTextureWithBitmap(GLuint texture, const SkBitmap& bitmap,
#ifndef DEBUG
if (allowGLLog())
#endif
- ALOGE("GL ERROR: glTexSubImage2D parameters are : bitmap.width() %d, bitmap.height() %d,"
+ ALOGE("GL ERROR: glTexSubImage2D parameters are : textureId %d,"
+ " bitmap.width() %d, bitmap.height() %d,"
" internalformat 0x%x, type 0x%x, bitmap.getPixels() %p",
- bitmap.width(), bitmap.height(), internalformat, type, bitmap.getPixels());
+ texture, bitmap.width(), bitmap.height(), internalformat, type,
+ bitmap.getPixels());
}
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter);
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 676d703..ce5904f 100644
--- a/Source/WebCore/platform/graphics/android/rendering/TilesManager.h
+++ b/Source/WebCore/platform/graphics/android/rendering/TilesManager.h
@@ -82,6 +82,8 @@ public:
TileTexture* getAvailableTexture(Tile* owner);
+ void dirtyAllTiles();
+
void printTextures();
// m_highEndGfx is written/read only on UI thread, no need for a lock.
@@ -169,6 +171,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();