| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 scoped_refptr<PPB_ImageData_Impl> backing_store); | 50 scoped_refptr<PPB_ImageData_Impl> backing_store); |
| 51 | 51 |
| 52 virtual ~PepperGraphics2DHost(); | 52 virtual ~PepperGraphics2DHost(); |
| 53 | 53 |
| 54 // ppapi::host::ResourceHost override. | 54 // ppapi::host::ResourceHost override. |
| 55 virtual int32_t OnResourceMessageReceived( | 55 virtual int32_t OnResourceMessageReceived( |
| 56 const IPC::Message& msg, | 56 const IPC::Message& msg, |
| 57 ppapi::host::HostMessageContext* context) OVERRIDE; | 57 ppapi::host::HostMessageContext* context) OVERRIDE; |
| 58 virtual bool IsGraphics2DHost() OVERRIDE; | 58 virtual bool IsGraphics2DHost() OVERRIDE; |
| 59 | 59 |
| 60 bool ReadImageData(PP_Resource image, | 60 bool ReadImageData(PP_Resource image, const PP_Point* top_left); |
| 61 const PP_Point* top_left); | |
| 62 // Assciates this device with the given plugin instance. You can pass NULL | 61 // Assciates this device with the given plugin instance. You can pass NULL |
| 63 // to clear the existing device. Returns true on success. In this case, a | 62 // to clear the existing device. Returns true on success. In this case, a |
| 64 // repaint of the page will also be scheduled. Failure means that the device | 63 // repaint of the page will also be scheduled. Failure means that the device |
| 65 // is already bound to a different instance, and nothing will happen. | 64 // is already bound to a different instance, and nothing will happen. |
| 66 bool BindToInstance(PepperPluginInstanceImpl* new_instance); | 65 bool BindToInstance(PepperPluginInstanceImpl* new_instance); |
| 67 // Paints the current backing store to the web page. | 66 // Paints the current backing store to the web page. |
| 68 void Paint(blink::WebCanvas* canvas, | 67 void Paint(blink::WebCanvas* canvas, |
| 69 const gfx::Rect& plugin_rect, | 68 const gfx::Rect& plugin_rect, |
| 70 const gfx::Rect& paint_rect); | 69 const gfx::Rect& paint_rect); |
| 71 | 70 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 // If |old_image_data| is not NULL, a previous used ImageData object will be | 115 // If |old_image_data| is not NULL, a previous used ImageData object will be |
| 117 // reused. This is used by ReplaceContents. | 116 // reused. This is used by ReplaceContents. |
| 118 int32_t Flush(PP_Resource* old_image_data); | 117 int32_t Flush(PP_Resource* old_image_data); |
| 119 | 118 |
| 120 // Called internally to execute the different queued commands. The | 119 // Called internally to execute the different queued commands. The |
| 121 // parameters to these functions will have already been validated. The last | 120 // parameters to these functions will have already been validated. The last |
| 122 // rect argument will be filled by each function with the area affected by | 121 // rect argument will be filled by each function with the area affected by |
| 123 // the update that requires invalidation. If there were no pixels changed, | 122 // the update that requires invalidation. If there were no pixels changed, |
| 124 // this rect can be untouched. | 123 // this rect can be untouched. |
| 125 void ExecutePaintImageData(PPB_ImageData_Impl* image, | 124 void ExecutePaintImageData(PPB_ImageData_Impl* image, |
| 126 int x, int y, | 125 int x, |
| 126 int y, |
| 127 const gfx::Rect& src_rect, | 127 const gfx::Rect& src_rect, |
| 128 gfx::Rect* invalidated_rect); | 128 gfx::Rect* invalidated_rect); |
| 129 void ExecuteScroll(const gfx::Rect& clip, int dx, int dy, | 129 void ExecuteScroll(const gfx::Rect& clip, |
| 130 int dx, |
| 131 int dy, |
| 130 gfx::Rect* invalidated_rect); | 132 gfx::Rect* invalidated_rect); |
| 131 void ExecuteReplaceContents(PPB_ImageData_Impl* image, | 133 void ExecuteReplaceContents(PPB_ImageData_Impl* image, |
| 132 gfx::Rect* invalidated_rect, | 134 gfx::Rect* invalidated_rect, |
| 133 PP_Resource* old_image_data); | 135 PP_Resource* old_image_data); |
| 134 | 136 |
| 135 void SendFlushAck(); | 137 void SendFlushAck(); |
| 136 | 138 |
| 137 // Function scheduled to execute by ScheduleOffscreenFlushAck that actually | 139 // Function scheduled to execute by ScheduleOffscreenFlushAck that actually |
| 138 // issues the offscreen callbacks. | 140 // issues the offscreen callbacks. |
| 139 void SendOffscreenFlushAck(); | 141 void SendOffscreenFlushAck(); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 bool texture_mailbox_modified_; | 191 bool texture_mailbox_modified_; |
| 190 bool is_using_texture_layer_; | 192 bool is_using_texture_layer_; |
| 191 | 193 |
| 192 friend class PepperGraphics2DHostTest; | 194 friend class PepperGraphics2DHostTest; |
| 193 DISALLOW_COPY_AND_ASSIGN(PepperGraphics2DHost); | 195 DISALLOW_COPY_AND_ASSIGN(PepperGraphics2DHost); |
| 194 }; | 196 }; |
| 195 | 197 |
| 196 } // namespace content | 198 } // namespace content |
| 197 | 199 |
| 198 #endif // CONTENT_RENDERER_PEPPER_PEPPER_GRAPHICS_2D_HOST_H_ | 200 #endif // CONTENT_RENDERER_PEPPER_PEPPER_GRAPHICS_2D_HOST_H_ |
| OLD | NEW |