| Index: components/display_compositor/buffer_queue.cc
|
| diff --git a/components/display_compositor/buffer_queue.cc b/components/display_compositor/buffer_queue.cc
|
| index fafdb406b4feee839d0736a838647d135aa1101e..cad2c921bd500930bc3805614c4fd81288b42fb8 100644
|
| --- a/components/display_compositor/buffer_queue.cc
|
| +++ b/components/display_compositor/buffer_queue.cc
|
| @@ -243,6 +243,24 @@ std::unique_ptr<BufferQueue::AllocatedSurface> BufferQueue::GetNextSurface() {
|
| id, gfx::Rect(size_));
|
| }
|
|
|
| +void BufferQueue::ReadbackDisplayedFramebuffer(
|
| + SkBitmap* bitmap,
|
| + const base::Callback<void(bool)>& callback) {
|
| + if (!displayed_surface_) {
|
| + callback.Run(false);
|
| + return;
|
| + }
|
| + GLuint texture = gl_helper_->CreateTexture();
|
| + ScopedTextureBinder<GL_TEXTURE_2D> texture_binder(gl_, texture);
|
| + gl_->CopyTextureCHROMIUM(displayed_surface_->texture, texture, GL_RGBA,
|
| + GL_UNSIGNED_BYTE, false, false, false);
|
| + bitmap->allocN32Pixels(size_.width(), size_.height());
|
| + gl_helper_->ReadbackTextureAsync(
|
| + texture, size_, static_cast<unsigned char*>(bitmap->getPixels()),
|
| + kRGBA_8888_SkColorType, callback);
|
| + gl_helper_->DeleteTexture(texture);
|
| +}
|
| +
|
| BufferQueue::AllocatedSurface::AllocatedSurface(
|
| BufferQueue* buffer_queue,
|
| std::unique_ptr<gfx::GpuMemoryBuffer> buffer,
|
|
|