| 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 #ifndef PPAPI_PROXY_COMPOSITOR_LAYER_RESOURCE_H_ | 5 #ifndef PPAPI_PROXY_COMPOSITOR_LAYER_RESOURCE_H_ |
| 6 #define PPAPI_PROXY_COMPOSITOR_LAYER_RESOURCE_H_ | 6 #define PPAPI_PROXY_COMPOSITOR_LAYER_RESOURCE_H_ |
| 7 | 7 |
| 8 #include "ppapi/c/ppb_compositor_layer.h" | 8 #include "ppapi/c/ppb_compositor_layer.h" |
| 9 #include "ppapi/proxy/compositor_resource.h" |
| 9 #include "ppapi/proxy/plugin_resource.h" | 10 #include "ppapi/proxy/plugin_resource.h" |
| 10 #include "ppapi/proxy/ppapi_proxy_export.h" | 11 #include "ppapi/proxy/ppapi_proxy_export.h" |
| 11 #include "ppapi/thunk/ppb_compositor_layer_api.h" | 12 #include "ppapi/thunk/ppb_compositor_layer_api.h" |
| 12 | 13 |
| 13 namespace ppapi { | 14 namespace ppapi { |
| 14 namespace proxy { | 15 namespace proxy { |
| 15 | 16 |
| 16 class PPAPI_PROXY_EXPORT CompositorLayerResource | 17 class PPAPI_PROXY_EXPORT CompositorLayerResource |
| 17 : public PluginResource, | 18 : public PluginResource, |
| 18 public thunk::PPB_CompositorLayer_API { | 19 public thunk::PPB_CompositorLayer_API { |
| 19 public: | 20 public: |
| 20 CompositorLayerResource(Connection connection, | 21 CompositorLayerResource(Connection connection, |
| 21 PP_Instance instance); | 22 PP_Instance instance, |
| 23 base::WeakPtr<CompositorResource::LayerImpl> impl); |
| 22 | 24 |
| 23 private: | 25 private: |
| 24 virtual ~CompositorLayerResource(); | 26 virtual ~CompositorLayerResource(); |
| 25 | 27 |
| 26 // Resource overrides: | 28 // Resource overrides: |
| 27 virtual thunk::PPB_CompositorLayer_API* AsPPB_CompositorLayer_API() OVERRIDE; | 29 virtual thunk::PPB_CompositorLayer_API* AsPPB_CompositorLayer_API() OVERRIDE; |
| 28 | 30 |
| 29 // thunk::PPB_Compositor_API overrides: | 31 // thunk::PPB_Compositor_API overrides: |
| 30 virtual int32_t SetColor(uint8_t red, | 32 virtual int32_t SetColor(uint8_t red, |
| 31 uint8_t green, | 33 uint8_t green, |
| 32 uint8_t blue, | 34 uint8_t blue, |
| 33 uint8_t alpha, | 35 uint8_t alpha, |
| 34 const struct PP_Size* size) OVERRIDE; | 36 const struct PP_Size* size) OVERRIDE; |
| 35 virtual int32_t SetTexture( | 37 virtual int32_t SetTexture( |
| 36 PP_Resource context, | 38 PP_Resource context, |
| 37 uint32_t texture, | 39 uint32_t texture, |
| 38 const struct PP_Size* size, | 40 const struct PP_Size* size, |
| 39 const scoped_refptr<ppapi::TrackedCallback>& callback) OVERRIDE; | 41 const scoped_refptr<ppapi::TrackedCallback>& callback) OVERRIDE; |
| 40 virtual int32_t SetImage( | 42 virtual int32_t SetImage( |
| 41 PP_Resource image_data, | 43 PP_Resource image_data, |
| 42 const struct PP_Size* size, | 44 const struct PP_Size* size, |
| 43 const scoped_refptr<ppapi::TrackedCallback>& callback) OVERRIDE; | 45 const scoped_refptr<ppapi::TrackedCallback>& callback) OVERRIDE; |
| 44 virtual int32_t SetClipRect(const struct PP_Rect* rect) OVERRIDE; | 46 virtual int32_t SetClipRect(const struct PP_Rect* rect) OVERRIDE; |
| 45 virtual int32_t SetTransform(const float matrix[16]) OVERRIDE; | 47 virtual int32_t SetTransform(const float matrix[16]) OVERRIDE; |
| 46 virtual int32_t SetOpacity(uint8_t opacity) OVERRIDE; | 48 virtual int32_t SetOpacity(uint8_t opacity) OVERRIDE; |
| 47 virtual int32_t SetBlendMode(PP_BlendMode mode) OVERRIDE; | 49 virtual int32_t SetBlendMode(PP_BlendMode mode) OVERRIDE; |
| 48 virtual int32_t SetSourceRect(const struct PP_FloatRect* rect) OVERRIDE; | 50 virtual int32_t SetSourceRect(const struct PP_FloatRect* rect) OVERRIDE; |
| 49 virtual int32_t SetPremultipliedAlpha(PP_Bool premult) OVERRIDE; | 51 virtual int32_t SetPremultipliedAlpha(PP_Bool premult) OVERRIDE; |
| 50 | 52 |
| 53 base::WeakPtr<CompositorResource::LayerImpl> impl_; |
| 54 |
| 51 DISALLOW_COPY_AND_ASSIGN(CompositorLayerResource); | 55 DISALLOW_COPY_AND_ASSIGN(CompositorLayerResource); |
| 52 }; | 56 }; |
| 53 | 57 |
| 54 } // namespace proxy | 58 } // namespace proxy |
| 55 } // namespace ppapi | 59 } // namespace ppapi |
| 56 | 60 |
| 57 #endif // PPAPI_PROXY_COMPOSITOR_LAYER_RESOURCE_H_ | 61 #endif // PPAPI_PROXY_COMPOSITOR_LAYER_RESOURCE_H_ |
| OLD | NEW |