Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1249)

Unified Diff: Source/platform/graphics/GraphicsLayer.cpp

Issue 1329553004: Add a FOUC painting test. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix build. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/graphics/GraphicsLayer.h ('k') | Source/web/tests/DocumentLoadingRenderingTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/GraphicsLayer.cpp
diff --git a/Source/platform/graphics/GraphicsLayer.cpp b/Source/platform/graphics/GraphicsLayer.cpp
index 6c27628d2cea91ee20f22808ca0b84abb2ca9c98..11c803a0b782ff2660afef2c6affac8d0595f001 100644
--- a/Source/platform/graphics/GraphicsLayer.cpp
+++ b/Source/platform/graphics/GraphicsLayer.cpp
@@ -64,6 +64,8 @@
namespace blink {
+static bool s_drawDebugRedFill = true;
+
// TODO(wangxianzhu): Remove this when we no longer invalidate rects.
struct PaintInvalidationTrackingInfo {
Vector<FloatRect> invalidationRects;
@@ -149,6 +151,11 @@ GraphicsLayer::~GraphicsLayer()
ASSERT(!m_parent);
}
+void GraphicsLayer::setDrawDebugRedFillForTesting(bool enabled)
+{
+ s_drawDebugRedFill = enabled;
+}
+
void GraphicsLayer::setParent(GraphicsLayer* layer)
{
ASSERT(!layer || !layer->hasAncestor(this));
@@ -290,7 +297,7 @@ void GraphicsLayer::paintGraphicsLayerContents(GraphicsContext& context, const I
m_debugInfo.clearAnnotatedInvalidateRects();
incrementPaintCount();
#ifndef NDEBUG
- if (m_displayItemList && contentsOpaque()) {
+ if (m_displayItemList && contentsOpaque() && s_drawDebugRedFill) {
ASSERT(RuntimeEnabledFeatures::slimmingPaintEnabled());
FloatRect rect(FloatPoint(), size());
if (!DrawingRecorder::useCachedDrawingIfPossible(context, *this, DisplayItem::DebugRedFill)) {
@@ -460,6 +467,14 @@ void GraphicsLayer::resetTrackedPaintInvalidations()
paintInvalidationTrackingMap().remove(this);
}
+bool GraphicsLayer::hasTrackedPaintInvalidations() const
+{
+ PaintInvalidationTrackingMap::iterator it = paintInvalidationTrackingMap().find(this);
+ if (it != paintInvalidationTrackingMap().end())
+ return !it->value.invalidationRects.isEmpty();
+ return false;
+}
+
void GraphicsLayer::trackPaintInvalidationRect(const FloatRect& rect)
{
if (rect.isEmpty())
« no previous file with comments | « Source/platform/graphics/GraphicsLayer.h ('k') | Source/web/tests/DocumentLoadingRenderingTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698