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 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 bool CompositorImpl::CopyTextureToBitmap(GLuint texture_id, | 340 bool CompositorImpl::CopyTextureToBitmap(GLuint texture_id, |
341 const gfx::Rect& sub_rect, | 341 const gfx::Rect& sub_rect, |
342 gfx::JavaBitmap& bitmap) { | 342 gfx::JavaBitmap& bitmap) { |
343 // The sub_rect should match the bitmap size. | 343 // The sub_rect should match the bitmap size. |
344 DCHECK(bitmap.size() == sub_rect.size()); | 344 DCHECK(bitmap.size() == sub_rect.size()); |
345 if (bitmap.size() != sub_rect.size() || texture_id == 0) return false; | 345 if (bitmap.size() != sub_rect.size() || texture_id == 0) return false; |
346 | 346 |
347 GLHelper* helper = ImageTransportFactoryAndroid::GetInstance()->GetGLHelper(); | 347 GLHelper* helper = ImageTransportFactoryAndroid::GetInstance()->GetGLHelper(); |
348 helper->ReadbackTextureSync(texture_id, | 348 helper->ReadbackTextureSync(texture_id, |
349 sub_rect, | 349 sub_rect, |
350 static_cast<unsigned char*> (bitmap.pixels())); | 350 static_cast<unsigned char*> (bitmap.pixels()), |
| 351 SkBitmap::kARGB_8888_Config); |
351 return true; | 352 return true; |
352 } | 353 } |
353 | 354 |
354 static scoped_ptr<WebGraphicsContext3DCommandBufferImpl> | 355 static scoped_ptr<WebGraphicsContext3DCommandBufferImpl> |
355 CreateGpuProcessViewContext( | 356 CreateGpuProcessViewContext( |
356 const blink::WebGraphicsContext3D::Attributes attributes, | 357 const blink::WebGraphicsContext3D::Attributes attributes, |
357 int surface_id) { | 358 int surface_id) { |
358 BrowserGpuChannelHostFactory* factory = | 359 BrowserGpuChannelHostFactory* factory = |
359 BrowserGpuChannelHostFactory::instance(); | 360 BrowserGpuChannelHostFactory::instance(); |
360 CauseForGpuLaunch cause = | 361 CauseForGpuLaunch cause = |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
487 default: | 488 default: |
488 return GL_UNSIGNED_SHORT_5_6_5; | 489 return GL_UNSIGNED_SHORT_5_6_5; |
489 } | 490 } |
490 } | 491 } |
491 | 492 |
492 void CompositorImpl::DidCommit() { | 493 void CompositorImpl::DidCommit() { |
493 root_window_->OnCompositingDidCommit(); | 494 root_window_->OnCompositingDidCommit(); |
494 } | 495 } |
495 | 496 |
496 } // namespace content | 497 } // namespace content |
OLD | NEW |