| 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 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 content_layer_->SetScrollClipLayerId(scroll_clip_layer->id()); | 343 content_layer_->SetScrollClipLayerId(scroll_clip_layer->id()); |
| 344 content_layer_->SetScrollOffset(gfx::ScrollOffset(10, 20)); | 344 content_layer_->SetScrollOffset(gfx::ScrollOffset(10, 20)); |
| 345 content_layer_->SetBounds(gfx::Size(100, 200)); | 345 content_layer_->SetBounds(gfx::Size(100, 200)); |
| 346 content_layer_->SetIsDrawable(true); | 346 content_layer_->SetIsDrawable(true); |
| 347 scroll_clip_layer->SetBounds( | 347 scroll_clip_layer->SetBounds( |
| 348 gfx::Size(content_layer_->bounds().width() - 30, | 348 gfx::Size(content_layer_->bounds().width() - 30, |
| 349 content_layer_->bounds().height() - 50)); | 349 content_layer_->bounds().height() - 50)); |
| 350 scroll_clip_layer->AddChild(content_layer_); | 350 scroll_clip_layer->AddChild(content_layer_); |
| 351 root_layer->AddChild(scroll_clip_layer); | 351 root_layer->AddChild(scroll_clip_layer); |
| 352 | 352 |
| 353 scoped_refptr<Layer> scrollbar_layer = | 353 scoped_refptr<Layer> scrollbar_layer = FakePaintedScrollbarLayer::Create( |
| 354 FakePaintedScrollbarLayer::Create(false, true, content_layer_->id()); | 354 false, true, content_layer_->id(), content_layer_->element_id()); |
| 355 scrollbar_layer->SetPosition(gfx::PointF(300.f, 300.f)); | 355 scrollbar_layer->SetPosition(gfx::PointF(300.f, 300.f)); |
| 356 scrollbar_layer->SetBounds(gfx::Size(10, 100)); | 356 scrollbar_layer->SetBounds(gfx::Size(10, 100)); |
| 357 root_layer->AddChild(scrollbar_layer); | 357 root_layer->AddChild(scrollbar_layer); |
| 358 | 358 |
| 359 gfx::RectF content_rect(content_layer_->position(), | 359 gfx::RectF content_rect(content_layer_->position(), |
| 360 gfx::SizeF(content_layer_->bounds())); | 360 gfx::SizeF(content_layer_->bounds())); |
| 361 gfx::RectF scrollbar_rect(scrollbar_layer->position(), | 361 gfx::RectF scrollbar_rect(scrollbar_layer->position(), |
| 362 gfx::SizeF(scrollbar_layer->bounds())); | 362 gfx::SizeF(scrollbar_layer->bounds())); |
| 363 EXPECT_FALSE(content_rect.Intersects(scrollbar_rect)); | 363 EXPECT_FALSE(content_rect.Intersects(scrollbar_rect)); |
| 364 | 364 |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 | 526 |
| 527 void AfterTest() override { EXPECT_EQ(3, num_draws_); } | 527 void AfterTest() override { EXPECT_EQ(3, num_draws_); } |
| 528 | 528 |
| 529 int num_draws_; | 529 int num_draws_; |
| 530 }; | 530 }; |
| 531 | 531 |
| 532 MULTI_THREAD_TEST_F(LayerTreeHostDamageTestScrollbarCommitDoesNoDamage); | 532 MULTI_THREAD_TEST_F(LayerTreeHostDamageTestScrollbarCommitDoesNoDamage); |
| 533 | 533 |
| 534 } // namespace | 534 } // namespace |
| 535 } // namespace cc | 535 } // namespace cc |
| OLD | NEW |