summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/android/GLWebViewState.cpp
diff options
context:
space:
mode:
authorNicolas Roard <nicolas@android.com>2011-03-07 11:14:44 -0800
committerNicolas Roard <nicolasroard@google.com>2011-03-08 18:55:55 -0800
commit67e4aa15702646d5ff50e9524f4e63eb9ed20122 (patch)
tree054c51b8413613ea13248dad4fae47f1bd4f2426 /WebCore/platform/graphics/android/GLWebViewState.cpp
parentdeb796f509e2ad13b4ef4c01b1a1e707b4e762ee (diff)
downloadexternal_webkit-67e4aa15702646d5ff50e9524f4e63eb9ed20122.zip
external_webkit-67e4aa15702646d5ff50e9524f4e63eb9ed20122.tar.gz
external_webkit-67e4aa15702646d5ff50e9524f4e63eb9ed20122.tar.bz2
Partial invalidation of the browser textures
bug:3461349 bug:3464483 Change-Id: I627f06d0fe48aaa0adca65cd13dc738af87eeefc
Diffstat (limited to 'WebCore/platform/graphics/android/GLWebViewState.cpp')
-rw-r--r--WebCore/platform/graphics/android/GLWebViewState.cpp26
1 files changed, 20 insertions, 6 deletions
diff --git a/WebCore/platform/graphics/android/GLWebViewState.cpp b/WebCore/platform/graphics/android/GLWebViewState.cpp
index 20a231c..444ff17 100644
--- a/WebCore/platform/graphics/android/GLWebViewState.cpp
+++ b/WebCore/platform/graphics/android/GLWebViewState.cpp
@@ -110,7 +110,7 @@ GLWebViewState::~GLWebViewState()
#endif
}
-void GLWebViewState::setBaseLayer(BaseLayerAndroid* layer, const IntRect& rect,
+void GLWebViewState::setBaseLayer(BaseLayerAndroid* layer, const SkRegion& inval,
bool showVisualIndicator)
{
android::Mutex::Autolock lock(m_baseLayerLock);
@@ -131,7 +131,7 @@ void GLWebViewState::setBaseLayer(BaseLayerAndroid* layer, const IntRect& rect,
SkSafeUnref(m_currentBaseLayer);
m_currentBaseLayer = layer;
}
- inval(rect);
+ invalRegion(inval);
#ifdef MEASURES_PERF
if (m_measurePerfs && !showVisualIndicator)
@@ -142,15 +142,29 @@ void GLWebViewState::setBaseLayer(BaseLayerAndroid* layer, const IntRect& rect,
TilesManager::instance()->setShowVisualIndicator(showVisualIndicator);
}
+void GLWebViewState::invalRegion(const SkRegion& region)
+{
+ SkRegion::Iterator iterator(region);
+ while (!iterator.done()) {
+ SkIRect r = iterator.rect();
+ IntRect ir(r.fLeft, r.fTop, r.width(), r.height());
+ inval(ir);
+ iterator.next();
+ }
+}
+
void GLWebViewState::unlockBaseLayerUpdate() {
+ if (m_baseLayerUpdate)
+ return;
+
m_baseLayerUpdate = true;
android::Mutex::Autolock lock(m_baseLayerLock);
SkSafeRef(m_baseLayer);
SkSafeUnref(m_currentBaseLayer);
m_currentBaseLayer = m_baseLayer;
- inval(m_invalidateRect);
- IntRect empty;
- m_invalidateRect = empty;
+
+ invalRegion(m_invalidateRegion);
+ m_invalidateRegion.setEmpty();
}
void GLWebViewState::setExtra(BaseLayerAndroid* layer, SkPicture& picture,
@@ -182,7 +196,7 @@ void GLWebViewState::inval(const IntRect& rect)
m_tiledPageB->invalidateRect(rect, m_currentPictureCounter);
}
} else {
- m_invalidateRect.unite(rect);
+ m_invalidateRegion.op(rect.x(), rect.y(), rect.right(), rect.bottom(), SkRegion::kUnion_Op);
}
}