| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 // static | 75 // static |
| 76 void Compositor::Initialize() { | 76 void Compositor::Initialize() { |
| 77 DCHECK(!CompositorImpl::IsInitialized()); | 77 DCHECK(!CompositorImpl::IsInitialized()); |
| 78 g_initialized = true; | 78 g_initialized = true; |
| 79 } | 79 } |
| 80 | 80 |
| 81 // static | 81 // static |
| 82 void Compositor::InitializeWithFlags(uint32 flags) { | 82 void Compositor::InitializeWithFlags(uint32 flags) { |
| 83 g_use_direct_gl = flags & DIRECT_CONTEXT_ON_DRAW_THREAD; | 83 g_use_direct_gl = flags & DIRECT_CONTEXT_ON_DRAW_THREAD; |
| 84 if (flags & ENABLE_COMPOSITOR_THREAD) { | 84 if (flags & ENABLE_COMPOSITOR_THREAD) { |
| 85 TRACE_EVENT_INSTANT0("test_gpu", "ThreadedCompositingInitialization"); | 85 TRACE_EVENT_INSTANT0("test_gpu", "ThreadedCompositingInitialization", |
| 86 TRACE_EVENT_SCOPE_THREAD); |
| 86 g_impl_thread = new webkit_glue::WebThreadImpl("Browser Compositor"); | 87 g_impl_thread = new webkit_glue::WebThreadImpl("Browser Compositor"); |
| 87 } | 88 } |
| 88 Compositor::Initialize(); | 89 Compositor::Initialize(); |
| 89 } | 90 } |
| 90 | 91 |
| 91 // static | 92 // static |
| 92 bool CompositorImpl::IsInitialized() { | 93 bool CompositorImpl::IsInitialized() { |
| 93 return g_initialized; | 94 return g_initialized; |
| 94 } | 95 } |
| 95 | 96 |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 443 case ANDROID_BITMAP_FORMAT_RGBA_8888: | 444 case ANDROID_BITMAP_FORMAT_RGBA_8888: |
| 444 return GL_UNSIGNED_BYTE; | 445 return GL_UNSIGNED_BYTE; |
| 445 break; | 446 break; |
| 446 case ANDROID_BITMAP_FORMAT_RGB_565: | 447 case ANDROID_BITMAP_FORMAT_RGB_565: |
| 447 default: | 448 default: |
| 448 return GL_UNSIGNED_SHORT_5_6_5; | 449 return GL_UNSIGNED_SHORT_5_6_5; |
| 449 } | 450 } |
| 450 } | 451 } |
| 451 | 452 |
| 452 } // namespace content | 453 } // namespace content |
| OLD | NEW |