Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / Source / web / tests / sim / SimCompositor.h
blob53975e3be79c44bfcc8f788946398fcb4dd57f42
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef SimCompositor_h
6 #define SimCompositor_h
8 namespace blink {
10 class SimDisplayItemList;
11 class SimLayerTreeView;
12 class WebViewImpl;
14 // Simulated very basic compositor that's capable of running the BeginMainFrame
15 // processing steps on WebView: beginFrame, layout, paint.
17 // The painting capabilities are very limited in that only the main layer of
18 // every CompositedDeprecatedPaintLayerMapping will be painted, squashed layers
19 // are not supported and the entirety of every layer is always repainted even if
20 // only part of the layer was invalid.
22 // Note: This also does not support compositor driven animations.
23 class SimCompositor final {
24 public:
25 explicit SimCompositor(SimLayerTreeView&);
26 ~SimCompositor();
28 void setWebViewImpl(WebViewImpl&);
30 // Execute the BeginMainFrame processing steps, an approximation of what
31 // cc::ThreadProxy::BeginMainFrame would do.
32 SimDisplayItemList beginFrame();
34 private:
35 SimLayerTreeView* m_layerTreeView;
36 WebViewImpl* m_webViewImpl;
37 double m_lastFrameTimeMonotonic;
40 } // namespace blink
42 #endif