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

Side by Side Diff: cc/layers/texture_layer_unittest.cc

Issue 2340143002: cc: Rename LayerTreeHost to LayerTreeHostInProcess. (Closed)
Patch Set: comment fix Created 4 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 unified diff | Download patch
« no previous file with comments | « cc/layers/scrollbar_layer_unittest.cc ('k') | cc/test/fake_layer_tree_host.h » ('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 #include "cc/layers/texture_layer.h" 5 #include "cc/layers/texture_layer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 20 matching lines...) Expand all
31 #include "cc/test/fake_impl_task_runner_provider.h" 31 #include "cc/test/fake_impl_task_runner_provider.h"
32 #include "cc/test/fake_layer_tree_host_client.h" 32 #include "cc/test/fake_layer_tree_host_client.h"
33 #include "cc/test/fake_layer_tree_host_impl.h" 33 #include "cc/test/fake_layer_tree_host_impl.h"
34 #include "cc/test/layer_test_common.h" 34 #include "cc/test/layer_test_common.h"
35 #include "cc/test/layer_tree_test.h" 35 #include "cc/test/layer_tree_test.h"
36 #include "cc/test/stub_layer_tree_host_single_thread_client.h" 36 #include "cc/test/stub_layer_tree_host_single_thread_client.h"
37 #include "cc/test/test_compositor_frame_sink.h" 37 #include "cc/test/test_compositor_frame_sink.h"
38 #include "cc/test/test_task_graph_runner.h" 38 #include "cc/test/test_task_graph_runner.h"
39 #include "cc/test/test_web_graphics_context_3d.h" 39 #include "cc/test/test_web_graphics_context_3d.h"
40 #include "cc/trees/blocking_task_runner.h" 40 #include "cc/trees/blocking_task_runner.h"
41 #include "cc/trees/layer_tree_host.h" 41 #include "cc/trees/layer_tree_host_in_process.h"
42 #include "cc/trees/layer_tree_impl.h" 42 #include "cc/trees/layer_tree_impl.h"
43 #include "cc/trees/single_thread_proxy.h" 43 #include "cc/trees/single_thread_proxy.h"
44 #include "gpu/GLES2/gl2extchromium.h" 44 #include "gpu/GLES2/gl2extchromium.h"
45 #include "testing/gmock/include/gmock/gmock.h" 45 #include "testing/gmock/include/gmock/gmock.h"
46 #include "testing/gtest/include/gtest/gtest.h" 46 #include "testing/gtest/include/gtest/gtest.h"
47 47
48 using ::testing::Mock; 48 using ::testing::Mock;
49 using ::testing::_; 49 using ::testing::_;
50 using ::testing::AtLeast; 50 using ::testing::AtLeast;
51 using ::testing::AnyNumber; 51 using ::testing::AnyNumber;
52 using ::testing::InvokeWithoutArgs; 52 using ::testing::InvokeWithoutArgs;
53 53
54 namespace cc { 54 namespace cc {
55 namespace { 55 namespace {
56 56
57 gpu::Mailbox MailboxFromChar(char value) { 57 gpu::Mailbox MailboxFromChar(char value) {
58 gpu::Mailbox mailbox; 58 gpu::Mailbox mailbox;
59 memset(mailbox.name, value, sizeof(mailbox.name)); 59 memset(mailbox.name, value, sizeof(mailbox.name));
60 return mailbox; 60 return mailbox;
61 } 61 }
62 62
63 gpu::SyncToken SyncTokenFromUInt(uint32_t value) { 63 gpu::SyncToken SyncTokenFromUInt(uint32_t value) {
64 return gpu::SyncToken(gpu::CommandBufferNamespace::GPU_IO, 0, 64 return gpu::SyncToken(gpu::CommandBufferNamespace::GPU_IO, 0,
65 gpu::CommandBufferId::FromUnsafeValue(0x123), value); 65 gpu::CommandBufferId::FromUnsafeValue(0x123), value);
66 } 66 }
67 67
68 class MockLayerTreeHost : public LayerTreeHost { 68 class MockLayerTreeHost : public LayerTreeHostInProcess {
69 public: 69 public:
70 static std::unique_ptr<MockLayerTreeHost> Create( 70 static std::unique_ptr<MockLayerTreeHost> Create(
71 FakeLayerTreeHostClient* client, 71 FakeLayerTreeHostClient* client,
72 TaskGraphRunner* task_graph_runner) { 72 TaskGraphRunner* task_graph_runner) {
73 LayerTreeHost::InitParams params; 73 LayerTreeHostInProcess::InitParams params;
74 params.client = client; 74 params.client = client;
75 params.task_graph_runner = task_graph_runner; 75 params.task_graph_runner = task_graph_runner;
76 params.animation_host = 76 params.animation_host =
77 AnimationHost::CreateForTesting(ThreadInstance::MAIN); 77 AnimationHost::CreateForTesting(ThreadInstance::MAIN);
78 LayerTreeSettings settings; 78 LayerTreeSettings settings;
79 settings.verify_transform_tree_calculations = true; 79 settings.verify_transform_tree_calculations = true;
80 settings.verify_clip_tree_calculations = true; 80 settings.verify_clip_tree_calculations = true;
81 params.settings = &settings; 81 params.settings = &settings;
82 return base::WrapUnique(new MockLayerTreeHost(&params)); 82 return base::WrapUnique(new MockLayerTreeHost(&params));
83 } 83 }
84 84
85 MOCK_METHOD0(SetNeedsCommit, void()); 85 MOCK_METHOD0(SetNeedsCommit, void());
86 MOCK_METHOD0(SetNeedsUpdateLayers, void()); 86 MOCK_METHOD0(SetNeedsUpdateLayers, void());
87 MOCK_METHOD0(StartRateLimiter, void()); 87 MOCK_METHOD0(StartRateLimiter, void());
88 MOCK_METHOD0(StopRateLimiter, void()); 88 MOCK_METHOD0(StopRateLimiter, void());
89 89
90 private: 90 private:
91 explicit MockLayerTreeHost(LayerTreeHost::InitParams* params) 91 explicit MockLayerTreeHost(LayerTreeHostInProcess::InitParams* params)
92 : LayerTreeHost(params, CompositorMode::SINGLE_THREADED) { 92 : LayerTreeHostInProcess(params, CompositorMode::SINGLE_THREADED) {
93 InitializeSingleThreaded(&single_thread_client_, 93 InitializeSingleThreaded(&single_thread_client_,
94 base::ThreadTaskRunnerHandle::Get(), nullptr); 94 base::ThreadTaskRunnerHandle::Get(), nullptr);
95 } 95 }
96 96
97 StubLayerTreeHostSingleThreadClient single_thread_client_; 97 StubLayerTreeHostSingleThreadClient single_thread_client_;
98 }; 98 };
99 99
100 class FakeTextureLayerClient : public TextureLayerClient { 100 class FakeTextureLayerClient : public TextureLayerClient {
101 public: 101 public:
102 FakeTextureLayerClient() : mailbox_changed_(true) {} 102 FakeTextureLayerClient() : mailbox_changed_(true) {}
(...skipping 1350 matching lines...) Expand 10 before | Expand all | Expand 10 after
1453 base::ThreadChecker main_thread_; 1453 base::ThreadChecker main_thread_;
1454 int callback_count_; 1454 int callback_count_;
1455 scoped_refptr<Layer> root_; 1455 scoped_refptr<Layer> root_;
1456 scoped_refptr<TextureLayer> layer_; 1456 scoped_refptr<TextureLayer> layer_;
1457 }; 1457 };
1458 1458
1459 SINGLE_AND_MULTI_THREAD_TEST_F(TextureLayerWithMailboxImplThreadDeleted); 1459 SINGLE_AND_MULTI_THREAD_TEST_F(TextureLayerWithMailboxImplThreadDeleted);
1460 1460
1461 } // namespace 1461 } // namespace
1462 } // namespace cc 1462 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/scrollbar_layer_unittest.cc ('k') | cc/test/fake_layer_tree_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698