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

Unified Diff: cc/pinch_zoom_viewport.cc

Issue 11958004: Make new-style page scale work on Android. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Delete maxScrollOffsetChangedByDeviceScaleFactor test Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: cc/pinch_zoom_viewport.cc
diff --git a/cc/pinch_zoom_viewport.cc b/cc/pinch_zoom_viewport.cc
index dab6c9ca823cc57b18ef53eb3c503f41a5948813..723cc64814e5ea08055c120473a84fd9cfc859ad 100644
--- a/cc/pinch_zoom_viewport.cc
+++ b/cc/pinch_zoom_viewport.cc
@@ -50,16 +50,15 @@ bool PinchZoomViewport::SetPageScaleFactorAndLimits(
return true;
}
-gfx::RectF PinchZoomViewport::Bounds() const {
- gfx::RectF bounds(gfx::PointF(), layout_viewport_size_);
- bounds.Scale(1 / total_page_scale_factor());
- bounds += zoomed_viewport_offset_;
- return bounds;
+gfx::RectF PinchZoomViewport::ZoomedViewport() const {
danakj 2013/01/17 18:02:49 80 cols in this file
+ gfx::SizeF dip_viewport_size = gfx::ScaleSize(device_viewport_size_, 1 / device_scale_factor_);
danakj 2013/01/17 18:02:49 Can we not introduce "dip" in the compositor? I fi
aelias_OOO_until_Jul13 2013/01/17 19:59:46 I interpret "DIP" to specifically mean physical pi
+ gfx::SizeF layer_space_viewport_size = gfx::ScaleSize(dip_viewport_size, 1 / total_page_scale_factor());
danakj 2013/01/17 18:02:49 which layer does layer_space refer to? is this the
wjmaclean 2013/01/17 19:45:52 Should it perhaps be "layout_space_viewport_size"?
aelias_OOO_until_Jul13 2013/01/17 19:59:46 OK, renamed to "layout_space_device_viewport_size"
+ return gfx::RectF(gfx::PointAtOffsetFromOrigin(zoomed_viewport_offset_), layer_space_viewport_size);
}
gfx::Vector2dF PinchZoomViewport::ApplyScroll(const gfx::Vector2dF delta) {
gfx::Vector2dF overflow;
- gfx::RectF pinched_bounds = Bounds() + delta;
+ gfx::RectF pinched_bounds = ZoomedViewport() + delta;
if (pinched_bounds.x() < 0) {
overflow.set_x(pinched_bounds.x());

Powered by Google App Engine
This is Rietveld 408576698