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

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

Issue 1419283002: cc: Split Proxy and TaskRunnerProvider for the LayerTreeHost (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 5 years, 1 month 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/debug/micro_benchmark_controller_unittest.cc ('k') | cc/layers/layer.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/delegated_renderer_layer.h" 5 #include "cc/layers/delegated_renderer_layer.h"
6 6
7 #include "cc/layers/delegated_frame_provider.h" 7 #include "cc/layers/delegated_frame_provider.h"
8 #include "cc/layers/delegated_frame_resource_collection.h" 8 #include "cc/layers/delegated_frame_resource_collection.h"
9 #include "cc/layers/solid_color_layer.h" 9 #include "cc/layers/solid_color_layer.h"
10 #include "cc/output/delegated_frame_data.h" 10 #include "cc/output/delegated_frame_data.h"
11 #include "cc/test/fake_delegated_renderer_layer.h" 11 #include "cc/test/fake_delegated_renderer_layer.h"
12 #include "cc/test/fake_layer_tree_host.h" 12 #include "cc/test/fake_layer_tree_host.h"
13 #include "cc/test/fake_proxy.h" 13 #include "cc/test/fake_proxy.h"
14 #include "cc/test/test_task_graph_runner.h" 14 #include "cc/test/test_task_graph_runner.h"
15 #include "testing/gtest/include/gtest/gtest.h" 15 #include "testing/gtest/include/gtest/gtest.h"
16 16
17 namespace cc { 17 namespace cc {
18 namespace { 18 namespace {
19 19
20 class DelegatedRendererLayerTest : public testing::Test { 20 class DelegatedRendererLayerTest : public testing::Test {
21 public: 21 public:
22 DelegatedRendererLayerTest() 22 DelegatedRendererLayerTest()
23 : proxy_(), host_client_(FakeLayerTreeHostClient::DIRECT_3D) { 23 : host_client_(FakeLayerTreeHostClient::DIRECT_3D) {
24 LayerTreeSettings settings; 24 LayerTreeSettings settings;
25 settings.minimum_occlusion_tracking_size = gfx::Size(); 25 settings.minimum_occlusion_tracking_size = gfx::Size();
26 26
27 host_impl_ = 27 host_impl_ =
28 FakeLayerTreeHost::Create(&host_client_, &task_graph_runner_, settings); 28 FakeLayerTreeHost::Create(&host_client_, &task_graph_runner_, settings);
29 host_impl_->SetViewportSize(gfx::Size(10, 10)); 29 host_impl_->SetViewportSize(gfx::Size(10, 10));
30 } 30 }
31 31
32 protected: 32 protected:
33 FakeProxy proxy_;
34 FakeLayerTreeHostClient host_client_; 33 FakeLayerTreeHostClient host_client_;
35 TestTaskGraphRunner task_graph_runner_; 34 TestTaskGraphRunner task_graph_runner_;
36 TestSharedBitmapManager shared_bitmap_manager_; 35 TestSharedBitmapManager shared_bitmap_manager_;
37 scoped_ptr<LayerTreeHost> host_impl_; 36 scoped_ptr<LayerTreeHost> host_impl_;
38 }; 37 };
39 38
40 class DelegatedRendererLayerTestSimple : public DelegatedRendererLayerTest { 39 class DelegatedRendererLayerTestSimple : public DelegatedRendererLayerTest {
41 public: 40 public:
42 DelegatedRendererLayerTestSimple() : DelegatedRendererLayerTest() { 41 DelegatedRendererLayerTestSimple() : DelegatedRendererLayerTest() {
43 scoped_ptr<RenderPass> root_pass(RenderPass::Create()); 42 scoped_ptr<RenderPass> root_pass(RenderPass::Create());
(...skipping 30 matching lines...) Expand all
74 EXPECT_EQ(0, delegated_renderer_layer_->NumDescendantsThatDrawContent()); 73 EXPECT_EQ(0, delegated_renderer_layer_->NumDescendantsThatDrawContent());
75 EXPECT_EQ(1, root_layer_->NumDescendantsThatDrawContent()); 74 EXPECT_EQ(1, root_layer_->NumDescendantsThatDrawContent());
76 delegated_renderer_layer_->SetIsDrawable(true); 75 delegated_renderer_layer_->SetIsDrawable(true);
77 EXPECT_EQ(1000, delegated_renderer_layer_->NumDescendantsThatDrawContent()); 76 EXPECT_EQ(1000, delegated_renderer_layer_->NumDescendantsThatDrawContent());
78 EXPECT_EQ(1001, layer_before_->NumDescendantsThatDrawContent()); 77 EXPECT_EQ(1001, layer_before_->NumDescendantsThatDrawContent());
79 EXPECT_EQ(1002, root_layer_->NumDescendantsThatDrawContent()); 78 EXPECT_EQ(1002, root_layer_->NumDescendantsThatDrawContent());
80 } 79 }
81 80
82 } // namespace 81 } // namespace
83 } // namespace cc 82 } // namespace cc
OLDNEW
« no previous file with comments | « cc/debug/micro_benchmark_controller_unittest.cc ('k') | cc/layers/layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698