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

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: vollick@ comments 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 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 if (layer_tree_host_impl_->EvictedUIResourcesExist()) 247 if (layer_tree_host_impl_->EvictedUIResourcesExist())
248 layer_tree_host_->RecreateUIResources(); 248 layer_tree_host_->RecreateUIResources();
249 249
250 // TODO(robliao): Remove ScopedTracker below once https://crbug.com/461509 250 // TODO(robliao): Remove ScopedTracker below once https://crbug.com/461509
251 // is fixed. 251 // is fixed.
252 tracked_objects::ScopedTracker tracking_profile7( 252 tracked_objects::ScopedTracker tracking_profile7(
253 FROM_HERE_WITH_EXPLICIT_FUNCTION( 253 FROM_HERE_WITH_EXPLICIT_FUNCTION(
254 "461509 SingleThreadProxy::DoCommit7")); 254 "461509 SingleThreadProxy::DoCommit7"));
255 layer_tree_host_->FinishCommitOnImplThread(layer_tree_host_impl_.get()); 255 layer_tree_host_->FinishCommitOnImplThread(layer_tree_host_impl_.get());
256 256
257 #if DCHECK_IS_ON()
258 // In the single-threaded case, the scale and scroll deltas should never be
259 // touched on the impl layer tree.
Ian Vollick 2016/08/12 13:57:42 I presume that scroll to offset can now cause scro
tapted 2016/08/13 09:03:53 Done (reinstated in DoBeginMainFrame() since the P
260 std::unique_ptr<ScrollAndScaleSet> scroll_info =
261 layer_tree_host_impl_->ProcessScrollDeltas();
262 DCHECK(scroll_info->scrolls.empty());
263 DCHECK_EQ(1.f, scroll_info->page_scale_delta);
264 #endif
265
266 if (scheduler_on_impl_thread_) 257 if (scheduler_on_impl_thread_)
267 scheduler_on_impl_thread_->DidCommit(); 258 scheduler_on_impl_thread_->DidCommit();
268 259
269 layer_tree_host_impl_->CommitComplete(); 260 layer_tree_host_impl_->CommitComplete();
270 261
271 // TODO(robliao): Remove ScopedTracker below once https://crbug.com/461509 262 // TODO(robliao): Remove ScopedTracker below once https://crbug.com/461509
272 // is fixed. 263 // is fixed.
273 tracked_objects::ScopedTracker tracking_profile8( 264 tracked_objects::ScopedTracker tracking_profile8(
274 FROM_HERE_WITH_EXPLICIT_FUNCTION( 265 FROM_HERE_WITH_EXPLICIT_FUNCTION(
275 "461509 SingleThreadProxy::DoCommit8")); 266 "461509 SingleThreadProxy::DoCommit8"));
(...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 // Prevent new commits from being requested inside DoBeginMainFrame. 786 // Prevent new commits from being requested inside DoBeginMainFrame.
796 // Note: We do not want to prevent SetNeedsAnimate from requesting 787 // Note: We do not want to prevent SetNeedsAnimate from requesting
797 // a commit here. 788 // a commit here.
798 commit_requested_ = true; 789 commit_requested_ = true;
799 790
800 DoBeginMainFrame(begin_frame_args); 791 DoBeginMainFrame(begin_frame_args);
801 } 792 }
802 793
803 void SingleThreadProxy::DoBeginMainFrame( 794 void SingleThreadProxy::DoBeginMainFrame(
804 const BeginFrameArgs& begin_frame_args) { 795 const BeginFrameArgs& begin_frame_args) {
796 std::unique_ptr<ScrollAndScaleSet> scroll_info =
797 layer_tree_host_impl_->ProcessScrollDeltas();
798 layer_tree_host_->ApplyScrollAndScale(scroll_info.get());
Ian Vollick 2016/08/12 13:57:42 Again, please add a comment as this is counterintu
tapted 2016/08/13 09:03:53 Done.
799
805 layer_tree_host_->WillBeginMainFrame(); 800 layer_tree_host_->WillBeginMainFrame();
806 layer_tree_host_->BeginMainFrame(begin_frame_args); 801 layer_tree_host_->BeginMainFrame(begin_frame_args);
807 layer_tree_host_->AnimateLayers(begin_frame_args.frame_time); 802 layer_tree_host_->AnimateLayers(begin_frame_args.frame_time);
808 layer_tree_host_->RequestMainFrameUpdate(); 803 layer_tree_host_->RequestMainFrameUpdate();
809 804
810 // New commits requested inside UpdateLayers should be respected. 805 // New commits requested inside UpdateLayers should be respected.
811 commit_requested_ = false; 806 commit_requested_ = false;
812 807
813 layer_tree_host_->UpdateLayers(); 808 layer_tree_host_->UpdateLayers();
814 809
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
883 void SingleThreadProxy::DidFinishImplFrame() { 878 void SingleThreadProxy::DidFinishImplFrame() {
884 layer_tree_host_impl_->DidFinishImplFrame(); 879 layer_tree_host_impl_->DidFinishImplFrame();
885 #if DCHECK_IS_ON() 880 #if DCHECK_IS_ON()
886 DCHECK(inside_impl_frame_) 881 DCHECK(inside_impl_frame_)
887 << "DidFinishImplFrame called while not inside an impl frame!"; 882 << "DidFinishImplFrame called while not inside an impl frame!";
888 inside_impl_frame_ = false; 883 inside_impl_frame_ = false;
889 #endif 884 #endif
890 } 885 }
891 886
892 } // namespace cc 887 } // 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