summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/android/rendering/Surface.cpp
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2012-05-03 19:55:39 -0700
committerJohn Reck <jreck@google.com>2012-05-04 10:00:45 -0700
commitd30efeae4fa6b64029cfa478fe80981232f502e5 (patch)
tree911d9a55ebeaf92a667ecc29dae57f4accfd449b /Source/WebCore/platform/graphics/android/rendering/Surface.cpp
parent897f9bc8d6e51ba1d0209f219e4c98c8565927e9 (diff)
downloadexternal_webkit-d30efeae4fa6b64029cfa478fe80981232f502e5.zip
external_webkit-d30efeae4fa6b64029cfa478fe80981232f502e5.tar.gz
external_webkit-d30efeae4fa6b64029cfa478fe80981232f502e5.tar.bz2
Broaden fast inval path
Bug: 6445600 Clip fast partial invals to the screen instead of an arbitrary size limit Change-Id: Iafcbcb427566db87420b8bfc54eb9148530913ce
Diffstat (limited to 'Source/WebCore/platform/graphics/android/rendering/Surface.cpp')
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/Surface.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/Source/WebCore/platform/graphics/android/rendering/Surface.cpp b/Source/WebCore/platform/graphics/android/rendering/Surface.cpp
index 437b8ff..c8dfd13 100644
--- a/Source/WebCore/platform/graphics/android/rendering/Surface.cpp
+++ b/Source/WebCore/platform/graphics/android/rendering/Surface.cpp
@@ -216,13 +216,11 @@ void Surface::prepareGL(bool layerTilesDisabled, bool updateWithBlit)
m_surfaceBacking->prepareGL(getFirstLayer()->state(), allowZoom,
prepareArea, fullArea,
this, useAggressiveRendering(), updateWithBlit);
- if (updateWithBlit) {
- for (size_t i = 0; i < m_layers.size(); i++) {
- LayerContent* content = m_layers[i]->content();
- if (content)
- content->clearPrerenders();
- }
- }
+ }
+ for (size_t i = 0; i < m_layers.size(); i++) {
+ LayerContent* content = m_layers[i]->content();
+ if (content)
+ content->clearPrerenders();
}
}
@@ -397,6 +395,13 @@ bool Surface::blitFromContents(Tile* tile)
// Extract the dirty rect from the region. Note that this is *NOT* constrained
// to this tile
IntRect dirtyRect = tile->dirtyArea().getBounds();
+ IntRect tileRect = IntRect(tile->x() * TilesManager::tileWidth(),
+ tile->y() * TilesManager::tileHeight(),
+ TilesManager::tileWidth(),
+ TilesManager::tileHeight());
+ FloatRect tileRectInDoc = tileRect;
+ tileRectInDoc.scale(1 / tile->scale());
+ dirtyRect.intersect(enclosingIntRect(tileRectInDoc));
PrerenderedInval* prerenderedInval = content->prerenderForRect(dirtyRect);
if (!prerenderedInval || prerenderedInval->bitmap.isNull())
return false;
@@ -406,10 +411,6 @@ bool Surface::blitFromContents(Tile* tile)
FloatRect screenDirty = dirtyRect;
screenDirty.scale(tile->scale());
IntRect enclosingScreenDirty = enclosingIntRect(screenDirty);
- IntRect tileRect = IntRect(tile->x() * TilesManager::tileWidth(),
- tile->y() * TilesManager::tileHeight(),
- TilesManager::tileWidth(),
- TilesManager::tileHeight());
enclosingScreenDirty.intersect(tileRect);
if (enclosingScreenDirty.isEmpty())
return false;