OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 | 351 |
352 scoped_refptr<Layer> scrollbar_layer = FakePaintedScrollbarLayer::Create( | 352 scoped_refptr<Layer> scrollbar_layer = FakePaintedScrollbarLayer::Create( |
353 layer_settings(), false, true, content_layer->id()); | 353 layer_settings(), false, true, content_layer->id()); |
354 scrollbar_layer->SetPosition(gfx::Point(300, 300)); | 354 scrollbar_layer->SetPosition(gfx::Point(300, 300)); |
355 scrollbar_layer->SetBounds(gfx::Size(10, 100)); | 355 scrollbar_layer->SetBounds(gfx::Size(10, 100)); |
356 scrollbar_layer->ToScrollbarLayer()->SetClipLayer(scroll_clip_layer->id()); | 356 scrollbar_layer->ToScrollbarLayer()->SetClipLayer(scroll_clip_layer->id()); |
357 scrollbar_layer->ToScrollbarLayer()->SetScrollLayer(content_layer->id()); | 357 scrollbar_layer->ToScrollbarLayer()->SetScrollLayer(content_layer->id()); |
358 root_layer->AddChild(scrollbar_layer); | 358 root_layer->AddChild(scrollbar_layer); |
359 | 359 |
360 gfx::RectF content_rect(content_layer->position(), | 360 gfx::RectF content_rect(content_layer->position(), |
361 content_layer->bounds()); | 361 gfx::SizeF(content_layer->bounds())); |
362 gfx::RectF scrollbar_rect(scrollbar_layer->position(), | 362 gfx::RectF scrollbar_rect(scrollbar_layer->position(), |
363 scrollbar_layer->bounds()); | 363 gfx::SizeF(scrollbar_layer->bounds())); |
364 EXPECT_FALSE(content_rect.Intersects(scrollbar_rect)); | 364 EXPECT_FALSE(content_rect.Intersects(scrollbar_rect)); |
365 | 365 |
366 LayerTreeHostDamageTest::SetupTree(); | 366 LayerTreeHostDamageTest::SetupTree(); |
367 } | 367 } |
368 | 368 |
369 private: | 369 private: |
370 FakeContentLayerClient client_; | 370 FakeContentLayerClient client_; |
371 }; | 371 }; |
372 | 372 |
373 class LayerTreeHostDamageTestScrollbarDoesDamage | 373 class LayerTreeHostDamageTestScrollbarDoesDamage |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
529 | 529 |
530 void AfterTest() override { EXPECT_EQ(3, did_swaps_); } | 530 void AfterTest() override { EXPECT_EQ(3, did_swaps_); } |
531 | 531 |
532 int did_swaps_; | 532 int did_swaps_; |
533 }; | 533 }; |
534 | 534 |
535 MULTI_THREAD_TEST_F(LayerTreeHostDamageTestScrollbarCommitDoesNoDamage); | 535 MULTI_THREAD_TEST_F(LayerTreeHostDamageTestScrollbarCommitDoesNoDamage); |
536 | 536 |
537 } // namespace | 537 } // namespace |
538 } // namespace cc | 538 } // namespace cc |
OLD | NEW |