| Index: ppapi/proxy/compositor_layer_resource.cc
|
| diff --git a/ppapi/proxy/compositor_layer_resource.cc b/ppapi/proxy/compositor_layer_resource.cc
|
| index 1ebb534dcfb0dd5b894ce66356e59a254cf0b195..62ef6400207626eef5b1d0b11a09f92bbbede674 100644
|
| --- a/ppapi/proxy/compositor_layer_resource.cc
|
| +++ b/ppapi/proxy/compositor_layer_resource.cc
|
| @@ -7,9 +7,12 @@
|
| namespace ppapi {
|
| namespace proxy {
|
|
|
| -CompositorLayerResource::CompositorLayerResource(Connection connection,
|
| - PP_Instance instance)
|
| - : PluginResource(connection, instance) {
|
| +CompositorLayerResource::CompositorLayerResource(
|
| + Connection connection,
|
| + PP_Instance instance,
|
| + base::WeakPtr<CompositorResource::LayerImpl> impl)
|
| + : PluginResource(connection, instance),
|
| + impl_(impl) {
|
| }
|
|
|
| CompositorLayerResource::~CompositorLayerResource() {
|
| @@ -25,7 +28,9 @@ int32_t CompositorLayerResource::SetColor(uint8_t red,
|
| uint8_t blue,
|
| uint8_t alpha,
|
| const struct PP_Size* size) {
|
| - return PP_ERROR_NOTSUPPORTED;
|
| + if (!impl_)
|
| + return PP_ERROR_BADARGUMENT;
|
| + return impl_->SetColor(red, green, blue, alpha, size);
|
| }
|
|
|
| int32_t CompositorLayerResource::SetTexture(
|
| @@ -33,39 +38,55 @@ int32_t CompositorLayerResource::SetTexture(
|
| uint32_t texture,
|
| const struct PP_Size* size,
|
| const scoped_refptr<ppapi::TrackedCallback>& callback) {
|
| - return PP_ERROR_NOTSUPPORTED;
|
| + if (!impl_)
|
| + return PP_ERROR_BADARGUMENT;
|
| + return impl_->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 (!impl_)
|
| + return PP_ERROR_BADARGUMENT;
|
| + return impl_->SetImage(image_data, size, callback);
|
| }
|
|
|
| int32_t CompositorLayerResource::SetClipRect(const struct PP_Rect* rect) {
|
| - return PP_ERROR_NOTSUPPORTED;
|
| + if (!impl_)
|
| + return PP_ERROR_BADARGUMENT;
|
| + return impl_->SetClipRect(rect);
|
| }
|
|
|
| int32_t CompositorLayerResource::SetTransform(const float matrix[16]) {
|
| - return PP_ERROR_NOTSUPPORTED;
|
| + if (!impl_)
|
| + return PP_ERROR_BADARGUMENT;
|
| + return impl_->SetTransform(matrix);
|
| }
|
|
|
| int32_t CompositorLayerResource::SetOpacity(uint8_t opacity) {
|
| - return PP_ERROR_NOTSUPPORTED;
|
| + if (!impl_)
|
| + return PP_ERROR_BADARGUMENT;
|
| + return impl_->SetOpacity(opacity);
|
| }
|
|
|
| int32_t CompositorLayerResource::SetBlendMode(PP_BlendMode mode) {
|
| - return PP_ERROR_NOTSUPPORTED;
|
| + if (!impl_)
|
| + return PP_ERROR_BADARGUMENT;
|
| + return impl_->SetBlendMode(mode);
|
| }
|
|
|
| int32_t CompositorLayerResource::SetSourceRect(
|
| const struct PP_FloatRect* rect) {
|
| - return PP_ERROR_NOTSUPPORTED;
|
| + if (!impl_)
|
| + return PP_ERROR_BADARGUMENT;
|
| + return impl_->SetSourceRect(rect);
|
| }
|
|
|
| int32_t CompositorLayerResource::SetPremultipliedAlpha(PP_Bool premult) {
|
| - return PP_ERROR_NOTSUPPORTED;
|
| + if (!impl_)
|
| + return PP_ERROR_BADARGUMENT;
|
| + return impl_->SetPremultipliedAlpha(premult);
|
| }
|
|
|
| } // namespace proxy
|
|
|