| 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 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 display_info.GetDisplayWidth() * | 383 display_info.GetDisplayWidth() * |
| 384 kBytesPerPixel; | 384 kBytesPerPixel; |
| 385 if (!context->Initialize( | 385 if (!context->Initialize( |
| 386 attributes, | 386 attributes, |
| 387 false, | 387 false, |
| 388 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE, | 388 CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE, |
| 389 64 * 1024, // command buffer size | 389 64 * 1024, // command buffer size |
| 390 64 * 1024, // start transfer buffer size | 390 64 * 1024, // start transfer buffer size |
| 391 64 * 1024, // min transfer buffer size | 391 64 * 1024, // min transfer buffer size |
| 392 std::min(3 * full_screen_texture_size_in_bytes, | 392 std::min(3 * full_screen_texture_size_in_bytes, |
| 393 kDefaultMaxTransferBufferSize))) { | 393 kDefaultMaxTransferBufferSize), |
| 394 WebGraphicsContext3DCommandBufferImpl::kNoLimit |
| 395 )) { |
| 394 LOG(ERROR) << "Failed to create 3D context for compositor."; | 396 LOG(ERROR) << "Failed to create 3D context for compositor."; |
| 395 return scoped_ptr<WebGraphicsContext3DCommandBufferImpl>(); | 397 return scoped_ptr<WebGraphicsContext3DCommandBufferImpl>(); |
| 396 } | 398 } |
| 397 return context.Pass(); | 399 return context.Pass(); |
| 398 } | 400 } |
| 399 | 401 |
| 400 scoped_ptr<cc::OutputSurface> CompositorImpl::CreateOutputSurface( | 402 scoped_ptr<cc::OutputSurface> CompositorImpl::CreateOutputSurface( |
| 401 bool fallback) { | 403 bool fallback) { |
| 402 WebKit::WebGraphicsContext3D::Attributes attrs; | 404 WebKit::WebGraphicsContext3D::Attributes attrs; |
| 403 attrs.shareResources = true; | 405 attrs.shareResources = true; |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 case ANDROID_BITMAP_FORMAT_RGBA_8888: | 524 case ANDROID_BITMAP_FORMAT_RGBA_8888: |
| 523 return GL_UNSIGNED_BYTE; | 525 return GL_UNSIGNED_BYTE; |
| 524 break; | 526 break; |
| 525 case ANDROID_BITMAP_FORMAT_RGB_565: | 527 case ANDROID_BITMAP_FORMAT_RGB_565: |
| 526 default: | 528 default: |
| 527 return GL_UNSIGNED_SHORT_5_6_5; | 529 return GL_UNSIGNED_SHORT_5_6_5; |
| 528 } | 530 } |
| 529 } | 531 } |
| 530 | 532 |
| 531 } // namespace content | 533 } // namespace content |
| OLD | NEW |