OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/renderer_host/compositor_impl_android.h" | 5 #include "content/browser/renderer_host/compositor_impl_android.h" |
6 | 6 |
7 #include <android/bitmap.h> | 7 #include <android/bitmap.h> |
8 #include <android/native_window_jni.h> | 8 #include <android/native_window_jni.h> |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 bool CompositorImpl::CopyTextureToBitmap(blink::WebGLId texture_id, | 345 bool CompositorImpl::CopyTextureToBitmap(blink::WebGLId texture_id, |
346 const gfx::Rect& sub_rect, | 346 const gfx::Rect& sub_rect, |
347 gfx::JavaBitmap& bitmap) { | 347 gfx::JavaBitmap& bitmap) { |
348 // The sub_rect should match the bitmap size. | 348 // The sub_rect should match the bitmap size. |
349 DCHECK(bitmap.size() == sub_rect.size()); | 349 DCHECK(bitmap.size() == sub_rect.size()); |
350 if (bitmap.size() != sub_rect.size() || texture_id == 0) return false; | 350 if (bitmap.size() != sub_rect.size() || texture_id == 0) return false; |
351 | 351 |
352 GLHelper* helper = ImageTransportFactoryAndroid::GetInstance()->GetGLHelper(); | 352 GLHelper* helper = ImageTransportFactoryAndroid::GetInstance()->GetGLHelper(); |
353 helper->ReadbackTextureSync(texture_id, | 353 helper->ReadbackTextureSync(texture_id, |
354 sub_rect, | 354 sub_rect, |
355 static_cast<unsigned char*> (bitmap.pixels())); | 355 static_cast<unsigned char*> (bitmap.pixels()), |
| 356 SkBitmap::kARGB_8888_Config); |
356 return true; | 357 return true; |
357 } | 358 } |
358 | 359 |
359 static scoped_ptr<WebGraphicsContext3DCommandBufferImpl> | 360 static scoped_ptr<WebGraphicsContext3DCommandBufferImpl> |
360 CreateGpuProcessViewContext( | 361 CreateGpuProcessViewContext( |
361 const blink::WebGraphicsContext3D::Attributes attributes, | 362 const blink::WebGraphicsContext3D::Attributes attributes, |
362 int surface_id) { | 363 int surface_id) { |
363 BrowserGpuChannelHostFactory* factory = | 364 BrowserGpuChannelHostFactory* factory = |
364 BrowserGpuChannelHostFactory::instance(); | 365 BrowserGpuChannelHostFactory::instance(); |
365 CauseForGpuLaunch cause = | 366 CauseForGpuLaunch cause = |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 default: | 495 default: |
495 return GL_UNSIGNED_SHORT_5_6_5; | 496 return GL_UNSIGNED_SHORT_5_6_5; |
496 } | 497 } |
497 } | 498 } |
498 | 499 |
499 void CompositorImpl::DidCommit() { | 500 void CompositorImpl::DidCommit() { |
500 root_window_->OnCompositingDidCommit(); | 501 root_window_->OnCompositingDidCommit(); |
501 } | 502 } |
502 | 503 |
503 } // namespace content | 504 } // namespace content |
OLD | NEW |