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

Unified Diff: content/browser/compositor/surface_utils.cc

Issue 2094803005: Fix PrepareTextureCopyOutputResult to avoid ScopedCallbackRunner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_closure_runner
Patch Set: Created 4 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/compositor/surface_utils.cc
diff --git a/content/browser/compositor/surface_utils.cc b/content/browser/compositor/surface_utils.cc
index 9f79cb74b55a776b0de5a845d1932e3f4659a6f7..607d02e3c36f238821ab0d2248aa7663e534868c 100644
--- a/content/browser/compositor/surface_utils.cc
+++ b/content/browser/compositor/surface_utils.cc
@@ -4,7 +4,6 @@
#include "content/browser/compositor/surface_utils.h"
-#include "base/callback_helpers.h"
#include "base/memory/ref_counted.h"
#include "build/build_config.h"
#include "cc/output/copy_output_result.h"
@@ -66,8 +65,6 @@ void PrepareTextureCopyOutputResult(
callback.Run(SkBitmap(), content::READBACK_FAILED);
#else
DCHECK(result->HasTexture());
- base::ScopedClosureRunner scoped_callback_runner(
- base::Bind(callback, SkBitmap(), content::READBACK_FAILED));
// TODO(siva.gunturi): We should be able to validate the format here using
// GLHelper::IsReadbackConfigSupported before we processs the result.
@@ -76,16 +73,17 @@ void PrepareTextureCopyOutputResult(
if (!bitmap->tryAllocPixels(SkImageInfo::Make(
dst_size_in_pixel.width(), dst_size_in_pixel.height(), color_type,
kOpaque_SkAlphaType))) {
- scoped_callback_runner.Reset(base::Bind(
danakj 2016/06/24 23:57:27 Wait this actually want to call two callbacks, wit
Sergey Ulanov 2016/06/27 19:41:04 Are you saying that the old behavior is correct? T
- callback, SkBitmap(), content::READBACK_BITMAP_ALLOCATION_FAILURE));
+ callback.Run(SkBitmap(), content::READBACK_BITMAP_ALLOCATION_FAILURE);
return;
}
content::ImageTransportFactory* factory =
content::ImageTransportFactory::GetInstance();
display_compositor::GLHelper* gl_helper = factory->GetGLHelper();
- if (!gl_helper)
+ if (!gl_helper) {
+ callback.Run(SkBitmap(), content::READBACK_FAILED);
return;
+ }
std::unique_ptr<SkAutoLockPixels> bitmap_pixels_lock(
new SkAutoLockPixels(*bitmap));
@@ -96,8 +94,6 @@ void PrepareTextureCopyOutputResult(
result->TakeTexture(&texture_mailbox, &release_callback);
DCHECK(texture_mailbox.IsTexture());
- ignore_result(scoped_callback_runner.Release());
-
gl_helper->CropScaleReadbackAndCleanMailbox(
texture_mailbox.mailbox(), texture_mailbox.sync_token(), result->size(),
gfx::Rect(result->size()), dst_size_in_pixel, pixels, color_type,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698