| 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..9a2e66239338e94267963ad00957360a251a25fa 100644
|
| --- a/content/browser/compositor/surface_utils.cc
|
| +++ b/content/browser/compositor/surface_utils.cc
|
| @@ -68,10 +68,14 @@ void PrepareTextureCopyOutputResult(
|
| DCHECK(result->HasTexture());
|
| base::ScopedClosureRunner scoped_callback_runner(
|
| base::Bind(callback, SkBitmap(), content::READBACK_FAILED));
|
| + content::ImageTransportFactory* factory =
|
| + content::ImageTransportFactory::GetInstance();
|
| + display_compositor::GLHelper* gl_helper = factory->GetGLHelper();
|
| + if (!gl_helper)
|
| + return;
|
| + if(!gl_helper->IsReadbackConfigSupported(color_type))
|
| + return;
|
|
|
| - // TODO(siva.gunturi): We should be able to validate the format here using
|
| - // GLHelper::IsReadbackConfigSupported before we processs the result.
|
| - // See crbug.com/415682 and crbug.com/415131.
|
| std::unique_ptr<SkBitmap> bitmap(new SkBitmap);
|
| if (!bitmap->tryAllocPixels(SkImageInfo::Make(
|
| dst_size_in_pixel.width(), dst_size_in_pixel.height(), color_type,
|
| @@ -81,12 +85,6 @@ void PrepareTextureCopyOutputResult(
|
| return;
|
| }
|
|
|
| - content::ImageTransportFactory* factory =
|
| - content::ImageTransportFactory::GetInstance();
|
| - display_compositor::GLHelper* gl_helper = factory->GetGLHelper();
|
| - if (!gl_helper)
|
| - return;
|
| -
|
| std::unique_ptr<SkAutoLockPixels> bitmap_pixels_lock(
|
| new SkAutoLockPixels(*bitmap));
|
| uint8_t* pixels = static_cast<uint8_t*>(bitmap->getPixels());
|
|
|