Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Side by Side Diff: ppapi/proxy/compositor_layer_resource.h

Issue 298023004: [PPAPI] Compositor API implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@compositor_api_def_new
Patch Set: Update Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <map> 8 #include <map>
9 #include <vector> 9 #include <vector>
10 10
11 #include "ppapi/c/ppb_compositor_layer.h" 11 #include "ppapi/c/ppb_compositor_layer.h"
12 #include "ppapi/proxy/compositor_resource.h"
12 #include "ppapi/proxy/plugin_resource.h" 13 #include "ppapi/proxy/plugin_resource.h"
13 #include "ppapi/proxy/ppapi_proxy_export.h" 14 #include "ppapi/proxy/ppapi_proxy_export.h"
14 #include "ppapi/thunk/ppb_compositor_layer_api.h" 15 #include "ppapi/thunk/ppb_compositor_layer_api.h"
15 16
16 namespace ppapi { 17 namespace ppapi {
17 namespace proxy { 18 namespace proxy {
18 19
19 class PPAPI_PROXY_EXPORT CompositorLayerResource 20 class PPAPI_PROXY_EXPORT CompositorLayerResource
20 : public PluginResource, 21 : public PluginResource,
21 public thunk::PPB_CompositorLayer_API { 22 public thunk::PPB_CompositorLayer_API {
22 public: 23 public:
23 CompositorLayerResource(Connection connection, 24 CompositorLayerResource(Connection connection,
24 PP_Instance instance); 25 PP_Instance instance,
26 base::WeakPtr<CompositorResource::Layer> layer);
25 27
26 private: 28 private:
27 virtual ~CompositorLayerResource(); 29 virtual ~CompositorLayerResource();
28 30
29 // Resource overrides: 31 // Resource overrides:
30 virtual thunk::PPB_CompositorLayer_API* AsPPB_CompositorLayer_API() OVERRIDE; 32 virtual thunk::PPB_CompositorLayer_API* AsPPB_CompositorLayer_API() OVERRIDE;
31 33
32 // thunk::PPB_Compositor_API overrides: 34 // thunk::PPB_Compositor_API overrides:
33 virtual int32_t SetColor(uint8_t red, 35 virtual int32_t SetColor(uint8_t red,
34 uint8_t green, 36 uint8_t green,
35 uint8_t blue, 37 uint8_t blue,
36 uint8_t alpha, 38 uint8_t alpha,
37 const struct PP_Size* size) OVERRIDE; 39 const struct PP_Size* size) OVERRIDE;
38 virtual int32_t SetTexture( 40 virtual int32_t SetTexture(
39 PP_Resource context, 41 PP_Resource context,
40 uint32_t texture, 42 uint32_t texture,
41 const struct PP_Size* size, 43 const struct PP_Size* size,
42 const scoped_refptr<ppapi::TrackedCallback>& callback) OVERRIDE; 44 const scoped_refptr<ppapi::TrackedCallback>& callback) OVERRIDE;
43 virtual int32_t SetImage( 45 virtual int32_t SetImage(
44 PP_Resource image_data, 46 PP_Resource image_data,
45 const struct PP_Size* size, 47 const struct PP_Size* size,
46 const scoped_refptr<ppapi::TrackedCallback>& callback) OVERRIDE; 48 const scoped_refptr<ppapi::TrackedCallback>& callback) OVERRIDE;
47 virtual int32_t SetClipRect(const struct PP_Rect* rect) OVERRIDE; 49 virtual int32_t SetClipRect(const struct PP_Rect* rect) OVERRIDE;
48 virtual int32_t SetTransform(const float matrix[16]) OVERRIDE; 50 virtual int32_t SetTransform(const float matrix[16]) OVERRIDE;
49 virtual int32_t SetOpacity(uint8_t opacity) OVERRIDE; 51 virtual int32_t SetOpacity(uint8_t opacity) OVERRIDE;
50 virtual int32_t SetBlendMode(PP_BlendMode mode) OVERRIDE; 52 virtual int32_t SetBlendMode(PP_BlendMode mode) OVERRIDE;
51 virtual int32_t SetSourceRect(const struct PP_FloatRect* rect) OVERRIDE; 53 virtual int32_t SetSourceRect(const struct PP_FloatRect* rect) OVERRIDE;
52 virtual int32_t SetPremultipliedAlpha(PP_Bool premult) OVERRIDE; 54 virtual int32_t SetPremultipliedAlpha(PP_Bool premult) OVERRIDE;
53 55
56 base::WeakPtr<CompositorResource::Layer> layer_;
57
54 DISALLOW_COPY_AND_ASSIGN(CompositorLayerResource); 58 DISALLOW_COPY_AND_ASSIGN(CompositorLayerResource);
55 }; 59 };
56 60
57 } // namespace proxy 61 } // namespace proxy
58 } // namespace ppapi 62 } // namespace ppapi
59 63
60 #endif // PPAPI_PROXY_COMPOSITOR_LAYER_RESOURCE_H_ 64 #endif // PPAPI_PROXY_COMPOSITOR_LAYER_RESOURCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698