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" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/memory/weak_ptr.h" | 12 #include "base/memory/weak_ptr.h" |
13 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
14 #include "ppapi/c/ppb_graphics_2d.h" | 14 #include "ppapi/c/ppb_graphics_2d.h" |
15 #include "ppapi/host/host_message_context.h" | 15 #include "ppapi/host/host_message_context.h" |
16 #include "ppapi/host/resource_host.h" | 16 #include "ppapi/host/resource_host.h" |
17 #include "third_party/WebKit/public/platform/WebCanvas.h" | 17 #include "third_party/WebKit/public/platform/WebCanvas.h" |
18 #include "webkit/plugins/ppapi/plugin_delegate.h" | 18 #include "webkit/plugins/ppapi/plugin_delegate.h" |
19 | 19 |
20 namespace gfx { | 20 namespace gfx { |
21 class Point; | 21 class Point; |
22 class Rect; | 22 class Rect; |
23 } | 23 } |
24 | 24 |
25 namespace webkit { | 25 namespace webkit { |
26 namespace ppapi { | 26 namespace ppapi { |
27 class PPB_ImageData_Impl; | 27 class PPB_ImageData_Impl; |
28 class PluginInstance; | 28 class PluginInstanceImpl; |
29 } // namespace ppapi | 29 } // namespace ppapi |
30 } // namespace webkit | 30 } // namespace webkit |
31 | 31 |
32 using webkit::ppapi::PPB_ImageData_Impl; | 32 using webkit::ppapi::PPB_ImageData_Impl; |
33 | 33 |
34 namespace content { | 34 namespace content { |
35 | 35 |
36 class RendererPpapiHost; | 36 class RendererPpapiHost; |
37 | 37 |
38 class CONTENT_EXPORT PepperGraphics2DHost | 38 class CONTENT_EXPORT PepperGraphics2DHost |
(...skipping 12 matching lines...) Expand all Loading... |
51 // ppapi::host::ResourceHost override. | 51 // ppapi::host::ResourceHost override. |
52 virtual int32_t OnResourceMessageReceived( | 52 virtual int32_t OnResourceMessageReceived( |
53 const IPC::Message& msg, | 53 const IPC::Message& msg, |
54 ppapi::host::HostMessageContext* context) OVERRIDE; | 54 ppapi::host::HostMessageContext* context) OVERRIDE; |
55 virtual PepperGraphics2DHost* AsPepperGraphics2DHost() OVERRIDE; | 55 virtual PepperGraphics2DHost* AsPepperGraphics2DHost() OVERRIDE; |
56 | 56 |
57 // PlatformGraphics2D overrides. | 57 // PlatformGraphics2D overrides. |
58 virtual bool ReadImageData(PP_Resource image, | 58 virtual bool ReadImageData(PP_Resource image, |
59 const PP_Point* top_left) OVERRIDE; | 59 const PP_Point* top_left) OVERRIDE; |
60 virtual bool BindToInstance( | 60 virtual bool BindToInstance( |
61 webkit::ppapi::PluginInstance* new_instance) OVERRIDE; | 61 webkit::ppapi::PluginInstanceImpl* new_instance) OVERRIDE; |
62 virtual void Paint(WebKit::WebCanvas* canvas, | 62 virtual void Paint(WebKit::WebCanvas* canvas, |
63 const gfx::Rect& plugin_rect, | 63 const gfx::Rect& plugin_rect, |
64 const gfx::Rect& paint_rect) OVERRIDE; | 64 const gfx::Rect& paint_rect) OVERRIDE; |
65 virtual void ViewWillInitiatePaint() OVERRIDE; | 65 virtual void ViewWillInitiatePaint() OVERRIDE; |
66 virtual void ViewInitiatedPaint() OVERRIDE; | 66 virtual void ViewInitiatedPaint() OVERRIDE; |
67 virtual void ViewFlushedPaint() OVERRIDE; | 67 virtual void ViewFlushedPaint() OVERRIDE; |
68 virtual void SetScale(float scale) OVERRIDE; | 68 virtual void SetScale(float scale) OVERRIDE; |
69 virtual float GetScale() const OVERRIDE; | 69 virtual float GetScale() const OVERRIDE; |
70 virtual bool IsAlwaysOpaque() const OVERRIDE; | 70 virtual bool IsAlwaysOpaque() const OVERRIDE; |
71 virtual PPB_ImageData_Impl* ImageData() OVERRIDE; | 71 virtual PPB_ImageData_Impl* ImageData() OVERRIDE; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 gfx::Rect* op_rect, | 135 gfx::Rect* op_rect, |
136 gfx::Point* delta); | 136 gfx::Point* delta); |
137 | 137 |
138 | 138 |
139 RendererPpapiHost* renderer_ppapi_host_; | 139 RendererPpapiHost* renderer_ppapi_host_; |
140 | 140 |
141 scoped_refptr<PPB_ImageData_Impl> image_data_; | 141 scoped_refptr<PPB_ImageData_Impl> image_data_; |
142 | 142 |
143 // Non-owning pointer to the plugin instance this context is currently bound | 143 // Non-owning pointer to the plugin instance this context is currently bound |
144 // to, if any. If the context is currently unbound, this will be NULL. | 144 // to, if any. If the context is currently unbound, this will be NULL. |
145 webkit::ppapi::PluginInstance* bound_instance_; | 145 webkit::ppapi::PluginInstanceImpl* bound_instance_; |
146 | 146 |
147 // Keeps track of all drawing commands queued before a Flush call. | 147 // Keeps track of all drawing commands queued before a Flush call. |
148 struct QueuedOperation; | 148 struct QueuedOperation; |
149 typedef std::vector<QueuedOperation> OperationQueue; | 149 typedef std::vector<QueuedOperation> OperationQueue; |
150 OperationQueue queued_operations_; | 150 OperationQueue queued_operations_; |
151 | 151 |
152 // True if we need to send an ACK to plugin. | 152 // True if we need to send an ACK to plugin. |
153 bool need_flush_ack_; | 153 bool need_flush_ack_; |
154 | 154 |
155 // When doing offscreen flushes, we issue a task that issues the callback | 155 // When doing offscreen flushes, we issue a task that issues the callback |
(...skipping 15 matching lines...) Expand all Loading... |
171 | 171 |
172 bool is_running_in_process_; | 172 bool is_running_in_process_; |
173 | 173 |
174 friend class PepperGraphics2DHostTest; | 174 friend class PepperGraphics2DHostTest; |
175 DISALLOW_COPY_AND_ASSIGN(PepperGraphics2DHost); | 175 DISALLOW_COPY_AND_ASSIGN(PepperGraphics2DHost); |
176 }; | 176 }; |
177 | 177 |
178 } // namespace content | 178 } // namespace content |
179 | 179 |
180 #endif // CONTENT_RENDERER_PEPPER_PEPPER_GRAPHICS_2D_HOST_H_ | 180 #endif // CONTENT_RENDERER_PEPPER_PEPPER_GRAPHICS_2D_HOST_H_ |
OLD | NEW |