| 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())
|
|
|