1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
|
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// From ppb_compositor_layer.idl modified Thu Aug 14 18:06:33 2014.
#include "ppapi/c/pp_completion_callback.h"
#include "ppapi/c/pp_errors.h"
#include "ppapi/c/ppb_compositor_layer.h"
#include "ppapi/shared_impl/tracked_callback.h"
#include "ppapi/thunk/enter.h"
#include "ppapi/thunk/ppapi_thunk_export.h"
#include "ppapi/thunk/ppb_compositor_layer_api.h"
namespace ppapi {
namespace thunk {
namespace {
PP_Bool IsCompositorLayer(PP_Resource resource) {
VLOG(4) << "PPB_CompositorLayer::IsCompositorLayer()";
EnterResource<PPB_CompositorLayer_API> enter(resource, false);
return PP_FromBool(enter.succeeded());
}
int32_t SetColor(PP_Resource layer,
float red,
float green,
float blue,
float alpha,
const struct PP_Size* size) {
VLOG(4) << "PPB_CompositorLayer::SetColor()";
EnterResource<PPB_CompositorLayer_API> enter(layer, true);
if (enter.failed())
return enter.retval();
return enter.object()->SetColor(red, green, blue, alpha, size);
}
int32_t SetTexture_0_1(PP_Resource layer,
PP_Resource context,
uint32_t texture,
const struct PP_Size* size,
struct PP_CompletionCallback cc) {
VLOG(4) << "PPB_CompositorLayer::SetTexture()";
EnterResource<PPB_CompositorLayer_API> enter(layer, cc, true);
if (enter.failed())
return enter.retval();
return enter.SetResult(enter.object()->SetTexture0_1(context,
texture,
size,
enter.callback()));
}
int32_t SetTexture(PP_Resource layer,
PP_Resource context,
uint32_t target,
uint32_t texture,
const struct PP_Size* size,
struct PP_CompletionCallback cc) {
VLOG(4) << "PPB_CompositorLayer::SetTexture()";
EnterResource<PPB_CompositorLayer_API> enter(layer, cc, true);
if (enter.failed())
return enter.retval();
return enter.SetResult(enter.object()->SetTexture(context,
target,
texture,
size,
enter.callback()));
}
int32_t SetImage(PP_Resource layer,
PP_Resource image_data,
const struct PP_Size* size,
struct PP_CompletionCallback cc) {
VLOG(4) << "PPB_CompositorLayer::SetImage()";
EnterResource<PPB_CompositorLayer_API> enter(layer, cc, true);
if (enter.failed())
return enter.retval();
return enter.SetResult(enter.object()->SetImage(image_data,
size,
enter.callback()));
}
int32_t SetClipRect(PP_Resource layer, const struct PP_Rect* rect) {
VLOG(4) << "PPB_CompositorLayer::SetClipRect()";
EnterResource<PPB_CompositorLayer_API> enter(layer, true);
if (enter.failed())
return enter.retval();
return enter.object()->SetClipRect(rect);
}
int32_t SetTransform(PP_Resource layer, const float matrix[16]) {
VLOG(4) << "PPB_CompositorLayer::SetTransform()";
EnterResource<PPB_CompositorLayer_API> enter(layer, true);
if (enter.failed())
return enter.retval();
return enter.object()->SetTransform(matrix);
}
int32_t SetOpacity(PP_Resource layer, float opacity) {
VLOG(4) << "PPB_CompositorLayer::SetOpacity()";
EnterResource<PPB_CompositorLayer_API> enter(layer, true);
if (enter.failed())
return enter.retval();
return enter.object()->SetOpacity(opacity);
}
int32_t SetBlendMode(PP_Resource layer, PP_BlendMode mode) {
VLOG(4) << "PPB_CompositorLayer::SetBlendMode()";
EnterResource<PPB_CompositorLayer_API> enter(layer, true);
if (enter.failed())
return enter.retval();
return enter.object()->SetBlendMode(mode);
}
int32_t SetSourceRect(PP_Resource layer, const struct PP_FloatRect* rect) {
VLOG(4) << "PPB_CompositorLayer::SetSourceRect()";
EnterResource<PPB_CompositorLayer_API> enter(layer, true);
if (enter.failed())
return enter.retval();
return enter.object()->SetSourceRect(rect);
}
int32_t SetPremultipliedAlpha(PP_Resource layer, PP_Bool premult) {
VLOG(4) << "PPB_CompositorLayer::SetPremultipliedAlpha()";
EnterResource<PPB_CompositorLayer_API> enter(layer, true);
if (enter.failed())
return enter.retval();
return enter.object()->SetPremultipliedAlpha(premult);
}
const PPB_CompositorLayer_0_1 g_ppb_compositorlayer_thunk_0_1 = {
&IsCompositorLayer,
&SetColor,
&SetTexture_0_1,
&SetImage,
&SetClipRect,
&SetTransform,
&SetOpacity,
&SetBlendMode,
&SetSourceRect,
&SetPremultipliedAlpha
};
const PPB_CompositorLayer_0_2 g_ppb_compositorlayer_thunk_0_2 = {
&IsCompositorLayer,
&SetColor,
&SetTexture,
&SetImage,
&SetClipRect,
&SetTransform,
&SetOpacity,
&SetBlendMode,
&SetSourceRect,
&SetPremultipliedAlpha
};
} // namespace
PPAPI_THUNK_EXPORT const PPB_CompositorLayer_0_1*
GetPPB_CompositorLayer_0_1_Thunk() {
return &g_ppb_compositorlayer_thunk_0_1;
}
PPAPI_THUNK_EXPORT const PPB_CompositorLayer_0_2*
GetPPB_CompositorLayer_0_2_Thunk() {
return &g_ppb_compositorlayer_thunk_0_2;
}
} // namespace thunk
} // namespace ppapi
|