Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(286)

Side by Side Diff: cc/trees/layer_tree_host_unittest_damage.cc

Issue 2816063003: Replace layer id with Element id for tracking scrollbar animation controllers (Closed)
Patch Set: Address reviewer comments, pull element_id.h change to another patch Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698