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

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

Issue 23648014: cc: Move TextureMailbox::ReleaseCallback to SingleReleaseCallback. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: releasecallback: SingleReleaseCallback Created 7 years, 3 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_android.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_android.cc b/content/browser/renderer_host/render_widget_host_view_android.cc
index 42e18691d18a1f02194a705d0ba4c9858007c803..ae2806e715333df1cd7df7ec65186a8de7357c39 100644
--- a/content/browser/renderer_host/render_widget_host_view_android.cc
+++ b/content/browser/renderer_host/render_widget_host_view_android.cc
@@ -21,6 +21,7 @@
#include "cc/output/compositor_frame_ack.h"
#include "cc/output/copy_output_request.h"
#include "cc/output/copy_output_result.h"
+#include "cc/resources/single_release_callback.h"
#include "cc/trees/layer_tree_host.h"
#include "content/browser/accessibility/browser_accessibility_manager_android.h"
#include "content/browser/android/content_view_core_impl.h"
@@ -90,12 +91,12 @@ void SendImeEventAck(RenderWidgetHostImpl* host) {
void CopyFromCompositingSurfaceFinished(
const base::Callback<void(bool, const SkBitmap&)>& callback,
- const cc::TextureMailbox::ReleaseCallback& release_callback,
+ scoped_ptr<cc::SingleReleaseCallback> release_callback,
scoped_ptr<SkBitmap> bitmap,
scoped_ptr<SkAutoLockPixels> bitmap_pixels_lock,
bool result) {
bitmap_pixels_lock.reset();
- release_callback.Run(0, false);
+ release_callback->Run(0, false);
callback.Run(result, *bitmap);
}
@@ -1199,6 +1200,7 @@ WebKit::WebGraphicsContext3D* RenderWidgetHostViewAndroid::Context3d() {
bool RenderWidgetHostViewAndroid::PrepareTextureMailbox(
cc::TextureMailbox* mailbox,
+ scoped_ptr<cc::SingleReleaseCallback>* release_callback,
bool use_shared_memory) {
return false;
}
@@ -1239,23 +1241,25 @@ void RenderWidgetHostViewAndroid::PrepareTextureCopyOutputResult(
new SkAutoLockPixels(*bitmap));
uint8* pixels = static_cast<uint8*>(bitmap->getPixels());
- scoped_ptr<cc::TextureMailbox> texture_mailbox = result->TakeTexture();
- DCHECK(texture_mailbox->IsTexture());
- if (!texture_mailbox->IsTexture())
+ cc::TextureMailbox texture_mailbox;
+ scoped_ptr<cc::SingleReleaseCallback> release_callback;
+ result->TakeTexture(&texture_mailbox, &release_callback);
+ DCHECK(texture_mailbox.IsTexture());
+ if (!texture_mailbox.IsTexture())
return;
ignore_result(scoped_callback_runner.Release());
gl_helper->CropScaleReadbackAndCleanMailbox(
- texture_mailbox->name(),
- texture_mailbox->sync_point(),
+ texture_mailbox.name(),
+ texture_mailbox.sync_point(),
result->size(),
gfx::Rect(result->size()),
dst_size_in_pixel,
pixels,
base::Bind(&CopyFromCompositingSurfaceFinished,
callback,
- texture_mailbox->callback(),
+ base::Passed(&release_callback),
base::Passed(&bitmap),
base::Passed(&bitmap_pixels_lock)));
}

Powered by Google App Engine
This is Rietveld 408576698