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

Side by Side Diff: ppapi/cpp/private/view_private.h

Issue 10544168: Implement HiDPI support in Pepper dev interface (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef PPAPI_CPP_PRIVATE_VIEW_PRIVATE_H_
6 #define PPAPI_CPP_PRIVATE_VIEW_PRIVATE_H_
7
8 #include "ppapi/cpp/view.h"
9
10 namespace pp {
11
12 // ViewPrivate is a version of View that exposes private APIs related to HiDPI
13 class ViewPrivate : public View {
14 public:
15 ViewPrivate() : View() {}
16 ViewPrivate(const View& other) : View(other) {}
17
18 virtual ~ViewPrivate() {}
19
20 /// GetDeviceScale returns the scale factor between device pixels and DIPs
21 /// (also known as logical pixels or UI pixels on some platforms). This allows
22 /// the developer to render their contents at device resolution, even as
23 /// coordinates / sizes are given in DIPs through the API.
24 ///
25 /// Note that the coordinate system for Pepper APIs is DIPs. Also note that
26 /// one DIP might not equal one CSS pixel - when page scale/zoom is in effect.
27 ///
28 /// @param[in] resource A <code>PP_Resource</code> corresponding to a
29 /// <code>PPB_View</code> resource.
30 ///
31 /// @return A <code>float</code> value representing the number of device
32 /// pixels per DIP.
33 float GetDeviceScale() const;
34
35 /// GetCSSScale returns the scale factor between DIPs and CSS pixels. This
36 /// allows proper scaling between DIPs - as sent via the Pepper API - and CSS
37 /// pixel coordinates used for Web content.
38 ///
39 /// @param[in] resource A <code>PP_Resource</code> corresponding to a
40 /// <code>PPB_View</code> resource.
41 ///
42 /// @return A <code>float</code> value representing the number of DIPs per CSS
43 /// pixel.
44 float GetCSSScale() const;
45 };
46
47 } // namespace pp
48
49 #endif // PPAPI_CPP_PRIVATE_VIEW_PRIVATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698