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

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

Issue 2713673005: client-goodbye
Patch Set: Created 3 years, 10 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
Index: third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
index d49d6886364f464618900d7fae09e86ef7cf3251..b15b38a3a8f0bf2c9bd4135b514b7676f46c4714 100644
--- a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
@@ -25,6 +25,10 @@
#include "platform/graphics/GraphicsLayer.h"
+#include <algorithm>
+#include <cmath>
+#include <memory>
+#include <utility>
#include "SkImageFilter.h"
#include "SkMatrix44.h"
#include "base/trace_event/trace_event_argument.h"
@@ -38,6 +42,7 @@
#include "platform/graphics/FirstPaintInvalidationTracking.h"
#include "platform/graphics/GraphicsContext.h"
#include "platform/graphics/Image.h"
+#include "platform/graphics/InvalidationDebugging.h"
#include "platform/graphics/LinkHighlight.h"
#include "platform/graphics/paint/DrawingRecorder.h"
#include "platform/graphics/paint/PaintCanvas.h"
@@ -61,10 +66,6 @@
#include "wtf/PtrUtil.h"
#include "wtf/text/StringUTF8Adaptor.h"
#include "wtf/text/WTFString.h"
-#include <algorithm>
-#include <cmath>
-#include <memory>
-#include <utility>
#ifndef NDEBUG
#include <stdio.h>
@@ -516,7 +517,7 @@ const RasterInvalidationTracking* GraphicsLayer::getRasterInvalidationTracking()
return rasterInvalidationTrackingMap().find(this);
}
-void GraphicsLayer::trackRasterInvalidation(const DisplayItemClient& client,
+void GraphicsLayer::trackRasterInvalidation(const InvalidationDebugging& debug,
const IntRect& rect,
PaintInvalidationReason reason) {
if (!isTrackingOrCheckingRasterInvalidations() || rect.isEmpty())
@@ -527,8 +528,8 @@ void GraphicsLayer::trackRasterInvalidation(const DisplayItemClient& client,
if (m_isTrackingRasterInvalidations) {
RasterInvalidationInfo info;
- info.client = &client;
- info.clientDebugName = client.debugName();
+ info.source = &debug;
+ info.clientDebugName = debug.invalidationName();
info.rect = rect;
info.reason = reason;
tracking.trackedRasterInvalidations.push_back(info);
@@ -1022,10 +1023,26 @@ void GraphicsLayer::setIsRootForIsolatedGroup(bool isolated) {
platformLayer()->setIsRootForIsolatedGroup(isolated);
}
+class GraphicsLayerInvalidationDebugging : public InvalidationDebugging {
+ public:
+ explicit GraphicsLayerInvalidationDebugging(GraphicsLayerClient* c,
+ GraphicsLayer* g)
+ : m_client(c), m_layer(g) {}
+
+ WTF::String invalidationName() const final {
+ return m_client->debugName(m_layer);
+ }
+
+ private:
+ GraphicsLayerClient* m_client;
+ GraphicsLayer* m_layer;
+};
+
void GraphicsLayer::setContentsNeedsDisplay() {
if (WebLayer* contentsLayer = contentsLayerIfRegistered()) {
contentsLayer->invalidate();
- trackRasterInvalidation(*this, m_contentsRect, PaintInvalidationFull);
+ GraphicsLayerInvalidationDebugging debug(m_client, this);
+ trackRasterInvalidation(debug, m_contentsRect, PaintInvalidationFull);
}
}
@@ -1040,7 +1057,8 @@ void GraphicsLayer::setNeedsDisplay() {
m_linkHighlights[i]->invalidate();
getPaintController().invalidateAll();
- trackRasterInvalidation(*this, IntRect(IntPoint(), expandedIntSize(m_size)),
+ GraphicsLayerInvalidationDebugging debug(m_client, this);
+ trackRasterInvalidation(debug, IntRect(IntPoint(), expandedIntSize(m_size)),
PaintInvalidationFull);
}
@@ -1048,7 +1066,7 @@ DISABLE_CFI_PERF
void GraphicsLayer::setNeedsDisplayInRect(
const IntRect& rect,
PaintInvalidationReason invalidationReason,
- const DisplayItemClient& client) {
+ const InvalidationDebugging& debug) {
if (!drawsContent())
return;
@@ -1058,7 +1076,7 @@ void GraphicsLayer::setNeedsDisplayInRect(
for (size_t i = 0; i < m_linkHighlights.size(); ++i)
m_linkHighlights[i]->invalidate();
- trackRasterInvalidation(client, rect, invalidationReason);
+ trackRasterInvalidation(debug, rect, invalidationReason);
}
void GraphicsLayer::setContentsRect(const IntRect& rect) {

Powered by Google App Engine
This is Rietveld 408576698