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

Unified Diff: Source/web/tests/sim/SimCompositor.h

Issue 1329553004: Add a FOUC painting test. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Clean up. 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
Index: Source/web/tests/sim/SimCompositor.h
diff --git a/Source/web/tests/sim/SimCompositor.h b/Source/web/tests/sim/SimCompositor.h
new file mode 100644
index 0000000000000000000000000000000000000000..0c8b20a179371f376f37650cbf126ca0ccd612e4
--- /dev/null
+++ b/Source/web/tests/sim/SimCompositor.h
@@ -0,0 +1,50 @@
+// Copyright 2015 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 SimCompositor_h
+#define SimCompositor_h
+
+namespace blink {
+
+class SimLayerTreeView;
+class WebViewImpl;
+
+// Simulated very basic compositor that's capable of running the BeginMainFrame
+// processing steps on WebView: beginFrame, layout, paint.
+//
+// The painting capabilities are very limited in that only the main layer of
+// every CompositedDeprecatedPaintLayerMapping will be painted, squashed layers
+// are not supported and the entirety of every layer is always repainted even if
+// only part of the layer was invalid.
+//
+// Note: This also does not support compositor driven animations.
+class SimCompositor final {
+public:
+ explicit SimCompositor(SimLayerTreeView&);
+ ~SimCompositor();
+
+ void setWebViewImpl(WebViewImpl&);
+
+ struct BeginFrameResult {
+ // If any text was drawn in any layer by the painting phase.
+ bool didDrawText = false;
+
+ // Approximate number of draw commands issued by the painting phase of
+ // beginFrame.
+ int drawCount = 0;
+ };
+
+ // Execute the BeginMainFrame processing steps, an approximation of what
+ // cc::ThreadProxy::BeginMainFrame would do.
+ BeginFrameResult beginFrame();
+
+private:
+ SimLayerTreeView* m_layerTreeView;
+ WebViewImpl* m_webViewImpl;
+ double m_lastFrameTimeMonotonic;
+};
+
+} // namespace blink
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698