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

Unified Diff: content/browser/renderer_host/render_widget_host_view_win.cc

Issue 10352016: Consolidate RenderWidgetHost::CopyFromBackingStore and RenderWidgetHost::AsyncCopyFromBackingStore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 7 months 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_widget_host_view_win.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_win.cc b/content/browser/renderer_host/render_widget_host_view_win.cc
index 898a5dd27d5687602aaa7ae6345f07771a81d05d..0300fd0c7e4ddf98a504064777a5c5f1d6f6901b 100644
--- a/content/browser/renderer_host/render_widget_host_view_win.cc
+++ b/content/browser/renderer_host/render_widget_host_view_win.cc
@@ -905,27 +905,24 @@ BackingStore* RenderWidgetHostViewWin::AllocBackingStore(
return new BackingStoreWin(render_widget_host_, size);
}
-bool RenderWidgetHostViewWin::CopyFromCompositingSurface(
- const gfx::Size& size,
- skia::PlatformCanvas* output) {
+void RenderWidgetHostViewWin::CopyFromCompositingSurface(
+ const gfx::Size& size,
+ skia::PlatformCanvas* output,
+ base::Callback<void(bool)> callback) {
+ base::ScopedClosureRunner scoped_callback_runner(base::Bind(callback, false));
if (!accelerated_surface_.get())
- return false;
+ return;
if (size.IsEmpty())
- return false;
+ return;
if (!output->initialize(size.width(), size.height(), true))
- return false;
+ return;
- return accelerated_surface_->CopyTo(
+ const bool result = accelerated_surface_->CopyTo(
size, output->getTopDevice()->accessBitmap(true).getPixels());
-}
-
-void RenderWidgetHostViewWin::AsyncCopyFromCompositingSurface(
- const gfx::Size& size,
- skia::PlatformCanvas* output,
- base::Callback<void(bool)> callback) {
- callback.Run(CopyFromCompositingSurface(size, output));
+ scoped_callback_runner.Release();
+ callback.Run(result);
}
void RenderWidgetHostViewWin::SetBackground(const SkBitmap& background) {
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_win.h ('k') | content/browser/renderer_host/test_render_view_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698