summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2012-04-11 11:39:55 -0700
committerChris Craik <ccraik@google.com>2012-04-12 09:54:16 -0700
commit5f0350c3ee327062ec6e22a3935c3bd4534cd15d (patch)
treeccb442755c849654d2692e2eda359e8a060d722e /Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp
parent5d119b85382480f33eefb397ef6b34a4331671b9 (diff)
downloadexternal_webkit-5f0350c3ee327062ec6e22a3935c3bd4534cd15d.zip
external_webkit-5f0350c3ee327062ec6e22a3935c3bd4534cd15d.tar.gz
external_webkit-5f0350c3ee327062ec6e22a3935c3bd4534cd15d.tar.bz2
Skip drawing the background (glClear) if the tiles cover it.
bug:5631590 Change-Id: Ic7dc0dac0d7f98fb94eb2b111b3e59a0a7010caf
Diffstat (limited to 'Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp')
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp
index 91335c7..8c9cad5 100644
--- a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp
+++ b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollectionManager.cpp
@@ -224,6 +224,7 @@ int SurfaceCollectionManager::drawGL(double currentTime, IntRect& viewRect,
// ===========================================================================
// Don't have a drawing collection, draw white background
Color background = Color::white;
+ bool drawBackground = true;
if (m_drawingCollection) {
bool drawingReady = didCollectionSwap || m_drawingCollection->isReady();
@@ -245,17 +246,21 @@ int SurfaceCollectionManager::drawGL(double currentTime, IntRect& viewRect,
m_drawingCollection->evaluateAnimations(currentTime);
ALOGV("drawing collection %p", m_drawingCollection);
- background = m_drawingCollection->getBackground();
+ background = m_drawingCollection->getBackgroundColor();
+ drawBackground = m_drawingCollection->isMissingBackgroundContent();
} else if (m_paintingCollection) {
// Use paintingCollection background color while tiles are not done painting.
- background = m_paintingCollection->getBackground();
+ background = m_paintingCollection->getBackgroundColor();
}
// Start doing the actual GL drawing.
- ALOGV("background is %x", background.rgb());
- // If background is opaque, we can safely and efficiently clear it here.
- // Otherwise, we have to calculate all the missing tiles and blend the background.
- GLUtils::clearBackgroundIfOpaque(&background);
+ if (drawBackground) {
+ ALOGV("background is %x", background.rgb());
+ // If background is opaque, we can safely and efficiently clear it here.
+ // Otherwise, we have to calculate all the missing tiles and blend the background.
+ GLUtils::clearBackgroundIfOpaque(&background);
+ }
+
if (m_drawingCollection && m_drawingCollection->drawGL(visibleRect))
returnFlags |= uirenderer::DrawGlInfo::kStatusDraw;