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/Surface.cpp19
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/Surface.h1
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/SurfaceBacking.cpp9
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/SurfaceBacking.h2
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.cpp6
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.h1
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp11
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/TileGrid.cpp3
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/TileGrid.h2
9 files changed, 40 insertions, 14 deletions
diff --git a/Source/WebCore/platform/graphics/android/rendering/Surface.cpp b/Source/WebCore/platform/graphics/android/rendering/Surface.cpp
index 7e4e918..20a9c2b 100644
--- a/Source/WebCore/platform/graphics/android/rendering/Surface.cpp
+++ b/Source/WebCore/platform/graphics/android/rendering/Surface.cpp
@@ -253,8 +253,12 @@ bool Surface::drawGL(bool layerTilesDisabled)
}
// draw member layers (draws image textures, glextras)
- for (unsigned int i = 0; i < m_layers.size(); i++)
- askRedraw |= m_layers[i]->drawGL(tilesDisabled);
+ for (unsigned int i = 0; i < m_layers.size(); i++) {
+ if (m_layers[i]->drawGL(tilesDisabled)) {
+ m_layers[i]->addDirtyArea();
+ askRedraw = true;
+ }
+ }
return askRedraw;
}
@@ -264,7 +268,16 @@ void Surface::swapTiles()
if (!m_surfaceBacking)
return;
- m_surfaceBacking->swapTiles();
+ if (m_surfaceBacking->swapTiles())
+ addFrameworkInvals();
+}
+
+void Surface::addFrameworkInvals()
+{
+ // Let's return an inval area to framework that will
+ // contain all of our layers' areas
+ for (unsigned int i = 0; i < m_layers.size(); i++)
+ m_layers[i]->addDirtyArea();
}
bool Surface::isReady()
diff --git a/Source/WebCore/platform/graphics/android/rendering/Surface.h b/Source/WebCore/platform/graphics/android/rendering/Surface.h
index 7100125..0286259 100644
--- a/Source/WebCore/platform/graphics/android/rendering/Surface.h
+++ b/Source/WebCore/platform/graphics/android/rendering/Surface.h
@@ -52,6 +52,7 @@ public:
void prepareGL(bool layerTilesDisabled, bool updateWithBlit);
bool drawGL(bool layerTilesDisabled);
void swapTiles();
+ void addFrameworkInvals();
bool isReady();
bool isMissingContent();
bool canUpdateWithBlit();
diff --git a/Source/WebCore/platform/graphics/android/rendering/SurfaceBacking.cpp b/Source/WebCore/platform/graphics/android/rendering/SurfaceBacking.cpp
index af96560..78a9861 100644
--- a/Source/WebCore/platform/graphics/android/rendering/SurfaceBacking.cpp
+++ b/Source/WebCore/platform/graphics/android/rendering/SurfaceBacking.cpp
@@ -146,11 +146,12 @@ void SurfaceBacking::markAsDirty(const SkRegion& dirtyArea)
m_lowResTileGrid->markAsDirty(dirtyArea);
}
-void SurfaceBacking::swapTiles()
+bool SurfaceBacking::swapTiles()
{
- m_backTileGrid->swapTiles();
- m_frontTileGrid->swapTiles();
- m_lowResTileGrid->swapTiles();
+ bool swap = m_backTileGrid->swapTiles();
+ swap |= m_frontTileGrid->swapTiles();
+ swap |= m_lowResTileGrid->swapTiles();
+ return swap;
}
void SurfaceBacking::computeTexturesAmount(TexturesResult* result, LayerAndroid* layer)
diff --git a/Source/WebCore/platform/graphics/android/rendering/SurfaceBacking.h b/Source/WebCore/platform/graphics/android/rendering/SurfaceBacking.h
index 7d3e93c..137a25b 100644
--- a/Source/WebCore/platform/graphics/android/rendering/SurfaceBacking.h
+++ b/Source/WebCore/platform/graphics/android/rendering/SurfaceBacking.h
@@ -44,7 +44,7 @@ public:
const IntRect& prepareArea, const IntRect& fullContentArea,
TilePainter* painter, bool aggressiveRendering,
bool updateWithBlit);
- void swapTiles();
+ bool swapTiles();
void drawGL(const IntRect& visibleContentArea, float opacity,
const TransformationMatrix* transform, bool aggressiveRendering,
const Color* background);
diff --git a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.cpp b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.cpp
index f3415af..77b238e 100644
--- a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.cpp
+++ b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.cpp
@@ -139,6 +139,12 @@ void SurfaceCollection::swapTiles()
m_surfaces[i]->swapTiles();
}
+void SurfaceCollection::addFrameworkInvals()
+{
+ for (unsigned int i = 0; i < m_surfaces.size(); i++)
+ m_surfaces[i]->addFrameworkInvals();
+}
+
bool SurfaceCollection::isReady()
{
// Override layer readiness check for single surface mode
diff --git a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.h b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.h
index b502142..5eb5d65 100644
--- a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.h
+++ b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.h
@@ -52,6 +52,7 @@ public:
bool drawGL(const SkRect& visibleContentRect);
Color getBackgroundColor();
void swapTiles();
+ void addFrameworkInvals();
bool isReady();
bool isBaseSurfaceReady();
bool isMissingBackgroundContent();
diff --git a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp
index b4fd699..5abca02 100644
--- a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp
+++ b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp
@@ -68,12 +68,14 @@ void SurfaceCollectionManager::swap()
// if we have a drawing collection, discard it since the painting collection is done
if (m_drawingCollection) {
ALOGV("destroying drawing collection %p", m_drawingCollection);
+ m_drawingCollection->addFrameworkInvals();
SkSafeUnref(m_drawingCollection);
}
// painting collection becomes the drawing collection
ALOGV("drawing collection %p", m_paintingCollection);
m_paintingCollection->setIsDrawing(); // initialize animations
+ m_paintingCollection->addFrameworkInvals();
if (m_queuedCollection) {
// start painting with the queued collection
@@ -203,6 +205,10 @@ int SurfaceCollectionManager::drawGL(double currentTime, IntRect& viewRect,
m_drawingCollection, m_paintingCollection,
m_queuedCollection, m_fastSwapMode, shouldDraw);
+ // ask for kStatusInvoke while painting, kStatusDraw if we have content to be redrawn next frame
+ // returning 0 indicates all painting complete, no framework inval needed.
+ int returnFlags = 0;
+
bool didCollectionSwap = false;
if (m_paintingCollection) {
ALOGV("preparing painting collection %p", m_paintingCollection);
@@ -222,6 +228,7 @@ int SurfaceCollectionManager::drawGL(double currentTime, IntRect& viewRect,
if (newCollectionHasAnimPtr)
*newCollectionHasAnimPtr = m_paintingCollection->hasCompositedAnimations();
swap();
+ returnFlags |= uirenderer::DrawGlInfo::kStatusDraw;
}
} else if (m_drawingCollection) {
ALOGV("preparing drawing collection %p", m_drawingCollection);
@@ -229,10 +236,6 @@ int SurfaceCollectionManager::drawGL(double currentTime, IntRect& viewRect,
m_drawingCollection->computeTexturesAmount(texturesResultPtr);
}
- // ask for kStatusInvoke while painting, kStatusDraw if we have content to be redrawn next frame
- // returning 0 indicates all painting complete, no framework inval needed.
- int returnFlags = 0;
-
if (m_paintingCollection)
returnFlags |= DrawGlInfo::kStatusInvoke;
diff --git a/Source/WebCore/platform/graphics/android/rendering/TileGrid.cpp b/Source/WebCore/platform/graphics/android/rendering/TileGrid.cpp
index 3487acd..9cd904e 100644
--- a/Source/WebCore/platform/graphics/android/rendering/TileGrid.cpp
+++ b/Source/WebCore/platform/graphics/android/rendering/TileGrid.cpp
@@ -97,13 +97,14 @@ bool TileGrid::isMissingContent()
return false;
}
-void TileGrid::swapTiles()
+bool TileGrid::swapTiles()
{
int swaps = 0;
for (unsigned int i = 0; i < m_tiles.size(); i++)
if (m_tiles[i]->swapTexturesIfNeeded())
swaps++;
ALOGV("TG %p swapping, swaps = %d", this, swaps);
+ return swaps != 0;
}
IntRect TileGrid::computeTilesArea(const IntRect& contentArea, float scale)
diff --git a/Source/WebCore/platform/graphics/android/rendering/TileGrid.h b/Source/WebCore/platform/graphics/android/rendering/TileGrid.h
index b480419..665f4ec 100644
--- a/Source/WebCore/platform/graphics/android/rendering/TileGrid.h
+++ b/Source/WebCore/platform/graphics/android/rendering/TileGrid.h
@@ -52,7 +52,7 @@ public:
const IntRect& prepareArea, const IntRect& fullContentArea,
TilePainter* painter, int regionFlags = StandardRegion,
bool isLowResPrefetch = false, bool updateWithBlit = false);
- void swapTiles();
+ bool swapTiles();
void drawGL(const IntRect& visibleContentArea, float opacity,
const TransformationMatrix* transform, const Color* background = 0);