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

Unified Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

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_mac.mm
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index 83f76a8ac4fa5dd6cc19115037892f0e686d24de..6800dd46619e589930f429ccd383080ace96c71e 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -7,6 +7,7 @@
#include <QuartzCore/QuartzCore.h>
#include "base/bind.h"
+#include "base/bind_helpers.h"
#include "base/debug/trace_event.h"
#include "base/logging.h"
#include "base/mac/closure_blocks_leopard_compat.h"
@@ -789,27 +790,22 @@ BackingStore* RenderWidgetHostViewMac::AllocBackingStore(
return new BackingStoreMac(render_widget_host_, size);
}
-bool RenderWidgetHostViewMac::CopyFromCompositingSurface(
- const gfx::Size& size,
- skia::PlatformCanvas* output) {
+void RenderWidgetHostViewMac::CopyFromCompositingSurface(
+ const gfx::Size& size,
+ skia::PlatformCanvas* output,
+ base::Callback<void(bool)> callback) {
+ base::ScopedClosureRunner scoped_callback_runner(base::Bind(callback, false));
if (!compositing_iosurface_.get() ||
!compositing_iosurface_->HasIOSurface())
- return false;
+ return;
if (!output->initialize(size.width(), size.height(), true))
- return false;
+ return;
- return compositing_iosurface_->CopyTo(
+ const bool result = compositing_iosurface_->CopyTo(
size, output->getTopDevice()->accessBitmap(true).getPixels());
-}
-
-void RenderWidgetHostViewMac::AsyncCopyFromCompositingSurface(
- const gfx::Size& size,
- skia::PlatformCanvas* output,
- base::Callback<void(bool)> callback) {
- // TODO(mazda): Implement this.
- NOTIMPLEMENTED();
- callback.Run(false);
+ scoped_callback_runner.Release();
+ callback.Run(result);
}
// Sets whether or not to accept first responder status.

Powered by Google App Engine
This is Rietveld 408576698