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

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

Issue 13817003: Damage root layer when viewport or top controls changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix LayerTreeHostDelegatedTestLayerUsesFrameDamage Created 7 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
« no previous file with comments | « cc/trees/layer_tree_host_unittest_delegated.cc ('k') | cc/trees/layer_tree_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "cc/layers/content_layer.h" 7 #include "cc/layers/content_layer.h"
8 #include "cc/layers/layer.h" 8 #include "cc/layers/layer.h"
9 #include "cc/layers/layer_impl.h" 9 #include "cc/layers/layer_impl.h"
10 #include "cc/test/fake_content_layer_client.h" 10 #include "cc/test/fake_content_layer_client.h"
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 489
490 class ImplSidePaintingScrollTest : public LayerTreeHostScrollTest { 490 class ImplSidePaintingScrollTest : public LayerTreeHostScrollTest {
491 public: 491 public:
492 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE { 492 virtual void InitializeSettings(LayerTreeSettings* settings) OVERRIDE {
493 settings->impl_side_painting = true; 493 settings->impl_side_painting = true;
494 } 494 }
495 495
496 virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE { 496 virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
497 // Manual vsync tick. 497 // Manual vsync tick.
498 if (impl->pending_tree()) 498 if (impl->pending_tree())
499 impl->setNeedsRedraw(); 499 impl->SetNeedsRedraw();
500 } 500 }
501 }; 501 };
502 502
503 class ImplSidePaintingScrollTestSimple : public ImplSidePaintingScrollTest { 503 class ImplSidePaintingScrollTestSimple : public ImplSidePaintingScrollTest {
504 public: 504 public:
505 ImplSidePaintingScrollTestSimple() 505 ImplSidePaintingScrollTestSimple()
506 : initial_scroll_(10, 20), 506 : initial_scroll_(10, 20),
507 main_thread_scroll_(40, 5), 507 main_thread_scroll_(40, 5),
508 impl_thread_scroll1_(2, -1), 508 impl_thread_scroll1_(2, -1),
509 impl_thread_scroll2_(-3, 10), 509 impl_thread_scroll2_(-3, 10),
(...skipping 24 matching lines...) Expand all
534 } 534 }
535 535
536 virtual bool CanActivatePendingTree() OVERRIDE { 536 virtual bool CanActivatePendingTree() OVERRIDE {
537 return can_activate_; 537 return can_activate_;
538 } 538 }
539 539
540 virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE { 540 virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE {
541 // We force a second draw here of the first commit before activating 541 // We force a second draw here of the first commit before activating
542 // the second commit. 542 // the second commit.
543 if (impl->active_tree()->source_frame_number() == 0) 543 if (impl->active_tree()->source_frame_number() == 0)
544 impl->setNeedsRedraw(); 544 impl->SetNeedsRedraw();
545 } 545 }
546 546
547 virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE { 547 virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE {
548 ImplSidePaintingScrollTest::DrawLayersOnThread(impl); 548 ImplSidePaintingScrollTest::DrawLayersOnThread(impl);
549 549
550 LayerImpl* root = impl->active_tree()->root_layer(); 550 LayerImpl* root = impl->active_tree()->root_layer();
551 root->SetScrollable(true); 551 root->SetScrollable(true);
552 root->SetMaxScrollOffset(gfx::Vector2d(100, 100)); 552 root->SetMaxScrollOffset(gfx::Vector2d(100, 100));
553 553
554 LayerImpl* pending_root = 554 LayerImpl* pending_root =
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
656 } 656 }
657 657
658 virtual void AfterTest() OVERRIDE {} 658 virtual void AfterTest() OVERRIDE {}
659 }; 659 };
660 660
661 SINGLE_AND_MULTI_THREAD_TEST_F( 661 SINGLE_AND_MULTI_THREAD_TEST_F(
662 LayerTreeHostScrollTestScrollZeroMaxScrollOffset); 662 LayerTreeHostScrollTestScrollZeroMaxScrollOffset);
663 663
664 } // namespace 664 } // namespace
665 } // namespace cc 665 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_unittest_delegated.cc ('k') | cc/trees/layer_tree_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698