| OLD | NEW |
| (Empty) |
| 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. | |
| 4 | |
| 5 #ifndef SimCompositor_h | |
| 6 #define SimCompositor_h | |
| 7 | |
| 8 namespace blink { | |
| 9 | |
| 10 class SimLayerTreeView; | |
| 11 class WebViewImpl; | |
| 12 | |
| 13 // Simulated very basic compositor that's capable of running the BeginMainFrame | |
| 14 // processing steps on WebView: beginFrame, layout, paint. | |
| 15 // | |
| 16 // The painting capabilities are very limited in that only the main layer of | |
| 17 // every CompositedDeprecatedPaintLayerMapping will be painted, squashed layers | |
| 18 // are not supported and the entirety of every layer is always repainted even if | |
| 19 // only part of the layer was invalid. | |
| 20 // | |
| 21 // Note: This also does not support compositor driven animations. | |
| 22 class SimCompositor final { | |
| 23 public: | |
| 24 explicit SimCompositor(SimLayerTreeView&); | |
| 25 ~SimCompositor(); | |
| 26 | |
| 27 void setWebViewImpl(WebViewImpl&); | |
| 28 | |
| 29 struct BeginFrameResult { | |
| 30 // If any text was drawn in any layer by the painting phase. | |
| 31 bool didDrawText = false; | |
| 32 | |
| 33 // Approximate number of draw commands issued by the painting phase of | |
| 34 // beginFrame. | |
| 35 int drawCount = 0; | |
| 36 }; | |
| 37 | |
| 38 // Execute the BeginMainFrame processing steps, an approximation of what | |
| 39 // cc::ThreadProxy::BeginMainFrame would do. | |
| 40 BeginFrameResult beginFrame(); | |
| 41 | |
| 42 private: | |
| 43 SimLayerTreeView* m_layerTreeView; | |
| 44 WebViewImpl* m_webViewImpl; | |
| 45 double m_lastFrameTimeMonotonic; | |
| 46 }; | |
| 47 | |
| 48 } // namespace blink | |
| 49 | |
| 50 #endif | |
| OLD | NEW |