OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_RENDERER_PEPPER_PEPPER_GRAPHICS_2D_HOST_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_GRAPHICS_2D_HOST_H_ |
6 #define CONTENT_RENDERER_PEPPER_PEPPER_GRAPHICS_2D_HOST_H_ | 6 #define CONTENT_RENDERER_PEPPER_PEPPER_GRAPHICS_2D_HOST_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 namespace content { | 29 namespace content { |
30 | 30 |
31 class PepperPluginInstanceImpl; | 31 class PepperPluginInstanceImpl; |
32 class PPB_ImageData_Impl; | 32 class PPB_ImageData_Impl; |
33 class RendererPpapiHost; | 33 class RendererPpapiHost; |
34 | 34 |
35 class CONTENT_EXPORT PepperGraphics2DHost | 35 class CONTENT_EXPORT PepperGraphics2DHost |
36 : public ppapi::host::ResourceHost, | 36 : public ppapi::host::ResourceHost, |
37 public base::SupportsWeakPtr<PepperGraphics2DHost> { | 37 public base::SupportsWeakPtr<PepperGraphics2DHost> { |
38 public: | 38 public: |
39 static PepperGraphics2DHost* Create(RendererPpapiHost* host, | 39 static PepperGraphics2DHost* Create( |
40 PP_Instance instance, | 40 RendererPpapiHost* host, |
41 PP_Resource resource, | 41 PP_Instance instance, |
42 const PP_Size& size, | 42 PP_Resource resource, |
43 PP_Bool is_always_opaque); | 43 const PP_Size& size, |
| 44 PP_Bool is_always_opaque, |
| 45 scoped_refptr<PPB_ImageData_Impl> backing_store); |
44 | 46 |
45 virtual ~PepperGraphics2DHost(); | 47 virtual ~PepperGraphics2DHost(); |
46 | 48 |
47 // ppapi::host::ResourceHost override. | 49 // ppapi::host::ResourceHost override. |
48 virtual int32_t OnResourceMessageReceived( | 50 virtual int32_t OnResourceMessageReceived( |
49 const IPC::Message& msg, | 51 const IPC::Message& msg, |
50 ppapi::host::HostMessageContext* context) OVERRIDE; | 52 ppapi::host::HostMessageContext* context) OVERRIDE; |
51 virtual bool IsGraphics2DHost() OVERRIDE; | 53 virtual bool IsGraphics2DHost() OVERRIDE; |
52 | 54 |
53 bool ReadImageData(PP_Resource image, | 55 bool ReadImageData(PP_Resource image, |
(...skipping 21 matching lines...) Expand all Loading... |
75 void SetScale(float scale); | 77 void SetScale(float scale); |
76 float GetScale() const; | 78 float GetScale() const; |
77 bool IsAlwaysOpaque() const; | 79 bool IsAlwaysOpaque() const; |
78 PPB_ImageData_Impl* ImageData(); | 80 PPB_ImageData_Impl* ImageData(); |
79 | 81 |
80 private: | 82 private: |
81 PepperGraphics2DHost(RendererPpapiHost* host, | 83 PepperGraphics2DHost(RendererPpapiHost* host, |
82 PP_Instance instance, | 84 PP_Instance instance, |
83 PP_Resource resource); | 85 PP_Resource resource); |
84 | 86 |
85 bool Init(int width, int height, bool is_always_opaque); | 87 bool Init(int width, |
| 88 int height, |
| 89 bool is_always_opaque, |
| 90 scoped_refptr<PPB_ImageData_Impl> backing_store); |
86 | 91 |
87 int32_t OnHostMsgPaintImageData(ppapi::host::HostMessageContext* context, | 92 int32_t OnHostMsgPaintImageData(ppapi::host::HostMessageContext* context, |
88 const ppapi::HostResource& image_data, | 93 const ppapi::HostResource& image_data, |
89 const PP_Point& top_left, | 94 const PP_Point& top_left, |
90 bool src_rect_specified, | 95 bool src_rect_specified, |
91 const PP_Rect& src_rect); | 96 const PP_Rect& src_rect); |
92 int32_t OnHostMsgScroll(ppapi::host::HostMessageContext* context, | 97 int32_t OnHostMsgScroll(ppapi::host::HostMessageContext* context, |
93 bool clip_specified, | 98 bool clip_specified, |
94 const PP_Rect& clip, | 99 const PP_Rect& clip, |
95 const PP_Point& amount); | 100 const PP_Point& amount); |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 | 183 |
179 bool texture_mailbox_modified_; | 184 bool texture_mailbox_modified_; |
180 | 185 |
181 friend class PepperGraphics2DHostTest; | 186 friend class PepperGraphics2DHostTest; |
182 DISALLOW_COPY_AND_ASSIGN(PepperGraphics2DHost); | 187 DISALLOW_COPY_AND_ASSIGN(PepperGraphics2DHost); |
183 }; | 188 }; |
184 | 189 |
185 } // namespace content | 190 } // namespace content |
186 | 191 |
187 #endif // CONTENT_RENDERER_PEPPER_PEPPER_GRAPHICS_2D_HOST_H_ | 192 #endif // CONTENT_RENDERER_PEPPER_PEPPER_GRAPHICS_2D_HOST_H_ |
OLD | NEW |