OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 layer->SetHideLayerAndSubtree(false); | 193 layer->SetHideLayerAndSubtree(false); |
194 layer->SetIsDrawable(false); | 194 layer->SetIsDrawable(false); |
195 } | 195 } |
196 | 196 |
197 void VerifyAfterValues(LayerImpl* layer) { | 197 void VerifyAfterValues(LayerImpl* layer) { |
198 switch (static_cast<Properties>(index_)) { | 198 switch (static_cast<Properties>(index_)) { |
199 case STARTUP: | 199 case STARTUP: |
200 case DONE: | 200 case DONE: |
201 break; | 201 break; |
202 case BOUNDS: | 202 case BOUNDS: |
203 EXPECT_EQ(gfx::Size(20, 20).ToString(), layer->bounds().ToString()); | 203 EXPECT_EQ(gfx::SizeF(20, 20).ToString(), layer->bounds().ToString()); |
204 break; | 204 break; |
205 case HIDE_LAYER_AND_SUBTREE: | 205 case HIDE_LAYER_AND_SUBTREE: |
206 EXPECT_TRUE(layer->hide_layer_and_subtree()); | 206 EXPECT_TRUE(layer->hide_layer_and_subtree()); |
207 break; | 207 break; |
208 case DRAWS_CONTENT: | 208 case DRAWS_CONTENT: |
209 EXPECT_TRUE(layer->DrawsContent()); | 209 EXPECT_TRUE(layer->DrawsContent()); |
210 break; | 210 break; |
211 } | 211 } |
212 } | 212 } |
213 | 213 |
(...skipping 2202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2416 LayerTreeHostTest::SetupTree(); | 2416 LayerTreeHostTest::SetupTree(); |
2417 } | 2417 } |
2418 | 2418 |
2419 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } | 2419 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } |
2420 virtual void AfterTest() OVERRIDE {} | 2420 virtual void AfterTest() OVERRIDE {} |
2421 | 2421 |
2422 virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { | 2422 virtual void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) OVERRIDE { |
2423 num_commits_++; | 2423 num_commits_++; |
2424 if (num_commits_ == 1) { | 2424 if (num_commits_ == 1) { |
2425 LayerImpl* root_layer = host_impl->active_tree()->root_layer(); | 2425 LayerImpl* root_layer = host_impl->active_tree()->root_layer(); |
2426 EXPECT_SIZE_EQ(gfx::Size(1, 1), root_layer->bounds()); | 2426 EXPECT_SIZE_EQ(gfx::SizeF(1, 1), root_layer->bounds()); |
2427 } else { | 2427 } else { |
2428 LayerImpl* root_layer = host_impl->active_tree()->root_layer(); | 2428 LayerImpl* root_layer = host_impl->active_tree()->root_layer(); |
2429 EXPECT_SIZE_EQ(gfx::Size(2, 2), root_layer->bounds()); | 2429 EXPECT_SIZE_EQ(gfx::SizeF(2, 2), root_layer->bounds()); |
2430 EndTest(); | 2430 EndTest(); |
2431 } | 2431 } |
2432 } | 2432 } |
2433 | 2433 |
2434 private: | 2434 private: |
2435 SetBoundsClient client_; | 2435 SetBoundsClient client_; |
2436 int num_commits_; | 2436 int num_commits_; |
2437 }; | 2437 }; |
2438 | 2438 |
2439 SINGLE_THREAD_TEST_F(LayerTreeHostTestChangeLayerPropertiesInPaintContents); | 2439 SINGLE_THREAD_TEST_F(LayerTreeHostTestChangeLayerPropertiesInPaintContents); |
(...skipping 1623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4063 } | 4063 } |
4064 } | 4064 } |
4065 | 4065 |
4066 virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE { | 4066 virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE { |
4067 LayerImpl* root = impl->active_tree()->root_layer(); | 4067 LayerImpl* root = impl->active_tree()->root_layer(); |
4068 LayerImpl* parent = root->children()[0]; | 4068 LayerImpl* parent = root->children()[0]; |
4069 LayerImpl* child = parent->children()[0]; | 4069 LayerImpl* child = parent->children()[0]; |
4070 | 4070 |
4071 switch (impl->active_tree()->source_frame_number()) { | 4071 switch (impl->active_tree()->source_frame_number()) { |
4072 case 1: | 4072 case 1: |
4073 EXPECT_EQ(gfx::Size(5, 5).ToString(), child->bounds().ToString()); | 4073 EXPECT_EQ(gfx::SizeF(5, 5).ToString(), child->bounds().ToString()); |
4074 break; | 4074 break; |
4075 } | 4075 } |
4076 } | 4076 } |
4077 | 4077 |
4078 virtual void AfterTest() OVERRIDE {} | 4078 virtual void AfterTest() OVERRIDE {} |
4079 | 4079 |
4080 scoped_refptr<Layer> root_layer_; | 4080 scoped_refptr<Layer> root_layer_; |
4081 scoped_refptr<SolidColorLayer> parent_layer_; | 4081 scoped_refptr<SolidColorLayer> parent_layer_; |
4082 scoped_refptr<SolidColorLayer> child_layer_; | 4082 scoped_refptr<SolidColorLayer> child_layer_; |
4083 }; | 4083 }; |
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5073 bool visible_; | 5073 bool visible_; |
5074 | 5074 |
5075 FakeContentLayerClient client_; | 5075 FakeContentLayerClient client_; |
5076 scoped_refptr<FakePictureLayer> picture_layer_; | 5076 scoped_refptr<FakePictureLayer> picture_layer_; |
5077 }; | 5077 }; |
5078 | 5078 |
5079 // TODO(vmpstr): Enable with single thread impl-side painting. | 5079 // TODO(vmpstr): Enable with single thread impl-side painting. |
5080 MULTI_THREAD_TEST_F(LayerTreeHostTestActivateOnInvisible); | 5080 MULTI_THREAD_TEST_F(LayerTreeHostTestActivateOnInvisible); |
5081 | 5081 |
5082 } // namespace cc | 5082 } // namespace cc |
OLD | NEW |