- add sources.
[platform/framework/web/crosswalk.git] / src / ppapi / api / dev / ppb_graphics_2d_dev.idl
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
6 /* This file contains the <code>PPB_Graphics2D_Dev</code> interface. */
7
8 [generate_thunk]
9
10 label Chrome {
11   M22 = 0.1
12 };
13
14 /* PPB_Graphics2D_Dev interface */
15 interface PPB_Graphics2D_Dev {
16   /**
17    * SetScale() sets the scale factor that will be applied when painting the
18    * graphics context onto the output device. Typically, if rendering at device
19    * resolution is desired, the context would be created with the width and
20    * height scaled up by the view's GetDeviceScale and SetScale called with a
21    * scale of 1.0 / GetDeviceScale(). For example, if the view resource passed
22    * to DidChangeView has a rectangle of (w=200, h=100) and a device scale of
23    * 2.0, one would call Create with a size of (w=400, h=200) and then call
24    * SetScale with 0.5. One would then treat each pixel in the context as a
25    * single device pixel.
26    *
27    * @param[in] resource A <code>Graphics2D</code> context resource. 
28    * @param[in] scale The scale to apply when painting.
29    *
30    * @return Returns <code>PP_TRUE</code> on success or <code>PP_FALSE</code> if
31    * the resource is invalid or the scale factor is 0 or less.
32    */
33   PP_Bool SetScale(
34       [in] PP_Resource resource,
35       [in] float_t scale);
36
37   /***
38    * GetScale() gets the scale factor that will be applied when painting the
39    * graphics context onto the output device.
40    *
41    * @param[in] resource A <code>Graphics2D</code> context resource.
42    *
43    * @return Returns the scale factor for the graphics context. If the resource
44    * is not a valid <code>Graphics2D</code> context, this will return 0.0.
45    */
46   float_t GetScale(
47       [in] PP_Resource resource);
48 }; 
49