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

Unified Diff: third_party/WebKit/Source/core/paint/StubChromeClientForSPv2.h

Issue 2121933003: [SPv2] Paint accelerated canvases as foreign layers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add 'override' keyword to StubChromeClientForSPv2::didPaint Created 4 years, 5 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/core/paint/StubChromeClientForSPv2.h
diff --git a/third_party/WebKit/Source/core/paint/StubChromeClientForSPv2.h b/third_party/WebKit/Source/core/paint/StubChromeClientForSPv2.h
new file mode 100644
index 0000000000000000000000000000000000000000..9160b4d7b2572dc1e4b2c920f511e02bea566346
--- /dev/null
+++ b/third_party/WebKit/Source/core/paint/StubChromeClientForSPv2.h
@@ -0,0 +1,40 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef StubChromeClientForSPv2_h
+#define StubChromeClientForSPv2_h
+
+#include "core/loader/EmptyClients.h"
+#include "platform/graphics/compositing/PaintArtifactCompositor.h"
+#include "platform/testing/WebLayerTreeViewImplForTesting.h"
+
+namespace blink {
+
+// A simple ChromeClient implementation which forwards painted artifacts to a
+// PaintArtifactCompositor attached to a testing WebLayerTreeView, and permits
+// simple analysis of the results.
+class StubChromeClientForSPv2 : public EmptyChromeClient {
+public:
+ StubChromeClientForSPv2(WebLayerTreeViewImplForTesting::LayerListPolicy layerListPolicy)
+ : m_layerTreeView(layerListPolicy)
+ {
+ m_layerTreeView.setRootLayer(*m_paintArtifactCompositor.getWebLayer());
+ }
+
+ bool hasLayer(const WebLayer& layer) { return m_layerTreeView.hasLayer(layer); }
+
+ // ChromeClient
+ void didPaint(const PaintArtifact& artifact) override
+ {
+ m_paintArtifactCompositor.update(artifact);
+ }
+
+private:
+ WebLayerTreeViewImplForTesting m_layerTreeView;
+ PaintArtifactCompositor m_paintArtifactCompositor;
+};
+
+} // namespace blink
+
+#endif // StubChromeClientForSPv2_h

Powered by Google App Engine
This is Rietveld 408576698