OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // From ppb_compositor_layer.idl modified Thu Aug 14 18:06:33 2014. | 5 // From ppb_compositor_layer.idl modified Thu Sep 18 11:36:39 2014. |
6 | 6 |
7 #include "ppapi/c/pp_completion_callback.h" | 7 #include "ppapi/c/pp_completion_callback.h" |
8 #include "ppapi/c/pp_errors.h" | 8 #include "ppapi/c/pp_errors.h" |
9 #include "ppapi/c/ppb_compositor_layer.h" | 9 #include "ppapi/c/ppb_compositor_layer.h" |
10 #include "ppapi/shared_impl/tracked_callback.h" | 10 #include "ppapi/shared_impl/tracked_callback.h" |
11 #include "ppapi/thunk/enter.h" | 11 #include "ppapi/thunk/enter.h" |
12 #include "ppapi/thunk/ppapi_thunk_export.h" | 12 #include "ppapi/thunk/ppapi_thunk_export.h" |
13 #include "ppapi/thunk/ppb_compositor_layer_api.h" | 13 #include "ppapi/thunk/ppb_compositor_layer_api.h" |
14 | 14 |
15 namespace ppapi { | 15 namespace ppapi { |
(...skipping 22 matching lines...) Expand all Loading... |
38 | 38 |
39 int32_t SetTexture_0_1(PP_Resource layer, | 39 int32_t SetTexture_0_1(PP_Resource layer, |
40 PP_Resource context, | 40 PP_Resource context, |
41 uint32_t texture, | 41 uint32_t texture, |
42 const struct PP_Size* size, | 42 const struct PP_Size* size, |
43 struct PP_CompletionCallback cc) { | 43 struct PP_CompletionCallback cc) { |
44 VLOG(4) << "PPB_CompositorLayer::SetTexture()"; | 44 VLOG(4) << "PPB_CompositorLayer::SetTexture()"; |
45 EnterResource<PPB_CompositorLayer_API> enter(layer, cc, true); | 45 EnterResource<PPB_CompositorLayer_API> enter(layer, cc, true); |
46 if (enter.failed()) | 46 if (enter.failed()) |
47 return enter.retval(); | 47 return enter.retval(); |
48 return enter.SetResult(enter.object()->SetTexture0_1(context, | 48 return enter.SetResult( |
49 texture, | 49 enter.object()->SetTexture0_1(context, texture, size, enter.callback())); |
50 size, | |
51 enter.callback())); | |
52 } | 50 } |
53 | 51 |
54 int32_t SetTexture(PP_Resource layer, | 52 int32_t SetTexture(PP_Resource layer, |
55 PP_Resource context, | 53 PP_Resource context, |
56 uint32_t target, | 54 uint32_t target, |
57 uint32_t texture, | 55 uint32_t texture, |
58 const struct PP_Size* size, | 56 const struct PP_Size* size, |
59 struct PP_CompletionCallback cc) { | 57 struct PP_CompletionCallback cc) { |
60 VLOG(4) << "PPB_CompositorLayer::SetTexture()"; | 58 VLOG(4) << "PPB_CompositorLayer::SetTexture()"; |
61 EnterResource<PPB_CompositorLayer_API> enter(layer, cc, true); | 59 EnterResource<PPB_CompositorLayer_API> enter(layer, cc, true); |
62 if (enter.failed()) | 60 if (enter.failed()) |
63 return enter.retval(); | 61 return enter.retval(); |
64 return enter.SetResult(enter.object()->SetTexture(context, | 62 return enter.SetResult(enter.object()->SetTexture(context, target, texture, |
65 target, | 63 size, enter.callback())); |
66 texture, | |
67 size, | |
68 enter.callback())); | |
69 } | 64 } |
70 | 65 |
71 int32_t SetImage(PP_Resource layer, | 66 int32_t SetImage(PP_Resource layer, |
72 PP_Resource image_data, | 67 PP_Resource image_data, |
73 const struct PP_Size* size, | 68 const struct PP_Size* size, |
74 struct PP_CompletionCallback cc) { | 69 struct PP_CompletionCallback cc) { |
75 VLOG(4) << "PPB_CompositorLayer::SetImage()"; | 70 VLOG(4) << "PPB_CompositorLayer::SetImage()"; |
76 EnterResource<PPB_CompositorLayer_API> enter(layer, cc, true); | 71 EnterResource<PPB_CompositorLayer_API> enter(layer, cc, true); |
77 if (enter.failed()) | 72 if (enter.failed()) |
78 return enter.retval(); | 73 return enter.retval(); |
79 return enter.SetResult(enter.object()->SetImage(image_data, | 74 return enter.SetResult( |
80 size, | 75 enter.object()->SetImage(image_data, size, enter.callback())); |
81 enter.callback())); | |
82 } | 76 } |
83 | 77 |
84 int32_t SetClipRect(PP_Resource layer, const struct PP_Rect* rect) { | 78 int32_t SetClipRect(PP_Resource layer, const struct PP_Rect* rect) { |
85 VLOG(4) << "PPB_CompositorLayer::SetClipRect()"; | 79 VLOG(4) << "PPB_CompositorLayer::SetClipRect()"; |
86 EnterResource<PPB_CompositorLayer_API> enter(layer, true); | 80 EnterResource<PPB_CompositorLayer_API> enter(layer, true); |
87 if (enter.failed()) | 81 if (enter.failed()) |
88 return enter.retval(); | 82 return enter.retval(); |
89 return enter.object()->SetClipRect(rect); | 83 return enter.object()->SetClipRect(rect); |
90 } | 84 } |
91 | 85 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 117 |
124 int32_t SetPremultipliedAlpha(PP_Resource layer, PP_Bool premult) { | 118 int32_t SetPremultipliedAlpha(PP_Resource layer, PP_Bool premult) { |
125 VLOG(4) << "PPB_CompositorLayer::SetPremultipliedAlpha()"; | 119 VLOG(4) << "PPB_CompositorLayer::SetPremultipliedAlpha()"; |
126 EnterResource<PPB_CompositorLayer_API> enter(layer, true); | 120 EnterResource<PPB_CompositorLayer_API> enter(layer, true); |
127 if (enter.failed()) | 121 if (enter.failed()) |
128 return enter.retval(); | 122 return enter.retval(); |
129 return enter.object()->SetPremultipliedAlpha(premult); | 123 return enter.object()->SetPremultipliedAlpha(premult); |
130 } | 124 } |
131 | 125 |
132 const PPB_CompositorLayer_0_1 g_ppb_compositorlayer_thunk_0_1 = { | 126 const PPB_CompositorLayer_0_1 g_ppb_compositorlayer_thunk_0_1 = { |
133 &IsCompositorLayer, | 127 &IsCompositorLayer, |
134 &SetColor, | 128 &SetColor, |
135 &SetTexture_0_1, | 129 &SetTexture_0_1, |
136 &SetImage, | 130 &SetImage, |
137 &SetClipRect, | 131 &SetClipRect, |
138 &SetTransform, | 132 &SetTransform, |
139 &SetOpacity, | 133 &SetOpacity, |
140 &SetBlendMode, | 134 &SetBlendMode, |
141 &SetSourceRect, | 135 &SetSourceRect, |
142 &SetPremultipliedAlpha | 136 &SetPremultipliedAlpha}; |
143 }; | |
144 | 137 |
145 const PPB_CompositorLayer_0_2 g_ppb_compositorlayer_thunk_0_2 = { | 138 const PPB_CompositorLayer_0_2 g_ppb_compositorlayer_thunk_0_2 = { |
146 &IsCompositorLayer, | 139 &IsCompositorLayer, |
147 &SetColor, | 140 &SetColor, |
148 &SetTexture, | 141 &SetTexture, |
149 &SetImage, | 142 &SetImage, |
150 &SetClipRect, | 143 &SetClipRect, |
151 &SetTransform, | 144 &SetTransform, |
152 &SetOpacity, | 145 &SetOpacity, |
153 &SetBlendMode, | 146 &SetBlendMode, |
154 &SetSourceRect, | 147 &SetSourceRect, |
155 &SetPremultipliedAlpha | 148 &SetPremultipliedAlpha}; |
156 }; | |
157 | 149 |
158 } // namespace | 150 } // namespace |
159 | 151 |
160 PPAPI_THUNK_EXPORT const PPB_CompositorLayer_0_1* | 152 PPAPI_THUNK_EXPORT const PPB_CompositorLayer_0_1* |
161 GetPPB_CompositorLayer_0_1_Thunk() { | 153 GetPPB_CompositorLayer_0_1_Thunk() { |
162 return &g_ppb_compositorlayer_thunk_0_1; | 154 return &g_ppb_compositorlayer_thunk_0_1; |
163 } | 155 } |
164 | 156 |
165 PPAPI_THUNK_EXPORT const PPB_CompositorLayer_0_2* | 157 PPAPI_THUNK_EXPORT const PPB_CompositorLayer_0_2* |
166 GetPPB_CompositorLayer_0_2_Thunk() { | 158 GetPPB_CompositorLayer_0_2_Thunk() { |
167 return &g_ppb_compositorlayer_thunk_0_2; | 159 return &g_ppb_compositorlayer_thunk_0_2; |
168 } | 160 } |
169 | 161 |
170 } // namespace thunk | 162 } // namespace thunk |
171 } // namespace ppapi | 163 } // namespace ppapi |
OLD | NEW |