Chromium Code Reviews| Index: content/browser/renderer_host/compositor_impl_android.cc |
| diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc |
| index 1d6bd2fb6f94e6de14e1641e29b2bd5d6c81db23..10eb76524c47218c5f4dbe3ed546a3e59b5903fc 100644 |
| --- a/content/browser/renderer_host/compositor_impl_android.cc |
| +++ b/content/browser/renderer_host/compositor_impl_android.cc |
| @@ -259,12 +259,23 @@ void CompositorImpl::DeleteTexture(WebKit::WebGLId texture_id) { |
| DCHECK(context->getError() == GL_NO_ERROR); |
| } |
| -void CompositorImpl::CopyTextureToBitmap(WebKit::WebGLId texture_id, |
| +bool CompositorImpl::CopyTextureToBitmap(WebKit::WebGLId texture_id, |
| gfx::JavaBitmap& bitmap) { |
| + return CopyTextureToBitmap(texture_id, gfx::Rect(bitmap.size()), bitmap); |
| +} |
| + |
| +bool CompositorImpl::CopyTextureToBitmap(WebKit::WebGLId texture_id, |
| + const gfx::Rect& sub_rect, |
| + gfx::JavaBitmap& bitmap) { |
| + // The sub_rect should match the bitmap size. |
| + DCHECK(bitmap.size() == sub_rect.size()); |
| + if (bitmap.size() != sub_rect.size() || texture_id == 0) return false; |
|
no sievers
2012/12/18 19:33:19
line break before return
I guess the dcheck() can
|
| + |
| GLHelper* helper = ImageTransportFactoryAndroid::GetInstance()->GetGLHelper(); |
| helper->ReadbackTextureSync(texture_id, |
| - bitmap.size(), |
| + sub_rect, |
| static_cast<unsigned char*> (bitmap.pixels())); |
| + return true; |
| } |
| void CompositorImpl::animate(double monotonicFrameBeginTime) { |