| 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 22 matching lines...) Expand all Loading... |
| 33 #include "content/common/gpu/client/gpu_channel_host.h" | 33 #include "content/common/gpu/client/gpu_channel_host.h" |
| 34 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 34 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
| 35 #include "content/common/gpu/gpu_process_launch_causes.h" | 35 #include "content/common/gpu/gpu_process_launch_causes.h" |
| 36 #include "content/public/browser/android/compositor_client.h" | 36 #include "content/public/browser/android/compositor_client.h" |
| 37 #include "content/public/common/content_switches.h" | 37 #include "content/public/common/content_switches.h" |
| 38 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" | 38 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" |
| 39 #include "third_party/khronos/GLES2/gl2.h" | 39 #include "third_party/khronos/GLES2/gl2.h" |
| 40 #include "third_party/khronos/GLES2/gl2ext.h" | 40 #include "third_party/khronos/GLES2/gl2ext.h" |
| 41 #include "ui/gfx/android/device_display_info.h" | 41 #include "ui/gfx/android/device_display_info.h" |
| 42 #include "ui/gfx/android/java_bitmap.h" | 42 #include "ui/gfx/android/java_bitmap.h" |
| 43 #include "ui/gfx/frame_time.h" |
| 43 #include "webkit/common/gpu/context_provider_in_process.h" | 44 #include "webkit/common/gpu/context_provider_in_process.h" |
| 44 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.
h" | 45 #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.
h" |
| 45 | 46 |
| 46 namespace gfx { | 47 namespace gfx { |
| 47 class JavaBitmap; | 48 class JavaBitmap; |
| 48 } | 49 } |
| 49 | 50 |
| 50 namespace { | 51 namespace { |
| 51 | 52 |
| 52 // Used for drawing directly to the screen. Bypasses resizing and swaps. | 53 // Used for drawing directly to the screen. Bypasses resizing and swaps. |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 } | 147 } |
| 147 | 148 |
| 148 CompositorImpl::~CompositorImpl() { | 149 CompositorImpl::~CompositorImpl() { |
| 149 ImageTransportFactoryAndroid::RemoveObserver(this); | 150 ImageTransportFactoryAndroid::RemoveObserver(this); |
| 150 // Clean-up any surface references. | 151 // Clean-up any surface references. |
| 151 SetSurface(NULL); | 152 SetSurface(NULL); |
| 152 } | 153 } |
| 153 | 154 |
| 154 void CompositorImpl::Composite() { | 155 void CompositorImpl::Composite() { |
| 155 if (host_) | 156 if (host_) |
| 156 host_->Composite(base::TimeTicks::Now()); | 157 host_->Composite(gfx::FrameTime::Now()); |
| 157 } | 158 } |
| 158 | 159 |
| 159 void CompositorImpl::SetRootLayer(scoped_refptr<cc::Layer> root_layer) { | 160 void CompositorImpl::SetRootLayer(scoped_refptr<cc::Layer> root_layer) { |
| 160 root_layer_->RemoveAllChildren(); | 161 root_layer_->RemoveAllChildren(); |
| 161 root_layer_->AddChild(root_layer); | 162 root_layer_->AddChild(root_layer); |
| 162 } | 163 } |
| 163 | 164 |
| 164 void CompositorImpl::SetWindowSurface(ANativeWindow* window) { | 165 void CompositorImpl::SetWindowSurface(ANativeWindow* window) { |
| 165 GpuSurfaceTracker* tracker = GpuSurfaceTracker::Get(); | 166 GpuSurfaceTracker* tracker = GpuSurfaceTracker::Get(); |
| 166 | 167 |
| (...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 case ANDROID_BITMAP_FORMAT_RGBA_8888: | 489 case ANDROID_BITMAP_FORMAT_RGBA_8888: |
| 489 return GL_UNSIGNED_BYTE; | 490 return GL_UNSIGNED_BYTE; |
| 490 break; | 491 break; |
| 491 case ANDROID_BITMAP_FORMAT_RGB_565: | 492 case ANDROID_BITMAP_FORMAT_RGB_565: |
| 492 default: | 493 default: |
| 493 return GL_UNSIGNED_SHORT_5_6_5; | 494 return GL_UNSIGNED_SHORT_5_6_5; |
| 494 } | 495 } |
| 495 } | 496 } |
| 496 | 497 |
| 497 } // namespace content | 498 } // namespace content |
| OLD | NEW |