summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics
diff options
context:
space:
mode:
authorNicolas Roard <nicolas@android.com>2011-01-28 16:56:27 -0800
committerNicolas Roard <nicolas@android.com>2011-01-28 16:56:27 -0800
commit5e3e997a109b7e20ddd7e04c6ec14b01dac2f32a (patch)
tree24eff5a22fead6f166a9ed6ca3491b0bd9ca040c /WebCore/platform/graphics
parent8f5ffb1668422c85060b1e2a32c3ff52f83224e1 (diff)
downloadexternal_webkit-5e3e997a109b7e20ddd7e04c6ec14b01dac2f32a.zip
external_webkit-5e3e997a109b7e20ddd7e04c6ec14b01dac2f32a.tar.gz
external_webkit-5e3e997a109b7e20ddd7e04c6ec14b01dac2f32a.tar.bz2
Fix flickering when drawing extras, as well as continuous repaint
when extras are drawn. bug:3396281 bug:3387206 bug:3345802 Change-Id: I445c3bbd27a4c11b7f1b2cf6702b00835172754b
Diffstat (limited to 'WebCore/platform/graphics')
-rw-r--r--WebCore/platform/graphics/android/GLWebViewState.cpp23
-rw-r--r--WebCore/platform/graphics/android/GLWebViewState.h2
2 files changed, 16 insertions, 9 deletions
diff --git a/WebCore/platform/graphics/android/GLWebViewState.cpp b/WebCore/platform/graphics/android/GLWebViewState.cpp
index 3b66b04..e873d4c 100644
--- a/WebCore/platform/graphics/android/GLWebViewState.cpp
+++ b/WebCore/platform/graphics/android/GLWebViewState.cpp
@@ -118,10 +118,8 @@ void GLWebViewState::setBaseLayer(BaseLayerAndroid* layer, const IntRect& rect)
m_currentBaseLayer->safeUnref();
m_currentBaseLayer = layer;
m_currentBaseLayer->safeRef();
- inval(rect);
- } else {
- m_invalidateRect.unite(rect);
}
+ inval(rect);
}
void GLWebViewState::unlockBaseLayerUpdate() {
@@ -141,7 +139,12 @@ void GLWebViewState::setExtra(BaseLayerAndroid* layer, SkPicture& picture,
android::Mutex::Autolock lock(m_baseLayerLock);
if (!m_baseLayerUpdate)
return;
+
layer->setExtra(picture);
+
+ if (m_lastInval == rect)
+ return;
+
if (!rect.isEmpty())
inval(rect);
else if (!m_lastInval.isEmpty())
@@ -151,11 +154,15 @@ void GLWebViewState::setExtra(BaseLayerAndroid* layer, SkPicture& picture,
void GLWebViewState::inval(const IntRect& rect)
{
- m_currentPictureCounter++;
- if (!rect.isEmpty()) {
- // find which tiles fall within the invalRect and mark them as dirty
- m_tiledPageA->invalidateRect(rect, m_currentPictureCounter);
- m_tiledPageB->invalidateRect(rect, m_currentPictureCounter);
+ if (m_baseLayerUpdate) {
+ m_currentPictureCounter++;
+ if (!rect.isEmpty()) {
+ // find which tiles fall within the invalRect and mark them as dirty
+ m_tiledPageA->invalidateRect(rect, m_currentPictureCounter);
+ m_tiledPageB->invalidateRect(rect, m_currentPictureCounter);
+ }
+ } else {
+ m_invalidateRect.unite(rect);
}
}
diff --git a/WebCore/platform/graphics/android/GLWebViewState.h b/WebCore/platform/graphics/android/GLWebViewState.h
index 81dcb9e..1ef35d3 100644
--- a/WebCore/platform/graphics/android/GLWebViewState.h
+++ b/WebCore/platform/graphics/android/GLWebViewState.h
@@ -242,7 +242,7 @@ private:
bool m_usePageA;
TiledPage* m_tiledPageA;
TiledPage* m_tiledPageB;
- SkIRect m_lastInval;
+ IntRect m_lastInval;
android::Mutex* m_globalButtonMutex;
bool m_baseLayerUpdate;