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

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

Issue 1801853002: Transfer LayerImpl ownership to LayerTreeImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebaaase. Created 4 years, 9 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/location.h" 7 #include "base/location.h"
8 #include "base/memory/weak_ptr.h" 8 #include "base/memory/weak_ptr.h"
9 #include "base/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "base/thread_task_runner_handle.h" 10 #include "base/thread_task_runner_handle.h"
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 expected_scroll_layer_->scroll_offset()); 599 expected_scroll_layer_->scroll_offset());
600 break; 600 break;
601 } 601 }
602 } 602 }
603 603
604 void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { 604 void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override {
605 LayerImpl* inner_scroll = impl->InnerViewportScrollLayer(); 605 LayerImpl* inner_scroll = impl->InnerViewportScrollLayer();
606 FakePictureLayerImpl* root_scroll_layer_impl = 606 FakePictureLayerImpl* root_scroll_layer_impl =
607 static_cast<FakePictureLayerImpl*>(impl->OuterViewportScrollLayer()); 607 static_cast<FakePictureLayerImpl*>(impl->OuterViewportScrollLayer());
608 FakePictureLayerImpl* child_layer_impl = static_cast<FakePictureLayerImpl*>( 608 FakePictureLayerImpl* child_layer_impl = static_cast<FakePictureLayerImpl*>(
609 root_scroll_layer_impl->children()[0].get()); 609 root_scroll_layer_impl->children()[0]);
610 610
611 LayerImpl* expected_scroll_layer_impl = NULL; 611 LayerImpl* expected_scroll_layer_impl = NULL;
612 LayerImpl* expected_no_scroll_layer_impl = NULL; 612 LayerImpl* expected_no_scroll_layer_impl = NULL;
613 if (scroll_child_layer_) { 613 if (scroll_child_layer_) {
614 expected_scroll_layer_impl = child_layer_impl; 614 expected_scroll_layer_impl = child_layer_impl;
615 expected_no_scroll_layer_impl = root_scroll_layer_impl; 615 expected_no_scroll_layer_impl = root_scroll_layer_impl;
616 } else { 616 } else {
617 expected_scroll_layer_impl = root_scroll_layer_impl; 617 expected_scroll_layer_impl = root_scroll_layer_impl;
618 expected_no_scroll_layer_impl = child_layer_impl; 618 expected_no_scroll_layer_impl = child_layer_impl;
619 } 619 }
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after
1420 RunTest(CompositorMode::THREADED, false); 1420 RunTest(CompositorMode::THREADED, false);
1421 } 1421 }
1422 1422
1423 TEST_F(LayerTreeHostScrollTestLayerStructureChange, ScrollDestroyWholeTree) { 1423 TEST_F(LayerTreeHostScrollTestLayerStructureChange, ScrollDestroyWholeTree) {
1424 scroll_destroy_whole_tree_ = true; 1424 scroll_destroy_whole_tree_ = true;
1425 RunTest(CompositorMode::THREADED, false); 1425 RunTest(CompositorMode::THREADED, false);
1426 } 1426 }
1427 1427
1428 } // namespace 1428 } // namespace
1429 } // namespace cc 1429 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698