| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CC_TEST_FAKE_LAYER_TREE_HOST_CLIENT_H_ | 5 #ifndef CC_TEST_FAKE_LAYER_TREE_HOST_CLIENT_H_ |
| 6 #define CC_TEST_FAKE_LAYER_TREE_HOST_CLIENT_H_ | 6 #define CC_TEST_FAKE_LAYER_TREE_HOST_CLIENT_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "cc/input/input_handler.h" | 10 #include "cc/input/input_handler.h" |
| 11 #include "cc/test/test_context_provider.h" | 11 #include "cc/test/test_context_provider.h" |
| 12 #include "cc/trees/layer_tree_host_client.h" | 12 #include "cc/trees/layer_tree_host_client.h" |
| 13 #include "cc/trees/layer_tree_host_single_thread_client.h" | 13 #include "cc/trees/layer_tree_host_single_thread_client.h" |
| 14 | 14 |
| 15 namespace cc { | 15 namespace cc { |
| 16 class OutputSurface; | 16 class OutputSurface; |
| 17 | 17 |
| 18 class FakeLayerTreeHostClient : public LayerTreeHostClient, | 18 class FakeLayerTreeHostClient : public LayerTreeHostClient, |
| 19 public LayerTreeHostSingleThreadClient { | 19 public LayerTreeHostSingleThreadClient { |
| 20 public: | 20 public: |
| 21 enum RendererOptions { | 21 FakeLayerTreeHostClient(); |
| 22 DIRECT_3D, | |
| 23 DIRECT_SOFTWARE, | |
| 24 DELEGATED_3D, | |
| 25 DELEGATED_SOFTWARE | |
| 26 }; | |
| 27 explicit FakeLayerTreeHostClient(RendererOptions options); | |
| 28 ~FakeLayerTreeHostClient() override; | 22 ~FakeLayerTreeHostClient() override; |
| 29 | 23 |
| 30 // Caller responsible for unsetting this and maintaining the host's lifetime. | 24 // Caller responsible for unsetting this and maintaining the host's lifetime. |
| 31 void SetLayerTreeHost(LayerTreeHost* host) { host_ = host; } | 25 void SetLayerTreeHost(LayerTreeHost* host) { host_ = host; } |
| 32 | 26 |
| 33 // LayerTreeHostClient implementation. | 27 // LayerTreeHostClient implementation. |
| 34 void WillBeginMainFrame() override {} | 28 void WillBeginMainFrame() override {} |
| 35 void DidBeginMainFrame() override {} | 29 void DidBeginMainFrame() override {} |
| 36 void BeginMainFrame(const BeginFrameArgs& args) override {} | 30 void BeginMainFrame(const BeginFrameArgs& args) override {} |
| 37 void BeginMainFrameNotExpectedSoon() override {} | 31 void BeginMainFrameNotExpectedSoon() override {} |
| (...skipping 10 matching lines...) Expand all Loading... |
| 48 void DidCommit() override {} | 42 void DidCommit() override {} |
| 49 void DidCommitAndDrawFrame() override {} | 43 void DidCommitAndDrawFrame() override {} |
| 50 void DidCompleteSwapBuffers() override {} | 44 void DidCompleteSwapBuffers() override {} |
| 51 void DidCompletePageScaleAnimation() override {} | 45 void DidCompletePageScaleAnimation() override {} |
| 52 | 46 |
| 53 // LayerTreeHostSingleThreadClient implementation. | 47 // LayerTreeHostSingleThreadClient implementation. |
| 54 void DidPostSwapBuffers() override {} | 48 void DidPostSwapBuffers() override {} |
| 55 void DidAbortSwapBuffers() override {} | 49 void DidAbortSwapBuffers() override {} |
| 56 | 50 |
| 57 private: | 51 private: |
| 58 bool use_software_rendering_; | 52 LayerTreeHost* host_ = nullptr; |
| 59 bool use_delegating_renderer_; | |
| 60 | |
| 61 LayerTreeHost* host_; | |
| 62 }; | 53 }; |
| 63 | 54 |
| 64 } // namespace cc | 55 } // namespace cc |
| 65 | 56 |
| 66 #endif // CC_TEST_FAKE_LAYER_TREE_HOST_CLIENT_H_ | 57 #endif // CC_TEST_FAKE_LAYER_TREE_HOST_CLIENT_H_ |
| OLD | NEW |