OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef PPAPI_CPP_VIEW_H_ | 5 #ifndef PPAPI_CPP_VIEW_H_ |
6 #define PPAPI_CPP_VIEW_H_ | 6 #define PPAPI_CPP_VIEW_H_ |
7 | 7 |
8 #include "ppapi/cpp/resource.h" | 8 #include "ppapi/cpp/resource.h" |
9 #include "ppapi/cpp/rect.h" | 9 #include "ppapi/cpp/rect.h" |
10 #include "ppapi/cpp/size.h" | 10 #include "ppapi/cpp/size.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 /// application generates new content with the new clip. This may cause | 111 /// application generates new content with the new clip. This may cause |
112 /// flickering at the boundaries when scrolling. If you do choose to do | 112 /// flickering at the boundaries when scrolling. If you do choose to do |
113 /// partial updates, you may want to think about what color the invisible | 113 /// partial updates, you may want to think about what color the invisible |
114 /// portions of your backing store contain (be it transparent or some | 114 /// portions of your backing store contain (be it transparent or some |
115 /// background color) or to paint a certain region outside the clip to reduce | 115 /// background color) or to paint a certain region outside the clip to reduce |
116 /// the visual distraction when this happens. | 116 /// the visual distraction when this happens. |
117 /// | 117 /// |
118 /// @return The rectangle representing the visible part of the module | 118 /// @return The rectangle representing the visible part of the module |
119 /// instance. If the resource is invalid, the empty rectangle is returned. | 119 /// instance. If the resource is invalid, the empty rectangle is returned. |
120 Rect GetClipRect() const; | 120 Rect GetClipRect() const; |
| 121 |
| 122 /// GetDeviceScale returns the scale factor between device pixels and DIPs |
| 123 /// (also known as logical pixels or UI pixels on some platforms). This allows |
| 124 /// the developer to render their contents at device resolution, even as |
| 125 /// coordinates / sizes are given in DIPs through the API. |
| 126 /// |
| 127 /// Note that the coordinate system for Pepper APIs is DIPs. Also note that |
| 128 /// one DIP might not equal one CSS pixel - when page scale/zoom is in effect. |
| 129 /// |
| 130 /// @return A <code>float</code> value representing the number of device |
| 131 /// pixels per DIP. |
| 132 float GetDeviceScale() const; |
| 133 |
| 134 /// GetCSSScale returns the scale factor between DIPs and CSS pixels. This |
| 135 /// allows proper scaling between DIPs - as sent via the Pepper API - and CSS |
| 136 /// pixel coordinates used for Web content. |
| 137 /// |
| 138 /// @return A <code>float</code> value representing the number of DIPs per CSS |
| 139 /// pixel. |
| 140 float GetCSSScale() const; |
121 }; | 141 }; |
122 | 142 |
123 } // namespace pp | 143 } // namespace pp |
124 | 144 |
125 #endif // PPAPI_CPP_VIEW_H_ | 145 #endif // PPAPI_CPP_VIEW_H_ |
OLD | NEW |