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

Unified Diff: ppapi/cpp/view.h

Issue 12989006: Move HiDPI-related Pepper interfaces to stable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Clarify header. Change glue to try 1_1 first then fallback to 1_0 for all methods. Created 7 years, 8 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: ppapi/cpp/view.h
diff --git a/ppapi/cpp/view.h b/ppapi/cpp/view.h
index 4494edd732c8529f2a01f66dd52ee15cf0dc1870..7ffd1682294412468009cd0d1144dae70df018f7 100644
--- a/ppapi/cpp/view.h
+++ b/ppapi/cpp/view.h
@@ -118,6 +118,26 @@ class View : public Resource {
/// @return The rectangle representing the visible part of the module
/// instance. If the resource is invalid, the empty rectangle is returned.
Rect GetClipRect() const;
+
+ /// GetDeviceScale returns the scale factor between device pixels and DIPs
+ /// (also known as logical pixels or UI pixels on some platforms). This allows
+ /// the developer to render their contents at device resolution, even as
+ /// coordinates / sizes are given in DIPs through the API.
+ ///
+ /// Note that the coordinate system for Pepper APIs is DIPs. Also note that
+ /// one DIP might not equal one CSS pixel - when page scale/zoom is in effect.
+ ///
+ /// @return A <code>float</code> value representing the number of device
+ /// pixels per DIP.
+ float GetDeviceScale() const;
+
+ /// GetCSSScale returns the scale factor between DIPs and CSS pixels. This
+ /// allows proper scaling between DIPs - as sent via the Pepper API - and CSS
+ /// pixel coordinates used for Web content.
+ ///
+ /// @return A <code>float</code> value representing the number of DIPs per CSS
+ /// pixel.
+ float GetCSSScale() const;
};
} // namespace pp
« no previous file with comments | « ppapi/cpp/graphics_2d.cc ('k') | ppapi/cpp/view.cc » ('j') | ppapi/cpp/view.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698