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

Side by Side Diff: cc/test/fake_layer_tree_host_client.h

Issue 2171143002: cc: Get rid of non-delegated rendering in most cc unit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@killdirecttests
Patch Set: fakeoutputsurface: no-constructor 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 unified diff | Download patch
« no previous file with comments | « cc/resources/scoped_resource_unittest.cc ('k') | cc/test/fake_layer_tree_host_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « cc/resources/scoped_resource_unittest.cc ('k') | cc/test/fake_layer_tree_host_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698