Index: Source/platform/graphics/GraphicsLayer.cpp |
diff --git a/Source/platform/graphics/GraphicsLayer.cpp b/Source/platform/graphics/GraphicsLayer.cpp |
index 649ab82e2683b5da128a9af3a5715149d0b009f5..e4a03d1e65a95104a4ce46bb97dfe2e97c4085e8 100644 |
--- a/Source/platform/graphics/GraphicsLayer.cpp |
+++ b/Source/platform/graphics/GraphicsLayer.cpp |
@@ -1,5 +1,4 @@ |
-/* |
- * Copyright (C) 2009 Apple Inc. All rights reserved. |
+/* * Copyright (C) 2009 Apple Inc. All rights reserved. |
* |
* Redistribution and use in source and binary forms, with or without |
* modification, are permitted provided that the following conditions |
@@ -29,6 +28,7 @@ |
#include "SkImageFilter.h" |
#include "SkMatrix44.h" |
+#include "platform/TraceEvent.h" |
#include "platform/geometry/FloatRect.h" |
#include "platform/geometry/LayoutRect.h" |
#include "platform/graphics/GraphicsLayerFactory.h" |
@@ -66,6 +66,17 @@ using blink::WebPoint; |
namespace blink { |
+namespace { |
+ |
+bool firstPaintInvalidationTrackingEnabled() |
+{ |
+ bool isEnabled; |
+ TRACE_EVENT_CATEGORY_GROUP_ENABLED(TRACE_DISABLED_BY_DEFAULT("blink.invalidation"), &isEnabled); |
enne (OOO)
2014/09/04 18:39:33
How do you plan on having this handle show paint r
kouhei (in TOK)
2014/09/04 18:58:52
Devtools has access to the trace event category fl
enne (OOO)
2014/09/04 21:39:40
Flipping the flag = enabling that trace category?
|
+ return isEnabled; |
+} |
+ |
+} // namespace |
+ |
typedef HashMap<const GraphicsLayer*, Vector<FloatRect> > RepaintMap; |
static RepaintMap& repaintRectMap() |
{ |
@@ -273,6 +284,8 @@ void GraphicsLayer::paintGraphicsLayerContents(GraphicsContext& context, const I |
{ |
if (!m_client) |
return; |
+ if (firstPaintInvalidationTrackingEnabled()) |
+ m_debugInfo.clearAnnotatedInvalidateRects(); |
incrementPaintCount(); |
m_client->paintContents(this, context, m_paintingPhase, clip); |
} |
@@ -897,10 +910,12 @@ void GraphicsLayer::setNeedsDisplay() |
} |
} |
-void GraphicsLayer::setNeedsDisplayInRect(const FloatRect& rect) |
+void GraphicsLayer::setNeedsDisplayInRect(const FloatRect& rect, WebInvalidationDebugAnnotations annotations) |
{ |
if (drawsContent()) { |
m_layer->layer()->invalidateRect(rect); |
+ if (firstPaintInvalidationTrackingEnabled()) |
+ m_debugInfo.appendAnnotatedInvalidateRect(rect, annotations); |
addRepaintRect(rect); |
for (size_t i = 0; i < m_linkHighlights.size(); ++i) |
m_linkHighlights[i]->invalidate(); |