| 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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 321 } | 321 } |
| 322 | 322 |
| 323 virtual void SetupTree() OVERRIDE { | 323 virtual void SetupTree() OVERRIDE { |
| 324 root_layer_ = Layer::Create(); | 324 root_layer_ = Layer::Create(); |
| 325 root_layer_->SetBounds(gfx::Size(10, 20)); | 325 root_layer_->SetBounds(gfx::Size(10, 20)); |
| 326 | 326 |
| 327 bool paint_scrollbar = true; | 327 bool paint_scrollbar = true; |
| 328 bool has_thumb = false; | 328 bool has_thumb = false; |
| 329 scrollbar_ = FakeScrollbarLayer::Create(paint_scrollbar, | 329 scrollbar_ = FakeScrollbarLayer::Create(paint_scrollbar, |
| 330 has_thumb, | 330 has_thumb, |
| 331 root_layer_->id()); | 331 root_layer_->id(), |
| 332 false); |
| 332 scrollbar_->SetPosition(gfx::Point(0, 10)); | 333 scrollbar_->SetPosition(gfx::Point(0, 10)); |
| 333 scrollbar_->SetBounds(gfx::Size(10, 10)); | 334 scrollbar_->SetBounds(gfx::Size(10, 10)); |
| 334 | 335 |
| 335 root_layer_->AddChild(scrollbar_); | 336 root_layer_->AddChild(scrollbar_); |
| 336 | 337 |
| 337 layer_tree_host()->SetRootLayer(root_layer_); | 338 layer_tree_host()->SetRootLayer(root_layer_); |
| 338 LayerTreeHostTest::SetupTree(); | 339 LayerTreeHostTest::SetupTree(); |
| 339 } | 340 } |
| 340 | 341 |
| 341 virtual void BeginTest() OVERRIDE { | 342 virtual void BeginTest() OVERRIDE { |
| (...skipping 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1046 // Linear fade animator prevents scrollbars from drawing immediately. | 1047 // Linear fade animator prevents scrollbars from drawing immediately. |
| 1047 settings->use_linear_fade_scrollbar_animator = false; | 1048 settings->use_linear_fade_scrollbar_animator = false; |
| 1048 } | 1049 } |
| 1049 | 1050 |
| 1050 virtual void SetupTree() OVERRIDE { | 1051 virtual void SetupTree() OVERRIDE { |
| 1051 layer_ = FakeContentLayer::Create(&client_); | 1052 layer_ = FakeContentLayer::Create(&client_); |
| 1052 layer_->SetBounds(gfx::Size(10, 20)); | 1053 layer_->SetBounds(gfx::Size(10, 20)); |
| 1053 | 1054 |
| 1054 bool paint_scrollbar = true; | 1055 bool paint_scrollbar = true; |
| 1055 bool has_thumb = false; | 1056 bool has_thumb = false; |
| 1056 scrollbar_ = | 1057 scrollbar_ = FakeScrollbarLayer::Create( |
| 1057 FakeScrollbarLayer::Create(paint_scrollbar, has_thumb, layer_->id()); | 1058 paint_scrollbar, has_thumb, layer_->id(), false); |
| 1058 scrollbar_->SetPosition(gfx::Point(0, 10)); | 1059 scrollbar_->SetPosition(gfx::Point(0, 10)); |
| 1059 scrollbar_->SetBounds(gfx::Size(10, 10)); | 1060 scrollbar_->SetBounds(gfx::Size(10, 10)); |
| 1060 | 1061 |
| 1061 layer_->AddChild(scrollbar_); | 1062 layer_->AddChild(scrollbar_); |
| 1062 | 1063 |
| 1063 layer_tree_host()->SetRootLayer(layer_); | 1064 layer_tree_host()->SetRootLayer(layer_); |
| 1064 LayerTreeHostTest::SetupTree(); | 1065 LayerTreeHostTest::SetupTree(); |
| 1065 } | 1066 } |
| 1066 | 1067 |
| 1067 virtual void BeginTest() OVERRIDE { | 1068 virtual void BeginTest() OVERRIDE { |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1177 virtual void SetupTree() OVERRIDE { | 1178 virtual void SetupTree() OVERRIDE { |
| 1178 parent_ = FakeContentLayer::Create(&client_); | 1179 parent_ = FakeContentLayer::Create(&client_); |
| 1179 parent_->SetBounds(gfx::Size(10, 20)); | 1180 parent_->SetBounds(gfx::Size(10, 20)); |
| 1180 | 1181 |
| 1181 child_ = FakeContentLayer::Create(&client_); | 1182 child_ = FakeContentLayer::Create(&client_); |
| 1182 child_->SetPosition(gfx::Point(0, 10)); | 1183 child_->SetPosition(gfx::Point(0, 10)); |
| 1183 child_->SetBounds(gfx::Size(3, 10)); | 1184 child_->SetBounds(gfx::Size(3, 10)); |
| 1184 | 1185 |
| 1185 bool paint_scrollbar = true; | 1186 bool paint_scrollbar = true; |
| 1186 bool has_thumb = false; | 1187 bool has_thumb = false; |
| 1187 scrollbar_with_paints_ = | 1188 scrollbar_with_paints_ = FakeScrollbarLayer::Create( |
| 1188 FakeScrollbarLayer::Create(paint_scrollbar, has_thumb, parent_->id()); | 1189 paint_scrollbar, has_thumb, parent_->id(), false); |
| 1189 scrollbar_with_paints_->SetPosition(gfx::Point(3, 10)); | 1190 scrollbar_with_paints_->SetPosition(gfx::Point(3, 10)); |
| 1190 scrollbar_with_paints_->SetBounds(gfx::Size(3, 10)); | 1191 scrollbar_with_paints_->SetBounds(gfx::Size(3, 10)); |
| 1191 | 1192 |
| 1192 paint_scrollbar = false; | 1193 paint_scrollbar = false; |
| 1193 scrollbar_without_paints_ = | 1194 scrollbar_without_paints_ = FakeScrollbarLayer::Create( |
| 1194 FakeScrollbarLayer::Create(paint_scrollbar, has_thumb, parent_->id()); | 1195 paint_scrollbar, has_thumb, parent_->id(), false); |
| 1195 scrollbar_without_paints_->SetPosition(gfx::Point(6, 10)); | 1196 scrollbar_without_paints_->SetPosition(gfx::Point(6, 10)); |
| 1196 scrollbar_without_paints_->SetBounds(gfx::Size(3, 10)); | 1197 scrollbar_without_paints_->SetBounds(gfx::Size(3, 10)); |
| 1197 | 1198 |
| 1198 parent_->AddChild(child_); | 1199 parent_->AddChild(child_); |
| 1199 parent_->AddChild(scrollbar_with_paints_); | 1200 parent_->AddChild(scrollbar_with_paints_); |
| 1200 parent_->AddChild(scrollbar_without_paints_); | 1201 parent_->AddChild(scrollbar_without_paints_); |
| 1201 | 1202 |
| 1202 layer_tree_host()->SetRootLayer(parent_); | 1203 layer_tree_host()->SetRootLayer(parent_); |
| 1203 LayerTreeHostTest::SetupTree(); | 1204 LayerTreeHostTest::SetupTree(); |
| 1204 } | 1205 } |
| (...skipping 1586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2791 | 2792 |
| 2792 TEST_F(LayerTreeHostTestNumFramesPending, GLRenderer) { | 2793 TEST_F(LayerTreeHostTestNumFramesPending, GLRenderer) { |
| 2793 RunTest(true, false, true); | 2794 RunTest(true, false, true); |
| 2794 } | 2795 } |
| 2795 | 2796 |
| 2796 class LayerTreeHostTestDeferredInitialize : public LayerTreeHostTest { | 2797 class LayerTreeHostTestDeferredInitialize : public LayerTreeHostTest { |
| 2797 public: | 2798 public: |
| 2798 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { | 2799 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { |
| 2799 // PictureLayer can only be used with impl side painting enabled. | 2800 // PictureLayer can only be used with impl side painting enabled. |
| 2800 settings->impl_side_painting = true; | 2801 settings->impl_side_painting = true; |
| 2801 settings->solid_color_scrollbars = true; | 2802 settings->force_solid_color_scrollbars = true; |
| 2802 } | 2803 } |
| 2803 | 2804 |
| 2804 virtual void SetupTree() OVERRIDE { | 2805 virtual void SetupTree() OVERRIDE { |
| 2805 layer_ = FakePictureLayer::Create(&client_); | 2806 layer_ = FakePictureLayer::Create(&client_); |
| 2806 layer_tree_host()->SetRootLayer(layer_); | 2807 layer_tree_host()->SetRootLayer(layer_); |
| 2807 LayerTreeHostTest::SetupTree(); | 2808 LayerTreeHostTest::SetupTree(); |
| 2808 } | 2809 } |
| 2809 | 2810 |
| 2810 virtual void BeginTest() OVERRIDE { | 2811 virtual void BeginTest() OVERRIDE { |
| 2811 initialized_gl_ = false; | 2812 initialized_gl_ = false; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2859 private: | 2860 private: |
| 2860 FakeContentLayerClient client_; | 2861 FakeContentLayerClient client_; |
| 2861 scoped_refptr<FakePictureLayer> layer_; | 2862 scoped_refptr<FakePictureLayer> layer_; |
| 2862 bool initialized_gl_; | 2863 bool initialized_gl_; |
| 2863 }; | 2864 }; |
| 2864 | 2865 |
| 2865 MULTI_THREAD_TEST_F(LayerTreeHostTestDeferredInitialize); | 2866 MULTI_THREAD_TEST_F(LayerTreeHostTestDeferredInitialize); |
| 2866 | 2867 |
| 2867 } // namespace | 2868 } // namespace |
| 2868 } // namespace cc | 2869 } // namespace cc |
| OLD | NEW |