| Index: ppapi/proxy/compositor_layer_resource.cc
|
| diff --git a/ppapi/proxy/compositor_layer_resource.cc b/ppapi/proxy/compositor_layer_resource.cc
|
| index 1aadb84db08f4ad6621572447dbec879875ed613..8c76c19a4228cc1f521f0f8eb1128701bff98307 100644
|
| --- a/ppapi/proxy/compositor_layer_resource.cc
|
| +++ b/ppapi/proxy/compositor_layer_resource.cc
|
| @@ -21,9 +21,12 @@ using ppapi::thunk::PPB_Graphics3D_API;
|
| namespace ppapi {
|
| namespace proxy {
|
|
|
| -CompositorLayerResource::CompositorLayerResource(Connection connection,
|
| - PP_Instance instance)
|
| - : PluginResource(connection, instance) {
|
| +CompositorLayerResource::CompositorLayerResource(
|
| + Connection connection,
|
| + PP_Instance instance,
|
| + base::WeakPtr<CompositorResource::Layer> layer)
|
| + : PluginResource(connection, instance),
|
| + layer_(layer) {
|
| }
|
|
|
| CompositorLayerResource::~CompositorLayerResource() {
|
| @@ -39,7 +42,9 @@ int32_t CompositorLayerResource::SetColor(uint8_t red,
|
| uint8_t blue,
|
| uint8_t alpha,
|
| const struct PP_Size* size) {
|
| - return PP_ERROR_NOTSUPPORTED;
|
| + if (!layer_)
|
| + return PP_ERROR_BADARGUMENT;
|
| + return layer_->SetColor(red, green, blue, alpha, size);
|
| }
|
|
|
| int32_t CompositorLayerResource::SetTexture(
|
| @@ -47,39 +52,55 @@ int32_t CompositorLayerResource::SetTexture(
|
| uint32_t texture,
|
| const struct PP_Size* size,
|
| const scoped_refptr<ppapi::TrackedCallback>& callback) {
|
| - return PP_ERROR_NOTSUPPORTED;
|
| + if (!layer_)
|
| + return PP_ERROR_BADARGUMENT;
|
| + return layer_->SetTexture(context, texture, size, callback);
|
| }
|
|
|
| int32_t CompositorLayerResource::SetImage(
|
| PP_Resource image_data,
|
| const struct PP_Size* size,
|
| const scoped_refptr<ppapi::TrackedCallback>& callback) {
|
| - return PP_ERROR_NOTSUPPORTED;
|
| + if (!layer_)
|
| + return PP_ERROR_BADARGUMENT;
|
| + return layer_->SetImage(image_data, size, callback);
|
| }
|
|
|
| int32_t CompositorLayerResource::SetClipRect(const struct PP_Rect* rect) {
|
| - return PP_ERROR_NOTSUPPORTED;
|
| + if (!layer_)
|
| + return PP_ERROR_BADARGUMENT;
|
| + return layer_->SetClipRect(rect);
|
| }
|
|
|
| int32_t CompositorLayerResource::SetTransform(const float matrix[16]) {
|
| - return PP_ERROR_NOTSUPPORTED;
|
| + if (!layer_)
|
| + return PP_ERROR_BADARGUMENT;
|
| + return layer_->SetTransform(matrix);
|
| }
|
|
|
| int32_t CompositorLayerResource::SetOpacity(uint8_t opacity) {
|
| - return PP_ERROR_NOTSUPPORTED;
|
| + if (!layer_)
|
| + return PP_ERROR_BADARGUMENT;
|
| + return layer_->SetOpacity(opacity);
|
| }
|
|
|
| int32_t CompositorLayerResource::SetBlendMode(PP_BlendMode mode) {
|
| - return PP_ERROR_NOTSUPPORTED;
|
| + if (!layer_)
|
| + return PP_ERROR_BADARGUMENT;
|
| + return layer_->SetBlendMode(mode);
|
| }
|
|
|
| int32_t CompositorLayerResource::SetSourceRect(
|
| const struct PP_FloatRect* rect) {
|
| - return PP_ERROR_NOTSUPPORTED;
|
| + if (!layer_)
|
| + return PP_ERROR_BADARGUMENT;
|
| + return layer_->SetSourceRect(rect);
|
| }
|
|
|
| int32_t CompositorLayerResource::SetPremultipliedAlpha(PP_Bool premult) {
|
| - return PP_ERROR_NOTSUPPORTED;
|
| + if (!layer_)
|
| + return PP_ERROR_BADARGUMENT;
|
| + return layer_->SetPremultipliedAlpha(premult);
|
| }
|
|
|
| } // namespace proxy
|
|
|