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

Side by Side Diff: cc/layer_tree_host_unittest_delegated.cc

Issue 12774006: cc: Chromify Layer and LayerImpl classes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: MoreAndroidCompilings Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « cc/layer_tree_host_unittest_context.cc ('k') | cc/layer_tree_host_unittest_occlusion.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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/layer_tree_host.h" 5 #include "cc/layer_tree_host.h"
6 6
7 #include "cc/delegated_frame_data.h" 7 #include "cc/delegated_frame_data.h"
8 #include "cc/delegated_renderer_layer.h" 8 #include "cc/delegated_renderer_layer.h"
9 #include "cc/delegated_renderer_layer_impl.h" 9 #include "cc/delegated_renderer_layer_impl.h"
10 #include "cc/layer_tree_impl.h" 10 #include "cc/layer_tree_impl.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 scoped_ptr<DelegatedFrameData> CreateEmptyFrameData() { 62 scoped_ptr<DelegatedFrameData> CreateEmptyFrameData() {
63 scoped_ptr<DelegatedFrameData> frame(new DelegatedFrameData); 63 scoped_ptr<DelegatedFrameData> frame(new DelegatedFrameData);
64 return frame.Pass(); 64 return frame.Pass();
65 } 65 }
66 }; 66 };
67 67
68 class LayerTreeHostDelegatedTestCaseSingleDelegatedLayer 68 class LayerTreeHostDelegatedTestCaseSingleDelegatedLayer
69 : public LayerTreeHostDelegatedTest { 69 : public LayerTreeHostDelegatedTest {
70 public: 70 public:
71 virtual void setupTree() OVERRIDE { 71 virtual void setupTree() OVERRIDE {
72 root_ = Layer::create(); 72 root_ = Layer::Create();
73 root_->setAnchorPoint(gfx::PointF()); 73 root_->SetAnchorPoint(gfx::PointF());
74 root_->setBounds(gfx::Size(10, 10)); 74 root_->SetBounds(gfx::Size(10, 10));
75 75
76 delegated_ = FakeDelegatedRendererLayer::Create(); 76 delegated_ = FakeDelegatedRendererLayer::Create();
77 delegated_->setAnchorPoint(gfx::PointF()); 77 delegated_->SetAnchorPoint(gfx::PointF());
78 delegated_->setBounds(gfx::Size(10, 10)); 78 delegated_->SetBounds(gfx::Size(10, 10));
79 delegated_->setIsDrawable(true); 79 delegated_->SetIsDrawable(true);
80 80
81 root_->addChild(delegated_); 81 root_->AddChild(delegated_);
82 m_layerTreeHost->setRootLayer(root_); 82 m_layerTreeHost->setRootLayer(root_);
83 LayerTreeHostDelegatedTest::setupTree(); 83 LayerTreeHostDelegatedTest::setupTree();
84 } 84 }
85 85
86 virtual void beginTest() OVERRIDE { 86 virtual void beginTest() OVERRIDE {
87 postSetNeedsCommitToMainThread(); 87 postSetNeedsCommitToMainThread();
88 } 88 }
89 89
90 virtual void afterTest() OVERRIDE {} 90 virtual void afterTest() OVERRIDE {}
91 91
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 gfx::Rect(2, 2, 5, 5))); 180 gfx::Rect(2, 2, 5, 5)));
181 delegated_->SetFrameData(CreateFrameData(gfx::Rect(0, 0, 20, 20), 181 delegated_->SetFrameData(CreateFrameData(gfx::Rect(0, 0, 20, 20),
182 gfx::Rect(7, 2, 5, 6))); 182 gfx::Rect(7, 2, 5, 6)));
183 break; 183 break;
184 case 3: 184 case 3:
185 // Should create zero damage. 185 // Should create zero damage.
186 m_layerTreeHost->setNeedsCommit(); 186 m_layerTreeHost->setNeedsCommit();
187 break; 187 break;
188 case 4: 188 case 4:
189 // Should damage the full viewport. 189 // Should damage the full viewport.
190 delegated_->setBounds(gfx::Size(2, 2)); 190 delegated_->SetBounds(gfx::Size(2, 2));
191 break; 191 break;
192 case 5: 192 case 5:
193 // Should create zero damage. 193 // Should create zero damage.
194 m_layerTreeHost->setNeedsCommit(); 194 m_layerTreeHost->setNeedsCommit();
195 break; 195 break;
196 case 6: 196 case 6:
197 // Should damage the full layer. 197 // Should damage the full layer.
198 delegated_->setBounds(gfx::Size(6, 6)); 198 delegated_->SetBounds(gfx::Size(6, 6));
199 delegated_->SetFrameData(CreateFrameData(gfx::Rect(0, 0, 5, 5), 199 delegated_->SetFrameData(CreateFrameData(gfx::Rect(0, 0, 5, 5),
200 gfx::Rect(1, 1, 2, 2))); 200 gfx::Rect(1, 1, 2, 2)));
201 break; 201 break;
202 case 7: 202 case 7:
203 // Should create zero damage. 203 // Should create zero damage.
204 m_layerTreeHost->setNeedsCommit(); 204 m_layerTreeHost->setNeedsCommit();
205 break; 205 break;
206 case 8: 206 case 8:
207 // Should damage the full layer. 207 // Should damage the full layer.
208 delegated_->SetDisplaySize(gfx::Size(10, 10)); 208 delegated_->SetDisplaySize(gfx::Size(10, 10));
(...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after
1229 } 1229 }
1230 } 1230 }
1231 1231
1232 virtual void afterTest() OVERRIDE {} 1232 virtual void afterTest() OVERRIDE {}
1233 }; 1233 };
1234 1234
1235 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostDelegatedTestCommitWithoutTake) 1235 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostDelegatedTestCommitWithoutTake)
1236 1236
1237 } // namespace 1237 } // namespace
1238 } // namespace cc 1238 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layer_tree_host_unittest_context.cc ('k') | cc/layer_tree_host_unittest_occlusion.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698