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_PLUGIN_WEBPLUGIN_PROXY_H_ | 5 #ifndef CONTENT_PLUGIN_WEBPLUGIN_PROXY_H_ |
6 #define CONTENT_PLUGIN_WEBPLUGIN_PROXY_H_ | 6 #define CONTENT_PLUGIN_WEBPLUGIN_PROXY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 const char* target, | 112 const char* target, |
113 const char* buf, | 113 const char* buf, |
114 unsigned int len, | 114 unsigned int len, |
115 int notify_id, | 115 int notify_id, |
116 bool popups_allowed, | 116 bool popups_allowed, |
117 bool notify_redirects) OVERRIDE; | 117 bool notify_redirects) OVERRIDE; |
118 void UpdateGeometry(const gfx::Rect& window_rect, | 118 void UpdateGeometry(const gfx::Rect& window_rect, |
119 const gfx::Rect& clip_rect, | 119 const gfx::Rect& clip_rect, |
120 const TransportDIB::Handle& windowless_buffer0, | 120 const TransportDIB::Handle& windowless_buffer0, |
121 const TransportDIB::Handle& windowless_buffer1, | 121 const TransportDIB::Handle& windowless_buffer1, |
122 int windowless_buffer_index, | 122 int windowless_buffer_index); |
123 const TransportDIB::Handle& background_buffer, | |
124 bool transparent); | |
125 virtual void CancelDocumentLoad() OVERRIDE; | 123 virtual void CancelDocumentLoad() OVERRIDE; |
126 virtual void InitiateHTTPRangeRequest( | 124 virtual void InitiateHTTPRangeRequest( |
127 const char* url, const char* range_info, int range_request_id) OVERRIDE; | 125 const char* url, const char* range_info, int range_request_id) OVERRIDE; |
128 virtual void SetDeferResourceLoading(unsigned long resource_id, | 126 virtual void SetDeferResourceLoading(unsigned long resource_id, |
129 bool defer) OVERRIDE; | 127 bool defer) OVERRIDE; |
130 virtual bool IsOffTheRecord() OVERRIDE; | 128 virtual bool IsOffTheRecord() OVERRIDE; |
131 virtual void ResourceClientDeleted( | 129 virtual void ResourceClientDeleted( |
132 webkit::npapi::WebPluginResourceClient* resource_client) OVERRIDE; | 130 webkit::npapi::WebPluginResourceClient* resource_client) OVERRIDE; |
133 | 131 |
134 #if defined(OS_MACOSX) | 132 #if defined(OS_MACOSX) |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 | 231 |
234 static void CreateShmPixmapFromDIB( | 232 static void CreateShmPixmapFromDIB( |
235 TransportDIB* dib, | 233 TransportDIB* dib, |
236 const gfx::Rect& window_rect, | 234 const gfx::Rect& window_rect, |
237 XID* pixmap_out); | 235 XID* pixmap_out); |
238 #endif | 236 #endif |
239 | 237 |
240 // Updates the shared memory sections where windowless plugins paint. | 238 // Updates the shared memory sections where windowless plugins paint. |
241 void SetWindowlessBuffers(const TransportDIB::Handle& windowless_buffer0, | 239 void SetWindowlessBuffers(const TransportDIB::Handle& windowless_buffer0, |
242 const TransportDIB::Handle& windowless_buffer1, | 240 const TransportDIB::Handle& windowless_buffer1, |
243 const TransportDIB::Handle& background_buffer, | |
244 const gfx::Rect& window_rect); | 241 const gfx::Rect& window_rect); |
245 | 242 |
246 #if defined(OS_MACOSX) | 243 #if defined(OS_MACOSX) |
247 CGContextRef windowless_context() const { | 244 CGContextRef windowless_context() const { |
248 return windowless_contexts_[windowless_buffer_index_].get(); | 245 return windowless_contexts_[windowless_buffer_index_].get(); |
249 } | 246 } |
250 #else | 247 #else |
251 skia::PlatformCanvas* windowless_canvas() const { | 248 skia::PlatformCanvas* windowless_canvas() const { |
252 return windowless_canvases_[windowless_buffer_index_].get(); | 249 return windowless_canvases_[windowless_buffer_index_].get(); |
253 } | 250 } |
(...skipping 18 matching lines...) Expand all Loading... |
272 gfx::Rect damaged_rect_; | 269 gfx::Rect damaged_rect_; |
273 bool waiting_for_paint_; | 270 bool waiting_for_paint_; |
274 // The url of the main frame hosting the plugin. | 271 // The url of the main frame hosting the plugin. |
275 GURL page_url_; | 272 GURL page_url_; |
276 | 273 |
277 // Variables used for desynchronized windowless plugin painting. See note in | 274 // Variables used for desynchronized windowless plugin painting. See note in |
278 // webplugin_delegate_proxy.h for how this works. The two sets of windowless_* | 275 // webplugin_delegate_proxy.h for how this works. The two sets of windowless_* |
279 // fields are for the front-buffer and back-buffer of a buffer flipping system | 276 // fields are for the front-buffer and back-buffer of a buffer flipping system |
280 // and windowless_buffer_index_ identifies which set we are using as the | 277 // and windowless_buffer_index_ identifies which set we are using as the |
281 // back-buffer at any given time. | 278 // back-buffer at any given time. |
282 bool transparent_; | |
283 int windowless_buffer_index_; | 279 int windowless_buffer_index_; |
284 #if defined(OS_MACOSX) | 280 #if defined(OS_MACOSX) |
285 scoped_ptr<TransportDIB> windowless_dibs_[2]; | 281 scoped_ptr<TransportDIB> windowless_dibs_[2]; |
286 scoped_ptr<TransportDIB> background_dib_; | |
287 base::mac::ScopedCFTypeRef<CGContextRef> windowless_contexts_[2]; | 282 base::mac::ScopedCFTypeRef<CGContextRef> windowless_contexts_[2]; |
288 base::mac::ScopedCFTypeRef<CGContextRef> background_context_; | |
289 scoped_ptr<WebPluginAcceleratedSurfaceProxy> accelerated_surface_; | 283 scoped_ptr<WebPluginAcceleratedSurfaceProxy> accelerated_surface_; |
290 #else | 284 #else |
291 SkAutoTUnref<skia::PlatformCanvas> windowless_canvases_[2]; | 285 SkAutoTUnref<skia::PlatformCanvas> windowless_canvases_[2]; |
292 SkAutoTUnref<skia::PlatformCanvas> background_canvas_; | |
293 | 286 |
294 #if defined(USE_X11) | 287 #if defined(USE_X11) |
295 scoped_refptr<SharedTransportDIB> windowless_dibs_[2]; | 288 scoped_refptr<SharedTransportDIB> windowless_dibs_[2]; |
296 scoped_refptr<SharedTransportDIB> background_dib_; | |
297 // If we can use SHM pixmaps for windowless plugin painting or not. | 289 // If we can use SHM pixmaps for windowless plugin painting or not. |
298 bool use_shm_pixmap_; | 290 bool use_shm_pixmap_; |
299 // The SHM pixmaps for windowless plugin painting. | 291 // The SHM pixmaps for windowless plugin painting. |
300 XID windowless_shm_pixmaps_[2]; | 292 XID windowless_shm_pixmaps_[2]; |
301 #endif | 293 #endif |
302 | 294 |
303 #endif | 295 #endif |
304 | 296 |
305 // Contains the routing id of the host render view. | 297 // Contains the routing id of the host render view. |
306 int host_render_view_routing_id_; | 298 int host_render_view_routing_id_; |
307 | 299 |
308 base::WeakPtrFactory<WebPluginProxy> weak_factory_; | 300 base::WeakPtrFactory<WebPluginProxy> weak_factory_; |
309 }; | 301 }; |
310 | 302 |
311 } // namespace content | 303 } // namespace content |
312 | 304 |
313 #endif // CONTENT_PLUGIN_WEBPLUGIN_PROXY_H_ | 305 #endif // CONTENT_PLUGIN_WEBPLUGIN_PROXY_H_ |
OLD | NEW |