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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 | 333 |
334 class LayerTreeHostScrollbarDamageTest : public LayerTreeHostDamageTest { | 334 class LayerTreeHostScrollbarDamageTest : public LayerTreeHostDamageTest { |
335 void SetupTree() override { | 335 void SetupTree() override { |
336 scoped_refptr<Layer> root_layer = Layer::Create(); | 336 scoped_refptr<Layer> root_layer = Layer::Create(); |
337 root_layer->SetBounds(gfx::Size(400, 400)); | 337 root_layer->SetBounds(gfx::Size(400, 400)); |
338 root_layer->SetMasksToBounds(true); | 338 root_layer->SetMasksToBounds(true); |
339 layer_tree_host()->SetRootLayer(root_layer); | 339 layer_tree_host()->SetRootLayer(root_layer); |
340 | 340 |
341 scoped_refptr<Layer> scroll_clip_layer = Layer::Create(); | 341 scoped_refptr<Layer> scroll_clip_layer = Layer::Create(); |
342 content_layer_ = FakePictureLayer::Create(&client_); | 342 content_layer_ = FakePictureLayer::Create(&client_); |
| 343 content_layer_->SetElementId( |
| 344 LayerIdToElementIdForTesting(content_layer_->id())); |
343 content_layer_->SetScrollClipLayerId(scroll_clip_layer->id()); | 345 content_layer_->SetScrollClipLayerId(scroll_clip_layer->id()); |
344 content_layer_->SetScrollOffset(gfx::ScrollOffset(10, 20)); | 346 content_layer_->SetScrollOffset(gfx::ScrollOffset(10, 20)); |
345 content_layer_->SetBounds(gfx::Size(100, 200)); | 347 content_layer_->SetBounds(gfx::Size(100, 200)); |
346 content_layer_->SetIsDrawable(true); | 348 content_layer_->SetIsDrawable(true); |
347 scroll_clip_layer->SetBounds( | 349 scroll_clip_layer->SetBounds( |
348 gfx::Size(content_layer_->bounds().width() - 30, | 350 gfx::Size(content_layer_->bounds().width() - 30, |
349 content_layer_->bounds().height() - 50)); | 351 content_layer_->bounds().height() - 50)); |
350 scroll_clip_layer->AddChild(content_layer_); | 352 scroll_clip_layer->AddChild(content_layer_); |
351 root_layer->AddChild(scroll_clip_layer); | 353 root_layer->AddChild(scroll_clip_layer); |
352 | 354 |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 | 528 |
527 void AfterTest() override { EXPECT_EQ(3, num_draws_); } | 529 void AfterTest() override { EXPECT_EQ(3, num_draws_); } |
528 | 530 |
529 int num_draws_; | 531 int num_draws_; |
530 }; | 532 }; |
531 | 533 |
532 MULTI_THREAD_TEST_F(LayerTreeHostDamageTestScrollbarCommitDoesNoDamage); | 534 MULTI_THREAD_TEST_F(LayerTreeHostDamageTestScrollbarCommitDoesNoDamage); |
533 | 535 |
534 } // namespace | 536 } // namespace |
535 } // namespace cc | 537 } // namespace cc |
OLD | NEW |