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

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

Issue 2188133002: Scroll with Layers in views::ScrollView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@20160728-MacViews-ScrollTrack
Patch Set: bugref, scale_delta DCHECK + comment Created 4 years, 4 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 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/single_thread_proxy.h" 5 #include "cc/trees/single_thread_proxy.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "base/profiler/scoped_tracker.h" 9 #include "base/profiler/scoped_tracker.h"
10 #include "base/trace_event/trace_event.h" 10 #include "base/trace_event/trace_event.h"
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 if (layer_tree_host_impl_->EvictedUIResourcesExist()) 238 if (layer_tree_host_impl_->EvictedUIResourcesExist())
239 layer_tree_host_->RecreateUIResources(); 239 layer_tree_host_->RecreateUIResources();
240 240
241 // TODO(robliao): Remove ScopedTracker below once https://crbug.com/461509 241 // TODO(robliao): Remove ScopedTracker below once https://crbug.com/461509
242 // is fixed. 242 // is fixed.
243 tracked_objects::ScopedTracker tracking_profile7( 243 tracked_objects::ScopedTracker tracking_profile7(
244 FROM_HERE_WITH_EXPLICIT_FUNCTION( 244 FROM_HERE_WITH_EXPLICIT_FUNCTION(
245 "461509 SingleThreadProxy::DoCommit7")); 245 "461509 SingleThreadProxy::DoCommit7"));
246 layer_tree_host_->FinishCommitOnImplThread(layer_tree_host_impl_.get()); 246 layer_tree_host_->FinishCommitOnImplThread(layer_tree_host_impl_.get());
247 247
248 #if DCHECK_IS_ON()
249 // In the single-threaded case, the scale and scroll deltas should never be
250 // touched on the impl layer tree.
251 std::unique_ptr<ScrollAndScaleSet> scroll_info =
252 layer_tree_host_impl_->ProcessScrollDeltas();
253 DCHECK(scroll_info->scrolls.empty());
254 DCHECK_EQ(1.f, scroll_info->page_scale_delta);
255 #endif
256
257 if (scheduler_on_impl_thread_) 248 if (scheduler_on_impl_thread_)
258 scheduler_on_impl_thread_->DidCommit(); 249 scheduler_on_impl_thread_->DidCommit();
259 250
260 layer_tree_host_impl_->CommitComplete(); 251 layer_tree_host_impl_->CommitComplete();
261 252
262 // TODO(robliao): Remove ScopedTracker below once https://crbug.com/461509 253 // TODO(robliao): Remove ScopedTracker below once https://crbug.com/461509
263 // is fixed. 254 // is fixed.
264 tracked_objects::ScopedTracker tracking_profile8( 255 tracked_objects::ScopedTracker tracking_profile8(
265 FROM_HERE_WITH_EXPLICIT_FUNCTION( 256 FROM_HERE_WITH_EXPLICIT_FUNCTION(
266 "461509 SingleThreadProxy::DoCommit8")); 257 "461509 SingleThreadProxy::DoCommit8"));
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
787 // Prevent new commits from being requested inside DoBeginMainFrame. 778 // Prevent new commits from being requested inside DoBeginMainFrame.
788 // Note: We do not want to prevent SetNeedsAnimate from requesting 779 // Note: We do not want to prevent SetNeedsAnimate from requesting
789 // a commit here. 780 // a commit here.
790 commit_requested_ = true; 781 commit_requested_ = true;
791 782
792 DoBeginMainFrame(begin_frame_args); 783 DoBeginMainFrame(begin_frame_args);
793 } 784 }
794 785
795 void SingleThreadProxy::DoBeginMainFrame( 786 void SingleThreadProxy::DoBeginMainFrame(
796 const BeginFrameArgs& begin_frame_args) { 787 const BeginFrameArgs& begin_frame_args) {
788 // In the single-threaded case, the scale deltas should never be touched on
789 // the impl layer tree. However, impl-side scroll deltas may be manipulated
790 // directly via the InputHandler on the UI thread.
791 std::unique_ptr<ScrollAndScaleSet> scroll_info =
792 layer_tree_host_impl_->ProcessScrollDeltas();
793 DCHECK_EQ(1.f, scroll_info->page_scale_delta);
794 layer_tree_host_->ApplyScrollAndScale(scroll_info.get());
795
797 layer_tree_host_->WillBeginMainFrame(); 796 layer_tree_host_->WillBeginMainFrame();
798 layer_tree_host_->BeginMainFrame(begin_frame_args); 797 layer_tree_host_->BeginMainFrame(begin_frame_args);
799 layer_tree_host_->AnimateLayers(begin_frame_args.frame_time); 798 layer_tree_host_->AnimateLayers(begin_frame_args.frame_time);
800 layer_tree_host_->RequestMainFrameUpdate(); 799 layer_tree_host_->RequestMainFrameUpdate();
801 800
802 // New commits requested inside UpdateLayers should be respected. 801 // New commits requested inside UpdateLayers should be respected.
803 commit_requested_ = false; 802 commit_requested_ = false;
804 803
805 layer_tree_host_->UpdateLayers(); 804 layer_tree_host_->UpdateLayers();
806 805
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 void SingleThreadProxy::DidFinishImplFrame() { 876 void SingleThreadProxy::DidFinishImplFrame() {
878 layer_tree_host_impl_->DidFinishImplFrame(); 877 layer_tree_host_impl_->DidFinishImplFrame();
879 #if DCHECK_IS_ON() 878 #if DCHECK_IS_ON()
880 DCHECK(inside_impl_frame_) 879 DCHECK(inside_impl_frame_)
881 << "DidFinishImplFrame called while not inside an impl frame!"; 880 << "DidFinishImplFrame called while not inside an impl frame!";
882 inside_impl_frame_ = false; 881 inside_impl_frame_ = false;
883 #endif 882 #endif
884 } 883 }
885 884
886 } // namespace cc 885 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | chrome/browser/ui/views/extensions/extension_install_dialog_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698