Chromium Code Reviews| 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, |