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

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

Issue 11361170: Get windowless plugins working when accelerated compositing is turned on. (Closed) Base URL: svn://chrome-svn/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
« no previous file with comments | « content/plugin/webplugin_proxy.cc ('k') | content/renderer/webplugin_delegate_proxy.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 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
200 #endif 200 #endif
201 201
202 void OnURLRedirectResponse(bool allow, int resource_id); 202 void OnURLRedirectResponse(bool allow, int resource_id);
203 203
204 // Helper function that sends the UpdateGeometry message. 204 // Helper function that sends the UpdateGeometry message.
205 void SendUpdateGeometry(bool bitmaps_changed); 205 void SendUpdateGeometry(bool bitmaps_changed);
206 206
207 // Draw a graphic indicating a crashed plugin. 207 // Draw a graphic indicating a crashed plugin.
208 void PaintSadPlugin(WebKit::WebCanvas* canvas, const gfx::Rect& rect); 208 void PaintSadPlugin(WebKit::WebCanvas* canvas, const gfx::Rect& rect);
209 209
210 // Returns true if the given rectangle is different in the native drawing
211 // context and the current background bitmap.
212 bool BackgroundChanged(gfx::NativeDrawingContext context,
213 const gfx::Rect& rect);
214
215 // Copies the given rectangle from the back-buffer transport_stores_ bitmap to 210 // Copies the given rectangle from the back-buffer transport_stores_ bitmap to
216 // the front-buffer transport_stores_ bitmap. 211 // the front-buffer transport_stores_ bitmap.
217 void CopyFromBackBufferToFrontBuffer(const gfx::Rect& rect); 212 void CopyFromBackBufferToFrontBuffer(const gfx::Rect& rect);
218 213
219 // Updates the front-buffer with the given rectangle from the back-buffer, 214 // Updates the front-buffer with the given rectangle from the back-buffer,
220 // either by copying the rectangle or flipping the buffers. 215 // either by copying the rectangle or flipping the buffers.
221 void UpdateFrontBuffer(const gfx::Rect& rect, bool allow_buffer_flipping); 216 void UpdateFrontBuffer(const gfx::Rect& rect, bool allow_buffer_flipping);
222 217
223 // Clears the shared memory section and canvases used for windowless plugins. 218 // Clears the shared memory section and canvases used for windowless plugins.
224 void ResetWindowlessBitmaps(); 219 void ResetWindowlessBitmaps();
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 // Event passed in by the plugin process and is used to decide if messages 296 // Event passed in by the plugin process and is used to decide if messages
302 // need to be pumped in the NPP_HandleEvent sync call. 297 // need to be pumped in the NPP_HandleEvent sync call.
303 scoped_ptr<base::WaitableEvent> modal_loop_pump_messages_event_; 298 scoped_ptr<base::WaitableEvent> modal_loop_pump_messages_event_;
304 299
305 // Bitmap for crashed plugin 300 // Bitmap for crashed plugin
306 SkBitmap* sad_plugin_; 301 SkBitmap* sad_plugin_;
307 302
308 // True if we got an invalidate from the plugin and are waiting for a paint. 303 // True if we got an invalidate from the plugin and are waiting for a paint.
309 bool invalidate_pending_; 304 bool invalidate_pending_;
310 305
311 // Used to desynchronize windowless painting. When WebKit paints, we bitblt
312 // from our front buffer store of what the plugin rectangle looks like. The
313 // plugin paints into the back buffer store, and we swap the buffers when we
314 // get an invalidate from it. The background bitmap is used for transparent
315 // plugins, as they need the background data during painting.
316 bool transparent_;
317 // The index in the transport_stores_ array of the current front buffer 306 // The index in the transport_stores_ array of the current front buffer
318 // (i.e., the buffer to display). 307 // (i.e., the buffer to display).
319 int front_buffer_index_; 308 int front_buffer_index_;
320 SharedBitmap transport_stores_[2]; 309 SharedBitmap transport_stores_[2];
321 SharedBitmap background_store_;
322 // This lets us know the total portion of the transport store that has been 310 // This lets us know the total portion of the transport store that has been
323 // painted since the buffers were created. 311 // painted since the buffers were created.
324 gfx::Rect transport_store_painted_; 312 gfx::Rect transport_store_painted_;
325 // This is a bounding box on the portion of the front-buffer that was painted 313 // This is a bounding box on the portion of the front-buffer that was painted
326 // on the last buffer flip and which has not yet been re-painted in the 314 // on the last buffer flip and which has not yet been re-painted in the
327 // back-buffer. 315 // back-buffer.
328 gfx::Rect front_buffer_diff_; 316 gfx::Rect front_buffer_diff_;
329 317
330 // The url of the main frame hosting the plugin. 318 // The url of the main frame hosting the plugin.
331 GURL page_url_; 319 GURL page_url_;
332 320
333 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateProxy); 321 DISALLOW_COPY_AND_ASSIGN(WebPluginDelegateProxy);
334 }; 322 };
335 323
336 } // namespace content 324 } // namespace content
337 325
338 #endif // CONTENT_RENDERER_WEBPLUGIN_DELEGATE_PROXY_H_ 326 #endif // CONTENT_RENDERER_WEBPLUGIN_DELEGATE_PROXY_H_
OLDNEW
« no previous file with comments | « content/plugin/webplugin_proxy.cc ('k') | content/renderer/webplugin_delegate_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698