OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_THUNK_RESOURCE_CREATION_API_H_ | 5 #ifndef PPAPI_THUNK_RESOURCE_CREATION_API_H_ |
6 #define PPAPI_THUNK_RESOURCE_CREATION_API_H_ | 6 #define PPAPI_THUNK_RESOURCE_CREATION_API_H_ |
7 | 7 |
8 #include "ppapi/c/pp_bool.h" | 8 #include "ppapi/c/pp_bool.h" |
9 #include "ppapi/c/pp_instance.h" | 9 #include "ppapi/c/pp_instance.h" |
10 #include "ppapi/c/pp_resource.h" | 10 #include "ppapi/c/pp_resource.h" |
11 #include "ppapi/c/ppb_image_data.h" | 11 #include "ppapi/c/ppb_image_data.h" |
12 #include "ppapi/proxy/interface_id.h" | 12 #include "ppapi/proxy/interface_id.h" |
13 | 13 |
| 14 struct PP_FontDescription_Dev; |
14 struct PP_Size; | 15 struct PP_Size; |
15 | 16 |
16 namespace ppapi { | 17 namespace ppapi { |
17 namespace thunk { | 18 namespace thunk { |
18 | 19 |
19 // A functional API for creating resource types. Separating out the creation | 20 // A functional API for creating resource types. Separating out the creation |
20 // functions here allows us to implement most resources as a pure "resource | 21 // functions here allows us to implement most resources as a pure "resource |
21 // API", meaning all calls are routed on a per-resource-object basis. The | 22 // API", meaning all calls are routed on a per-resource-object basis. The |
22 // creationg functions are not per-object (since there's no object during | 23 // creationg functions are not per-object (since there's no object during |
23 // creation) so need functional routing based on the instance ID. | 24 // creation) so need functional routing based on the instance ID. |
24 class ResourceCreationAPI { | 25 class ResourceCreationAPI { |
25 public: | 26 public: |
26 static const ::pp::proxy::InterfaceID interface_id = | 27 static const ::pp::proxy::InterfaceID interface_id = |
27 ::pp::proxy::INTERFACE_ID_RESOURCE_CREATION; | 28 ::pp::proxy::INTERFACE_ID_RESOURCE_CREATION; |
28 | 29 |
| 30 // Note: can't be called CreateFont due to Windows #defines. |
| 31 virtual PP_Resource CreateFontObject( |
| 32 PP_Instance instance, |
| 33 const PP_FontDescription_Dev* description) = 0; |
29 virtual PP_Resource CreateGraphics2D(PP_Instance instance, | 34 virtual PP_Resource CreateGraphics2D(PP_Instance instance, |
30 const PP_Size& size, | 35 const PP_Size& size, |
31 PP_Bool is_always_opaque) = 0; | 36 PP_Bool is_always_opaque) = 0; |
32 virtual PP_Resource CreateImageData(PP_Instance instance, | 37 virtual PP_Resource CreateImageData(PP_Instance instance, |
33 PP_ImageDataFormat format, | 38 PP_ImageDataFormat format, |
34 const PP_Size& size, | 39 const PP_Size& size, |
35 PP_Bool init_to_zero) = 0; | 40 PP_Bool init_to_zero) = 0; |
36 }; | 41 }; |
37 | 42 |
38 } // namespace thunk | 43 } // namespace thunk |
39 } // namespace ppapi | 44 } // namespace ppapi |
40 | 45 |
41 #endif // PPAPI_THUNK_RESOURCE_CREATION_API_H_ | 46 #endif // PPAPI_THUNK_RESOURCE_CREATION_API_H_ |
OLD | NEW |