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

Unified Diff: cc/pinch_zoom_viewport.h

Issue 11958004: Make new-style page scale work on Android. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase to 177887 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
« no previous file with comments | « cc/layer_tree_impl.cc ('k') | cc/pinch_zoom_viewport.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/pinch_zoom_viewport.h
diff --git a/cc/pinch_zoom_viewport.h b/cc/pinch_zoom_viewport.h
index 0b55a3fe97df425ff9806172abb22739a1e92221..9efe38667345bcbece241c50e5f493250ebe1319 100644
--- a/cc/pinch_zoom_viewport.h
+++ b/cc/pinch_zoom_viewport.h
@@ -47,9 +47,10 @@ class CC_EXPORT PinchZoomViewport {
float min_page_scale_factor,
float max_page_scale_factor);
- // Returns the bounds and offset of the scaled and translated viewport to use
- // for pinch-zoom.
- gfx::RectF Bounds() const;
+ // Returns the zoomed viewport in layout space. The rect's position is an
+ // offset from the root layer's scroll position (therefore, zero if fully
+ // zoomed out).
+ gfx::RectF ZoomedViewport() const;
const gfx::Vector2dF& zoomed_viewport_offset() const {
return zoomed_viewport_offset_;
@@ -58,6 +59,12 @@ class CC_EXPORT PinchZoomViewport {
void set_layout_viewport_size(const gfx::SizeF& size) {
layout_viewport_size_ = size;
}
+ // We need to store device_viewport_size separately because in mobile
+ // fixed-layout mode, there is not necessarily a simple mapping between layout
+ // viewport size and device viewport size.
+ void set_device_viewport_size(const gfx::SizeF& size) {
+ device_viewport_size_ = size;
+ }
// Apply the scroll offset in layout space to the offset of the pinch-zoom
// viewport. The viewport cannot be scrolled outside of the layout viewport
@@ -81,6 +88,7 @@ class CC_EXPORT PinchZoomViewport {
gfx::Vector2dF zoomed_viewport_offset_;
gfx::SizeF layout_viewport_size_;
+ gfx::SizeF device_viewport_size_;
};
} // namespace cc
« no previous file with comments | « cc/layer_tree_impl.cc ('k') | cc/pinch_zoom_viewport.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698