Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(447)

Side by Side Diff: webkit/plugins/ppapi/plugin_delegate.h

Issue 11053003: Migrate Graphics2D to new design. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webkit/plugins/ppapi/mock_plugin_delegate.cc ('k') | webkit/plugins/ppapi/plugin_module.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ 5 #ifndef WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_
6 #define WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ 6 #define WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 struct HostPortPair; 65 struct HostPortPair;
66 struct Preferences; 66 struct Preferences;
67 67
68 namespace thunk { 68 namespace thunk {
69 class ResourceCreationAPI; 69 class ResourceCreationAPI;
70 } 70 }
71 71
72 } // namespace ppapi 72 } // namespace ppapi
73 73
74 namespace WebKit { 74 namespace WebKit {
75 typedef SkCanvas WebCanvas;
75 class WebGamepads; 76 class WebGamepads;
76 class WebPlugin; 77 class WebPlugin;
77 struct WebCompositionUnderline; 78 struct WebCompositionUnderline;
78 struct WebCursorInfo; 79 struct WebCursorInfo;
79 } 80 }
80 81
81 namespace webkit_glue { 82 namespace webkit_glue {
82 class ClipboardClient; 83 class ClipboardClient;
83 class P2PTransport; 84 class P2PTransport;
84 class NetworkListObserver; 85 class NetworkListObserver;
85 } // namespace webkit_glue 86 } // namespace webkit_glue
86 87
87 namespace webkit { 88 namespace webkit {
88 namespace ppapi { 89 namespace ppapi {
89 90
90 class FileIO; 91 class FileIO;
91 class FullscreenContainer; 92 class FullscreenContainer;
92 class PluginInstance; 93 class PluginInstance;
93 class PluginModule; 94 class PluginModule;
94 class PPB_Broker_Impl; 95 class PPB_Broker_Impl;
96 class PPB_Flash_Menu_Impl;
97 class PPB_ImageData_Impl;
95 class PPB_TCPSocket_Private_Impl; 98 class PPB_TCPSocket_Private_Impl;
96 class PPB_UDPSocket_Private_Impl; 99 class PPB_UDPSocket_Private_Impl;
97 100
98 // Virtual interface that the browser implements to implement features for 101 // Virtual interface that the browser implements to implement features for
99 // PPAPI plugins. 102 // PPAPI plugins.
100 class PluginDelegate { 103 class PluginDelegate {
101 public: 104 public:
102 // This interface is used for the PluginModule to tell the code in charge of 105 // This interface is used for the PluginModule to tell the code in charge of
103 // re-using modules which modules currently exist. 106 // re-using modules which modules currently exist.
104 // 107 //
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 163
161 // Returns the platform-specific shared memory handle of the data backing 164 // Returns the platform-specific shared memory handle of the data backing
162 // this image. This is used by PPAPI proxying to send the image to the 165 // this image. This is used by PPAPI proxying to send the image to the
163 // out-of-process plugin. On success, the size in bytes will be placed into 166 // out-of-process plugin. On success, the size in bytes will be placed into
164 // |*bytes_count|. Returns 0 on failure. 167 // |*bytes_count|. Returns 0 on failure.
165 virtual intptr_t GetSharedMemoryHandle(uint32* byte_count) const = 0; 168 virtual intptr_t GetSharedMemoryHandle(uint32* byte_count) const = 0;
166 169
167 virtual TransportDIB* GetTransportDIB() const = 0; 170 virtual TransportDIB* GetTransportDIB() const = 0;
168 }; 171 };
169 172
173 class PlatformGraphics2D {
174 public:
175 virtual bool ReadImageData(PP_Resource image, const PP_Point* top_left) = 0;
176
177 // Assciates this device with the given plugin instance. You can pass NULL
178 // to clear the existing device. Returns true on success. In this case, a
179 // repaint of the page will also be scheduled. Failure means that the device
180 // is already bound to a different instance, and nothing will happen.
181 virtual bool BindToInstance(PluginInstance* new_instance) = 0;
182
183 // Paints the current backing store to the web page.
184 virtual void Paint(WebKit::WebCanvas* canvas,
185 const gfx::Rect& plugin_rect,
186 const gfx::Rect& paint_rect) = 0;
187
188 // Notifications about the view's progress painting. See PluginInstance.
189 // These messages are used to send Flush callbacks to the plugin.
190 virtual void ViewWillInitiatePaint() = 0;
191 virtual void ViewInitiatedPaint() = 0;
192 virtual void ViewFlushedPaint() = 0;
193
194 virtual bool IsAlwaysOpaque() const = 0;
195 virtual void SetScale(float scale) = 0;
196 virtual float GetScale() const = 0;
197 virtual PPB_ImageData_Impl* ImageData() = 0;
198 };
199
170 class PlatformContext3D { 200 class PlatformContext3D {
171 public: 201 public:
172 virtual ~PlatformContext3D() {} 202 virtual ~PlatformContext3D() {}
173 203
174 // Initialize the context. 204 // Initialize the context.
175 virtual bool Init(const int32* attrib_list, 205 virtual bool Init(const int32* attrib_list,
176 PlatformContext3D* share_context) = 0; 206 PlatformContext3D* share_context) = 0;
177 207
178 // If the plugin instance is backed by an OpenGL, return its ID in the 208 // If the plugin instance is backed by an OpenGL, return its ID in the
179 // compositors namespace. Otherwise return 0. Returns 0 by default. 209 // compositors namespace. Otherwise return 0. Returns 0 by default.
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 virtual SkBitmap* GetSadPluginBitmap() = 0; 381 virtual SkBitmap* GetSadPluginBitmap() = 0;
352 382
353 // Creates a replacement plug-in that is shown when the plug-in at |file_path| 383 // Creates a replacement plug-in that is shown when the plug-in at |file_path|
354 // couldn't be loaded. 384 // couldn't be loaded.
355 virtual WebKit::WebPlugin* CreatePluginReplacement( 385 virtual WebKit::WebPlugin* CreatePluginReplacement(
356 const FilePath& file_path) = 0; 386 const FilePath& file_path) = 0;
357 387
358 // The caller will own the pointer returned from this. 388 // The caller will own the pointer returned from this.
359 virtual PlatformImage2D* CreateImage2D(int width, int height) = 0; 389 virtual PlatformImage2D* CreateImage2D(int width, int height) = 0;
360 390
391 // Returns the internal PlatformGraphics2D implementation.
392 virtual PlatformGraphics2D* GetGraphics2D(PluginInstance* instance,
393 PP_Resource graphics_2d) = 0;
394
361 // The caller will own the pointer returned from this. 395 // The caller will own the pointer returned from this.
362 virtual PlatformContext3D* CreateContext3D() = 0; 396 virtual PlatformContext3D* CreateContext3D() = 0;
363 397
364 // Set that the context will now present to the delegate. 398 // Set that the context will now present to the delegate.
365 virtual void ReparentContext(PlatformContext3D*) = 0; 399 virtual void ReparentContext(PlatformContext3D*) = 0;
366 400
367 // If |device_id| is empty, the default video capture device will be used. The 401 // If |device_id| is empty, the default video capture device will be used. The
368 // user can start using the returned object to capture video right away. 402 // user can start using the returned object to capture video right away.
369 // Otherwise, the specified device will be used. The user needs to wait till 403 // Otherwise, the specified device will be used. The user needs to wait till
370 // |handler| gets an OnInitialized() notification to start using the returned 404 // |handler| gets an OnInitialized() notification to start using the returned
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 // Returns restrictions on local data handled by the plug-in. 698 // Returns restrictions on local data handled by the plug-in.
665 virtual PP_FlashLSORestrictions GetLocalDataRestrictions( 699 virtual PP_FlashLSORestrictions GetLocalDataRestrictions(
666 const GURL& document_url, 700 const GURL& document_url,
667 const GURL& plugin_url) = 0; 701 const GURL& plugin_url) = 0;
668 }; 702 };
669 703
670 } // namespace ppapi 704 } // namespace ppapi
671 } // namespace webkit 705 } // namespace webkit
672 706
673 #endif // WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_ 707 #endif // WEBKIT_PLUGINS_PPAPI_PLUGIN_DELEGATE_H_
OLDNEW
« no previous file with comments | « webkit/plugins/ppapi/mock_plugin_delegate.cc ('k') | webkit/plugins/ppapi/plugin_module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698