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

Side by Side Diff: cc/layers/viewport.cc

Issue 1357423009: gfx: Make conversions from Size to SizeF be explicit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sizefconvert-gfx: . Created 5 years, 2 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/layers/render_surface_impl.cc ('k') | cc/output/gl_renderer.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/layers/viewport.h" 5 #include "cc/layers/viewport.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "cc/input/top_controls_manager.h" 8 #include "cc/input/top_controls_manager.h"
9 #include "cc/trees/layer_tree_host_impl.h" 9 #include "cc/trees/layer_tree_host_impl.h"
10 #include "cc/trees/layer_tree_impl.h" 10 #include "cc/trees/layer_tree_impl.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 viewport_point, 60 viewport_point,
61 is_direct_manipulation); 61 is_direct_manipulation);
62 result.consumed_delta = delta - AdjustOverscroll(pending_content_delta); 62 result.consumed_delta = delta - AdjustOverscroll(pending_content_delta);
63 } 63 }
64 64
65 result.content_scrolled_delta = content_delta - pending_content_delta; 65 result.content_scrolled_delta = content_delta - pending_content_delta;
66 return result; 66 return result;
67 } 67 }
68 68
69 void Viewport::SnapPinchAnchorIfWithinMargin(const gfx::Point& anchor) { 69 void Viewport::SnapPinchAnchorIfWithinMargin(const gfx::Point& anchor) {
70 gfx::SizeF viewport_size = 70 gfx::SizeF viewport_size = gfx::SizeF(
71 host_impl_->active_tree()->InnerViewportContainerLayer()->bounds(); 71 host_impl_->active_tree()->InnerViewportContainerLayer()->bounds());
72 72
73 if (anchor.x() < kPinchZoomSnapMarginDips) 73 if (anchor.x() < kPinchZoomSnapMarginDips)
74 pinch_anchor_adjustment_.set_x(-anchor.x()); 74 pinch_anchor_adjustment_.set_x(-anchor.x());
75 else if (anchor.x() > viewport_size.width() - kPinchZoomSnapMarginDips) 75 else if (anchor.x() > viewport_size.width() - kPinchZoomSnapMarginDips)
76 pinch_anchor_adjustment_.set_x(viewport_size.width() - anchor.x()); 76 pinch_anchor_adjustment_.set_x(viewport_size.width() - anchor.x());
77 77
78 if (anchor.y() < kPinchZoomSnapMarginDips) 78 if (anchor.y() < kPinchZoomSnapMarginDips)
79 pinch_anchor_adjustment_.set_y(-anchor.y()); 79 pinch_anchor_adjustment_.set_y(-anchor.y());
80 else if (anchor.y() > viewport_size.height() - kPinchZoomSnapMarginDips) 80 else if (anchor.y() > viewport_size.height() - kPinchZoomSnapMarginDips)
81 pinch_anchor_adjustment_.set_y(viewport_size.height() - anchor.y()); 81 pinch_anchor_adjustment_.set_y(viewport_size.height() - anchor.y());
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 179
180 LayerImpl* Viewport::InnerScrollLayer() const { 180 LayerImpl* Viewport::InnerScrollLayer() const {
181 return host_impl_->InnerViewportScrollLayer(); 181 return host_impl_->InnerViewportScrollLayer();
182 } 182 }
183 183
184 LayerImpl* Viewport::OuterScrollLayer() const { 184 LayerImpl* Viewport::OuterScrollLayer() const {
185 return host_impl_->OuterViewportScrollLayer(); 185 return host_impl_->OuterViewportScrollLayer();
186 } 186 }
187 187
188 } // namespace cc 188 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/render_surface_impl.cc ('k') | cc/output/gl_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698