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 #include "ppapi/c/pp_errors.h" | 5 #include "ppapi/c/pp_errors.h" |
6 #include "ppapi/c/ppb_image_data.h" | 6 #include "ppapi/c/ppb_image_data.h" |
7 #include "ppapi/shared_impl/ppb_image_data_shared.h" | 7 #include "ppapi/shared_impl/ppb_image_data_shared.h" |
8 #include "ppapi/thunk/enter.h" | 8 #include "ppapi/thunk/enter.h" |
9 #include "ppapi/thunk/ppb_image_data_api.h" | 9 #include "ppapi/thunk/ppb_image_data_api.h" |
10 #include "ppapi/thunk/resource_creation_api.h" | 10 #include "ppapi/thunk/resource_creation_api.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 PP_Bool IsImageDataFormatSupported(PP_ImageDataFormat format) { | 22 PP_Bool IsImageDataFormatSupported(PP_ImageDataFormat format) { |
23 return ppapi::PPB_ImageData_Shared::IsImageDataFormatSupported(format) | 23 return ppapi::PPB_ImageData_Shared::IsImageDataFormatSupported(format) |
24 ? PP_TRUE : PP_FALSE; | 24 ? PP_TRUE : PP_FALSE; |
25 } | 25 } |
26 | 26 |
27 PP_Resource Create(PP_Instance instance, | 27 PP_Resource Create(PP_Instance instance, |
28 PP_ImageDataFormat format, | 28 PP_ImageDataFormat format, |
29 const PP_Size* size, | 29 const PP_Size* size, |
30 PP_Bool init_to_zero) { | 30 PP_Bool init_to_zero) { |
31 EnterFunction<ResourceCreationAPI> enter(instance, true); | 31 EnterResourceCreation enter(instance); |
32 if (enter.failed()) | 32 if (enter.failed()) |
33 return 0; | 33 return 0; |
34 return enter.functions()->CreateImageData(instance, format, | 34 return enter.functions()->CreateImageData(instance, format, |
35 *size, init_to_zero); | 35 *size, init_to_zero); |
36 } | 36 } |
37 | 37 |
38 PP_Bool IsImageData(PP_Resource resource) { | 38 PP_Bool IsImageData(PP_Resource resource) { |
39 EnterResource<PPB_ImageData_API> enter(resource, false); | 39 EnterResource<PPB_ImageData_API> enter(resource, false); |
40 return enter.succeeded() ? PP_TRUE : PP_FALSE; | 40 return enter.succeeded() ? PP_TRUE : PP_FALSE; |
41 } | 41 } |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 }; | 75 }; |
76 | 76 |
77 } // namespace | 77 } // namespace |
78 | 78 |
79 const PPB_ImageData_1_0* GetPPB_ImageData_1_0_Thunk() { | 79 const PPB_ImageData_1_0* GetPPB_ImageData_1_0_Thunk() { |
80 return &g_ppb_image_data_thunk; | 80 return &g_ppb_image_data_thunk; |
81 } | 81 } |
82 | 82 |
83 } // namespace thunk | 83 } // namespace thunk |
84 } // namespace ppapi | 84 } // namespace ppapi |
OLD | NEW |