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

Side by Side Diff: content/renderer/webplugin_delegate_proxy.h

Issue 11138024: Simplify platform_canvas.h by recognizing that PlatformCanvas does not actually extend (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month 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 | Annotate | Revision Log
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 CONTENT_RENDERER_WEBPLUGIN_DELEGATE_PROXY_H_ 5 #ifndef CONTENT_RENDERER_WEBPLUGIN_DELEGATE_PROXY_H_
6 #define CONTENT_RENDERER_WEBPLUGIN_DELEGATE_PROXY_H_ 6 #define CONTENT_RENDERER_WEBPLUGIN_DELEGATE_PROXY_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 16 matching lines...) Expand all
27 #endif 27 #endif
28 28
29 struct NPObject; 29 struct NPObject;
30 struct PluginHostMsg_URLRequest_Params; 30 struct PluginHostMsg_URLRequest_Params;
31 class SkBitmap; 31 class SkBitmap;
32 32
33 namespace base { 33 namespace base {
34 class WaitableEvent; 34 class WaitableEvent;
35 } 35 }
36 36
37 namespace skia {
38 class PlatformCanvas;
39 }
40
41 namespace webkit { 37 namespace webkit {
42 namespace npapi { 38 namespace npapi {
43 class WebPlugin; 39 class WebPlugin;
44 } 40 }
45 } 41 }
46 42
47 namespace content { 43 namespace content {
48 class NPObjectStub; 44 class NPObjectStub;
49 class PluginChannelHost; 45 class PluginChannelHost;
50 class RenderViewImpl; 46 class RenderViewImpl;
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 protected: 132 protected:
137 friend class base::DeleteHelper<WebPluginDelegateProxy>; 133 friend class base::DeleteHelper<WebPluginDelegateProxy>;
138 virtual ~WebPluginDelegateProxy(); 134 virtual ~WebPluginDelegateProxy();
139 135
140 private: 136 private:
141 struct SharedBitmap { 137 struct SharedBitmap {
142 SharedBitmap(); 138 SharedBitmap();
143 ~SharedBitmap(); 139 ~SharedBitmap();
144 140
145 scoped_ptr<TransportDIB> dib; 141 scoped_ptr<TransportDIB> dib;
146 scoped_ptr<skia::PlatformCanvas> canvas; 142 scoped_ptr<SkCanvas> canvas;
147 }; 143 };
148 144
149 // Message handlers for messages that proxy WebPlugin methods, which 145 // Message handlers for messages that proxy WebPlugin methods, which
150 // we translate into calls to the real WebPlugin. 146 // we translate into calls to the real WebPlugin.
151 void OnSetWindow(gfx::PluginWindowHandle window); 147 void OnSetWindow(gfx::PluginWindowHandle window);
152 #if defined(OS_WIN) 148 #if defined(OS_WIN)
153 void OnSetWindowlessData(HANDLE modal_loop_pump_messages_event, 149 void OnSetWindowlessData(HANDLE modal_loop_pump_messages_event,
154 gfx::NativeViewId dummy_activation_window); 150 gfx::NativeViewId dummy_activation_window);
155 void OnNotifyIMEStatus(const int input_mode, const gfx::Rect& caret_rect); 151 void OnNotifyIMEStatus(const int input_mode, const gfx::Rect& caret_rect);
156 #endif 152 #endif
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 void ResetWindowlessBitmaps(); 220 void ResetWindowlessBitmaps();
225 221
226 int front_buffer_index() const { 222 int front_buffer_index() const {
227 return front_buffer_index_; 223 return front_buffer_index_;
228 } 224 }
229 225
230 int back_buffer_index() const { 226 int back_buffer_index() const {
231 return 1 - front_buffer_index_; 227 return 1 - front_buffer_index_;
232 } 228 }
233 229
234 skia::PlatformCanvas* front_buffer_canvas() const { 230 SkCanvas* front_buffer_canvas() const {
235 return transport_stores_[front_buffer_index()].canvas.get(); 231 return transport_stores_[front_buffer_index()].canvas.get();
236 } 232 }
237 233
238 skia::PlatformCanvas* back_buffer_canvas() const { 234 SkCanvas* back_buffer_canvas() const {
239 return transport_stores_[back_buffer_index()].canvas.get(); 235 return transport_stores_[back_buffer_index()].canvas.get();
240 } 236 }
241 237
242 TransportDIB* front_buffer_dib() const { 238 TransportDIB* front_buffer_dib() const {
243 return transport_stores_[front_buffer_index()].dib.get(); 239 return transport_stores_[front_buffer_index()].dib.get();
244 } 240 }
245 241
246 TransportDIB* back_buffer_dib() const { 242 TransportDIB* back_buffer_dib() const {
247 return transport_stores_[back_buffer_index()].dib.get(); 243 return transport_stores_[back_buffer_index()].dib.get();
248 } 244 }
249 245
250 #if !defined(OS_WIN) 246 #if !defined(OS_WIN)
251 // Creates a process-local memory section and canvas. PlatformCanvas on 247 // Creates a process-local memory section and canvas. PlatformCanvas on
252 // Windows only works with a DIB, not arbitrary memory. 248 // Windows only works with a DIB, not arbitrary memory.
253 bool CreateLocalBitmap(std::vector<uint8>* memory, 249 bool CreateLocalBitmap(std::vector<uint8>* memory,
254 scoped_ptr<skia::PlatformCanvas>* canvas); 250 scoped_ptr<SkCanvas>* canvas);
255 #endif 251 #endif
256 252
257 // Creates a shared memory section and canvas. 253 // Creates a shared memory section and canvas.
258 bool CreateSharedBitmap(scoped_ptr<TransportDIB>* memory, 254 bool CreateSharedBitmap(scoped_ptr<TransportDIB>* memory,
259 scoped_ptr<skia::PlatformCanvas>* canvas); 255 scoped_ptr<SkCanvas>* canvas);
260 256
261 // Called for cleanup during plugin destruction. Normally right before the 257 // Called for cleanup during plugin destruction. Normally right before the
262 // plugin window gets destroyed, or when the plugin has crashed (at which 258 // plugin window gets destroyed, or when the plugin has crashed (at which
263 // point the window has already been destroyed). 259 // point the window has already been destroyed).
264 void WillDestroyWindow(); 260 void WillDestroyWindow();
265 261
266 #if defined(OS_MACOSX) 262 #if defined(OS_MACOSX)
267 // Synthesize a fake window handle for the plug-in to identify the instance 263 // Synthesize a fake window handle for the plug-in to identify the instance
268 // to the browser, allowing mapping to a surface for hardware acceleration 264 // to the browser, allowing mapping to a surface for hardware acceleration
269 // of plug-in content. The browser generates the handle which is then set on 265 // of plug-in content. The browser generates the handle which is then set on
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
329 325
330 // The url of the main frame hosting the plugin. 326 // The url of the main frame hosting the plugin.
331 GURL page_url_; 327 GURL page_url_;
332 328
333 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateProxy); 329 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateProxy);
334 }; 330 };
335 331
336 } // namespace content 332 } // namespace content
337 333
338 #endif // CONTENT_RENDERER_WEBPLUGIN_DELEGATE_PROXY_H_ 334 #endif // CONTENT_RENDERER_WEBPLUGIN_DELEGATE_PROXY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698