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/synchronization/lock.h" | 9 #include "base/synchronization/lock.h" |
10 #include "cc/animation/timing_function.h" | 10 #include "cc/animation/timing_function.h" |
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 } | 414 } |
415 | 415 |
416 virtual void SetupTree() OVERRIDE { | 416 virtual void SetupTree() OVERRIDE { |
417 root_layer_ = Layer::Create(); | 417 root_layer_ = Layer::Create(); |
418 root_layer_->SetBounds(gfx::Size(10, 20)); | 418 root_layer_->SetBounds(gfx::Size(10, 20)); |
419 | 419 |
420 bool paint_scrollbar = true; | 420 bool paint_scrollbar = true; |
421 bool has_thumb = false; | 421 bool has_thumb = false; |
422 scrollbar_ = FakeScrollbarLayer::Create(paint_scrollbar, | 422 scrollbar_ = FakeScrollbarLayer::Create(paint_scrollbar, |
423 has_thumb, | 423 has_thumb, |
424 root_layer_->id()); | 424 root_layer_->id(), |
| 425 false); |
425 scrollbar_->SetPosition(gfx::Point(0, 10)); | 426 scrollbar_->SetPosition(gfx::Point(0, 10)); |
426 scrollbar_->SetBounds(gfx::Size(10, 10)); | 427 scrollbar_->SetBounds(gfx::Size(10, 10)); |
427 | 428 |
428 root_layer_->AddChild(scrollbar_); | 429 root_layer_->AddChild(scrollbar_); |
429 | 430 |
430 layer_tree_host()->SetRootLayer(root_layer_); | 431 layer_tree_host()->SetRootLayer(root_layer_); |
431 LayerTreeHostTest::SetupTree(); | 432 LayerTreeHostTest::SetupTree(); |
432 } | 433 } |
433 | 434 |
434 virtual void BeginTest() OVERRIDE { | 435 virtual void BeginTest() OVERRIDE { |
(...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1139 // Linear fade animator prevents scrollbars from drawing immediately. | 1140 // Linear fade animator prevents scrollbars from drawing immediately. |
1140 settings->use_linear_fade_scrollbar_animator = false; | 1141 settings->use_linear_fade_scrollbar_animator = false; |
1141 } | 1142 } |
1142 | 1143 |
1143 virtual void SetupTree() OVERRIDE { | 1144 virtual void SetupTree() OVERRIDE { |
1144 layer_ = FakeContentLayer::Create(&client_); | 1145 layer_ = FakeContentLayer::Create(&client_); |
1145 layer_->SetBounds(gfx::Size(10, 20)); | 1146 layer_->SetBounds(gfx::Size(10, 20)); |
1146 | 1147 |
1147 bool paint_scrollbar = true; | 1148 bool paint_scrollbar = true; |
1148 bool has_thumb = false; | 1149 bool has_thumb = false; |
1149 scrollbar_ = | 1150 scrollbar_ = FakeScrollbarLayer::Create( |
1150 FakeScrollbarLayer::Create(paint_scrollbar, has_thumb, layer_->id()); | 1151 paint_scrollbar, has_thumb, layer_->id(), false); |
1151 scrollbar_->SetPosition(gfx::Point(0, 10)); | 1152 scrollbar_->SetPosition(gfx::Point(0, 10)); |
1152 scrollbar_->SetBounds(gfx::Size(10, 10)); | 1153 scrollbar_->SetBounds(gfx::Size(10, 10)); |
1153 | 1154 |
1154 layer_->AddChild(scrollbar_); | 1155 layer_->AddChild(scrollbar_); |
1155 | 1156 |
1156 layer_tree_host()->SetRootLayer(layer_); | 1157 layer_tree_host()->SetRootLayer(layer_); |
1157 LayerTreeHostTest::SetupTree(); | 1158 LayerTreeHostTest::SetupTree(); |
1158 } | 1159 } |
1159 | 1160 |
1160 virtual void BeginTest() OVERRIDE { | 1161 virtual void BeginTest() OVERRIDE { |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1270 virtual void SetupTree() OVERRIDE { | 1271 virtual void SetupTree() OVERRIDE { |
1271 parent_ = FakeContentLayer::Create(&client_); | 1272 parent_ = FakeContentLayer::Create(&client_); |
1272 parent_->SetBounds(gfx::Size(10, 20)); | 1273 parent_->SetBounds(gfx::Size(10, 20)); |
1273 | 1274 |
1274 child_ = FakeContentLayer::Create(&client_); | 1275 child_ = FakeContentLayer::Create(&client_); |
1275 child_->SetPosition(gfx::Point(0, 10)); | 1276 child_->SetPosition(gfx::Point(0, 10)); |
1276 child_->SetBounds(gfx::Size(3, 10)); | 1277 child_->SetBounds(gfx::Size(3, 10)); |
1277 | 1278 |
1278 bool paint_scrollbar = true; | 1279 bool paint_scrollbar = true; |
1279 bool has_thumb = false; | 1280 bool has_thumb = false; |
1280 scrollbar_with_paints_ = | 1281 scrollbar_with_paints_ = FakeScrollbarLayer::Create( |
1281 FakeScrollbarLayer::Create(paint_scrollbar, has_thumb, parent_->id()); | 1282 paint_scrollbar, has_thumb, parent_->id(), false); |
1282 scrollbar_with_paints_->SetPosition(gfx::Point(3, 10)); | 1283 scrollbar_with_paints_->SetPosition(gfx::Point(3, 10)); |
1283 scrollbar_with_paints_->SetBounds(gfx::Size(3, 10)); | 1284 scrollbar_with_paints_->SetBounds(gfx::Size(3, 10)); |
1284 | 1285 |
1285 paint_scrollbar = false; | 1286 paint_scrollbar = false; |
1286 scrollbar_without_paints_ = | 1287 scrollbar_without_paints_ = FakeScrollbarLayer::Create( |
1287 FakeScrollbarLayer::Create(paint_scrollbar, has_thumb, parent_->id()); | 1288 paint_scrollbar, has_thumb, parent_->id(), false); |
1288 scrollbar_without_paints_->SetPosition(gfx::Point(6, 10)); | 1289 scrollbar_without_paints_->SetPosition(gfx::Point(6, 10)); |
1289 scrollbar_without_paints_->SetBounds(gfx::Size(3, 10)); | 1290 scrollbar_without_paints_->SetBounds(gfx::Size(3, 10)); |
1290 | 1291 |
1291 parent_->AddChild(child_); | 1292 parent_->AddChild(child_); |
1292 parent_->AddChild(scrollbar_with_paints_); | 1293 parent_->AddChild(scrollbar_with_paints_); |
1293 parent_->AddChild(scrollbar_without_paints_); | 1294 parent_->AddChild(scrollbar_without_paints_); |
1294 | 1295 |
1295 layer_tree_host()->SetRootLayer(parent_); | 1296 layer_tree_host()->SetRootLayer(parent_); |
1296 LayerTreeHostTest::SetupTree(); | 1297 LayerTreeHostTest::SetupTree(); |
1297 } | 1298 } |
(...skipping 1584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2882 | 2883 |
2883 TEST_F(LayerTreeHostTestNumFramesPending, GLRenderer) { | 2884 TEST_F(LayerTreeHostTestNumFramesPending, GLRenderer) { |
2884 RunTest(true, false, true); | 2885 RunTest(true, false, true); |
2885 } | 2886 } |
2886 | 2887 |
2887 class LayerTreeHostTestDeferredInitialize : public LayerTreeHostTest { | 2888 class LayerTreeHostTestDeferredInitialize : public LayerTreeHostTest { |
2888 public: | 2889 public: |
2889 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { | 2890 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { |
2890 // PictureLayer can only be used with impl side painting enabled. | 2891 // PictureLayer can only be used with impl side painting enabled. |
2891 settings->impl_side_painting = true; | 2892 settings->impl_side_painting = true; |
2892 settings->solid_color_scrollbars = true; | 2893 settings->force_solid_color_scrollbars = true; |
2893 } | 2894 } |
2894 | 2895 |
2895 virtual void SetupTree() OVERRIDE { | 2896 virtual void SetupTree() OVERRIDE { |
2896 layer_ = FakePictureLayer::Create(&client_); | 2897 layer_ = FakePictureLayer::Create(&client_); |
2897 layer_tree_host()->SetRootLayer(layer_); | 2898 layer_tree_host()->SetRootLayer(layer_); |
2898 LayerTreeHostTest::SetupTree(); | 2899 LayerTreeHostTest::SetupTree(); |
2899 } | 2900 } |
2900 | 2901 |
2901 virtual void BeginTest() OVERRIDE { | 2902 virtual void BeginTest() OVERRIDE { |
2902 initialized_gl_ = false; | 2903 initialized_gl_ = false; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2950 private: | 2951 private: |
2951 FakeContentLayerClient client_; | 2952 FakeContentLayerClient client_; |
2952 scoped_refptr<FakePictureLayer> layer_; | 2953 scoped_refptr<FakePictureLayer> layer_; |
2953 bool initialized_gl_; | 2954 bool initialized_gl_; |
2954 }; | 2955 }; |
2955 | 2956 |
2956 MULTI_THREAD_TEST_F(LayerTreeHostTestDeferredInitialize); | 2957 MULTI_THREAD_TEST_F(LayerTreeHostTestDeferredInitialize); |
2957 | 2958 |
2958 } // namespace | 2959 } // namespace |
2959 } // namespace cc | 2960 } // namespace cc |
OLD | NEW |