| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 WEBKIT_GLUE_PLUGINS_PEPPER_DEVICE_CONTEXT_2D_H_ | 5 #ifndef WEBKIT_GLUE_PLUGINS_PEPPER_DEVICE_CONTEXT_2D_H_ |
| 6 #define WEBKIT_GLUE_PLUGINS_PEPPER_DEVICE_CONTEXT_2D_H_ | 6 #define WEBKIT_GLUE_PLUGINS_PEPPER_DEVICE_CONTEXT_2D_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 // Returns a pointer to the interface implementing PPB_ImageData that is | 33 // Returns a pointer to the interface implementing PPB_ImageData that is |
| 34 // exposed to the plugin. | 34 // exposed to the plugin. |
| 35 static const PPB_DeviceContext2D* GetInterface(); | 35 static const PPB_DeviceContext2D* GetInterface(); |
| 36 | 36 |
| 37 bool Init(int width, int height, bool is_always_opaque); | 37 bool Init(int width, int height, bool is_always_opaque); |
| 38 | 38 |
| 39 // Resource override. | 39 // Resource override. |
| 40 virtual DeviceContext2D* AsDeviceContext2D() { return this; } | 40 virtual DeviceContext2D* AsDeviceContext2D() { return this; } |
| 41 | 41 |
| 42 // PPB_DeviceContext2D functions. | 42 // PPB_DeviceContext2D functions. |
| 43 bool Describe(int32_t* width, int32_t* height, bool* is_always_opaque); | 43 bool Describe(PP_Size* size, bool* is_always_opaque); |
| 44 bool PaintImageData(PP_Resource image, | 44 bool PaintImageData(PP_Resource image, |
| 45 int32_t x, int32_t y, | 45 const PP_Point* top_left, |
| 46 const PP_Rect* src_rect); | 46 const PP_Rect* src_rect); |
| 47 bool Scroll(const PP_Rect* clip_rect, int32_t dx, int32_t dy); | 47 bool Scroll(const PP_Rect* clip_rect, const PP_Point* amount); |
| 48 bool ReplaceContents(PP_Resource image); | 48 bool ReplaceContents(PP_Resource image); |
| 49 int32_t Flush(const PP_CompletionCallback& callback); | 49 int32_t Flush(const PP_CompletionCallback& callback); |
| 50 | 50 |
| 51 bool ReadImageData(PP_Resource image, int32_t x, int32_t y); | 51 bool ReadImageData(PP_Resource image, const PP_Point* top_left); |
| 52 | 52 |
| 53 // Assciates this device with the given plugin instance. You can pass NULL to | 53 // Assciates this device with the given plugin instance. You can pass NULL to |
| 54 // clear the existing device. Returns true on success. In this case, a | 54 // clear the existing device. Returns true on success. In this case, a |
| 55 // repaint of the page will also be scheduled. Failure means that the device | 55 // repaint of the page will also be scheduled. Failure means that the device |
| 56 // is already bound to a different instance, and nothing will happen. | 56 // is already bound to a different instance, and nothing will happen. |
| 57 bool BindToInstance(PluginInstance* new_instance); | 57 bool BindToInstance(PluginInstance* new_instance); |
| 58 | 58 |
| 59 // Paints the current backing store to the web page. | 59 // Paints the current backing store to the web page. |
| 60 void Paint(WebKit::WebCanvas* canvas, | 60 void Paint(WebKit::WebCanvas* canvas, |
| 61 const gfx::Rect& plugin_rect, | 61 const gfx::Rect& plugin_rect, |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 // later. This is set when one of those tasks is pending so that we can | 164 // later. This is set when one of those tasks is pending so that we can |
| 165 // enforce the "only one pending flush at a time" constraint in the API. | 165 // enforce the "only one pending flush at a time" constraint in the API. |
| 166 bool offscreen_flush_pending_; | 166 bool offscreen_flush_pending_; |
| 167 | 167 |
| 168 DISALLOW_COPY_AND_ASSIGN(DeviceContext2D); | 168 DISALLOW_COPY_AND_ASSIGN(DeviceContext2D); |
| 169 }; | 169 }; |
| 170 | 170 |
| 171 } // namespace pepper | 171 } // namespace pepper |
| 172 | 172 |
| 173 #endif // WEBKIT_GLUE_PLUGINS_PEPPER_DEVICE_CONTEXT_2D_H_ | 173 #endif // WEBKIT_GLUE_PLUGINS_PEPPER_DEVICE_CONTEXT_2D_H_ |
| OLD | NEW |