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

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

Issue 870363005: Remove scroll_delta flooring hack (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 10 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_common.h ('k') | cc/trees/layer_tree_host_impl_unittest.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 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/layer_tree_host_impl.h" 5 #include "cc/trees/layer_tree_host_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 2990 matching lines...) Expand 10 before | Expand all | Expand 10 after
3001 static void CollectScrollDeltas(ScrollAndScaleSet* scroll_info, 3001 static void CollectScrollDeltas(ScrollAndScaleSet* scroll_info,
3002 LayerImpl* layer_impl) { 3002 LayerImpl* layer_impl) {
3003 if (!layer_impl) 3003 if (!layer_impl)
3004 return; 3004 return;
3005 3005
3006 gfx::ScrollOffset scroll_delta = layer_impl->PullDeltaForMainThread(); 3006 gfx::ScrollOffset scroll_delta = layer_impl->PullDeltaForMainThread();
3007 3007
3008 if (!scroll_delta.IsZero()) { 3008 if (!scroll_delta.IsZero()) {
3009 LayerTreeHostCommon::ScrollUpdateInfo scroll; 3009 LayerTreeHostCommon::ScrollUpdateInfo scroll;
3010 scroll.layer_id = layer_impl->id(); 3010 scroll.layer_id = layer_impl->id();
3011 scroll.scroll_delta = gfx::Vector2d(scroll_delta.x(), scroll_delta.y()); 3011 scroll.scroll_delta = gfx::Vector2dF(scroll_delta.x(), scroll_delta.y());
3012 scroll_info->scrolls.push_back(scroll); 3012 scroll_info->scrolls.push_back(scroll);
3013 } 3013 }
3014 3014
3015 for (size_t i = 0; i < layer_impl->children().size(); ++i) 3015 for (size_t i = 0; i < layer_impl->children().size(); ++i)
3016 CollectScrollDeltas(scroll_info, layer_impl->children()[i]); 3016 CollectScrollDeltas(scroll_info, layer_impl->children()[i]);
3017 } 3017 }
3018 3018
3019 scoped_ptr<ScrollAndScaleSet> LayerTreeHostImpl::ProcessScrollDeltas() { 3019 scoped_ptr<ScrollAndScaleSet> LayerTreeHostImpl::ProcessScrollDeltas() {
3020 scoped_ptr<ScrollAndScaleSet> scroll_info(new ScrollAndScaleSet()); 3020 scoped_ptr<ScrollAndScaleSet> scroll_info(new ScrollAndScaleSet());
3021 3021
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
3479 } 3479 }
3480 3480
3481 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { 3481 void LayerTreeHostImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) {
3482 std::vector<PictureLayerImpl*>::iterator it = 3482 std::vector<PictureLayerImpl*>::iterator it =
3483 std::find(picture_layers_.begin(), picture_layers_.end(), layer); 3483 std::find(picture_layers_.begin(), picture_layers_.end(), layer);
3484 DCHECK(it != picture_layers_.end()); 3484 DCHECK(it != picture_layers_.end());
3485 picture_layers_.erase(it); 3485 picture_layers_.erase(it);
3486 } 3486 }
3487 3487
3488 } // namespace cc 3488 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_common.h ('k') | cc/trees/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698