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 | 5 |
6 /** | 6 /** |
7 * This file defines the <code>PPB_View</code> struct representing the state | 7 * This file defines the <code>PPB_View</code> struct representing the state |
8 * of the view of an instance. | 8 * of the view of an instance. |
9 */ | 9 */ |
10 | 10 |
11 [generate_thunk] | 11 [generate_thunk] |
12 | 12 |
13 label Chrome { | 13 label Chrome { |
14 M18 = 1.0 | 14 M18 = 1.0, |
| 15 M28 = 1.1 |
15 }; | 16 }; |
16 | 17 |
17 /** | 18 /** |
18 * <code>PPB_View</code> represents the state of the view of an instance. | 19 * <code>PPB_View</code> represents the state of the view of an instance. |
19 * You will receive new view information using | 20 * You will receive new view information using |
20 * <code>PPP_Instance.DidChangeView</code>. | 21 * <code>PPP_Instance.DidChangeView</code>. |
21 */ | 22 */ |
22 [macro="PPB_VIEW_INTERFACE"] | 23 [macro="PPB_VIEW_INTERFACE"] |
23 interface PPB_View { | 24 interface PPB_View { |
24 /** | 25 /** |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 * @param resource A <code>PP_Resource</code> corresponding to a | 153 * @param resource A <code>PP_Resource</code> corresponding to a |
153 * <code>PPB_View</code> resource. | 154 * <code>PPB_View</code> resource. |
154 * | 155 * |
155 * @param clip Output argument receiving the clip rect on success. | 156 * @param clip Output argument receiving the clip rect on success. |
156 * | 157 * |
157 * @return Returns <code>PP_TRUE</code> if the resource was valid and the | 158 * @return Returns <code>PP_TRUE</code> if the resource was valid and the |
158 * clip rect was filled in, <code>PP_FALSE</code> if not. | 159 * clip rect was filled in, <code>PP_FALSE</code> if not. |
159 */ | 160 */ |
160 PP_Bool GetClipRect([in] PP_Resource resource, | 161 PP_Bool GetClipRect([in] PP_Resource resource, |
161 [out] PP_Rect clip); | 162 [out] PP_Rect clip); |
| 163 |
| 164 /** |
| 165 * GetDeviceScale returns the scale factor between device pixels and Density |
| 166 * Independent Pixels (DIPs, also known as logical pixels or UI pixels on |
| 167 * some platforms). This allows the developer to render their contents at |
| 168 * device resolution, even as coordinates / sizes are given in DIPs through |
| 169 * the API. |
| 170 * |
| 171 * Note that the coordinate system for Pepper APIs is DIPs. Also note that |
| 172 * one DIP might not equal one CSS pixel - when page scale/zoom is in effect. |
| 173 * |
| 174 * @param[in] resource A <code>PP_Resource</code> corresponding to a |
| 175 * <code>PPB_View</code> resource. |
| 176 * |
| 177 * @return A <code>float</code> value representing the number of device pixels |
| 178 * per DIP. If the resource is invalid, the value will be 0.0. |
| 179 */ |
| 180 [version=1.1] |
| 181 float_t GetDeviceScale([in] PP_Resource resource); |
| 182 |
| 183 /** |
| 184 * GetCSSScale returns the scale factor between DIPs and CSS pixels. This |
| 185 * allows proper scaling between DIPs - as sent via the Pepper API - and CSS |
| 186 * pixel coordinates used for Web content. |
| 187 * |
| 188 * @param[in] resource A <code>PP_Resource</code> corresponding to a |
| 189 * <code>PPB_View</code> resource. |
| 190 * |
| 191 * @return css_scale A <code>float</code> value representing the number of |
| 192 * DIPs per CSS pixel. If the resource is invalid, the value will be 0.0. |
| 193 */ |
| 194 [version=1.1] |
| 195 float_t GetCSSScale([in] PP_Resource resource); |
162 }; | 196 }; |
163 | 197 |
OLD | NEW |