Chromium Code Reviews| Index: webkit/plugins/ppapi/plugin_delegate.h |
| diff --git a/webkit/plugins/ppapi/plugin_delegate.h b/webkit/plugins/ppapi/plugin_delegate.h |
| index e65becaed7b7d4d7f0350230f5c7ad7e85e80b23..014131708313255fdfa5f72a089076ea978182ce 100644 |
| --- a/webkit/plugins/ppapi/plugin_delegate.h |
| +++ b/webkit/plugins/ppapi/plugin_delegate.h |
| @@ -74,7 +74,10 @@ namespace skia { |
| class PlatformCanvas; |
| } |
| +class SkCanvas; |
| + |
| namespace WebKit { |
| +typedef SkCanvas WebCanvas; |
| class WebGamepads; |
| class WebPlugin; |
| struct WebCompositionUnderline; |
| @@ -96,6 +99,7 @@ class PluginInstance; |
| class PluginModule; |
| class PPB_Broker_Impl; |
| class PPB_Flash_Menu_Impl; |
| +class PPB_ImageData_Impl; |
| class PPB_TCPSocket_Private_Impl; |
| class PPB_UDPSocket_Private_Impl; |
| @@ -171,6 +175,32 @@ class PluginDelegate { |
| virtual TransportDIB* GetTransportDIB() const = 0; |
| }; |
| + class PlatformGraphics2D { |
| + public: |
| + virtual bool ReadImageData(PP_Resource image, const PP_Point* top_left) = 0; |
| + |
| + // Assciates this device with the given plugin instance. You can pass NULL |
| + // to clear the existing device. Returns true on success. In this case, a |
| + // repaint of the page will also be scheduled. Failure means that the device |
| + // is already bound to a different instance, and nothing will happen. |
| + virtual bool BindToInstance(PluginInstance* new_instance) = 0; |
| + |
| + // Paints the current backing store to the web page. |
| + virtual void Paint(WebKit::WebCanvas* canvas, |
| + const gfx::Rect& plugin_rect, |
| + const gfx::Rect& paint_rect) = 0; |
| + |
| + // Notifications about the view's progress painting. See PluginInstance. |
| + // These messages are used to send Flush callbacks to the plugin. |
| + virtual void ViewWillInitiatePaint() = 0; |
| + virtual void ViewInitiatedPaint() = 0; |
| + virtual void ViewFlushedPaint() = 0; |
| + |
| + virtual bool is_always_opaque() const = 0; |
|
brettw
2012/10/02 21:18:57
Since these are virtual functions, they should alw
victorhsieh
2012/10/02 22:15:03
Done.
|
| + virtual float GetScale() const = 0; |
| + virtual PPB_ImageData_Impl* image_data() = 0; |
| + }; |
| + |
| class PlatformContext3D { |
| public: |
| virtual ~PlatformContext3D() {} |
| @@ -363,6 +393,10 @@ class PluginDelegate { |
| virtual PlatformImage2D* CreateImage2D(int width, int height) = 0; |
| // The caller will own the pointer returned from this. |
|
brettw
2012/10/02 21:18:57
I don't think this comment is correct. It looks li
victorhsieh
2012/10/02 22:15:03
Done.
|
| + virtual PlatformGraphics2D* CreateGraphics2D(PluginInstance* instance, |
| + PP_Resource graphics_2d) = 0; |
| + |
| + // The caller will own the pointer returned from this. |
| virtual PlatformContext3D* CreateContext3D() = 0; |
| // Set that the context will now present to the delegate. |