| 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 |
| 11 #include "base/android/jni_android.h" | 11 #include "base/android/jni_android.h" |
| 12 #include "base/android/scoped_java_ref.h" | 12 #include "base/android/scoped_java_ref.h" |
| 13 #include "base/bind.h" | 13 #include "base/bind.h" |
| 14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 15 #include "base/lazy_instance.h" | 15 #include "base/lazy_instance.h" |
| 16 #include "base/logging.h" | 16 #include "base/logging.h" |
| 17 #include "base/single_thread_task_runner.h" | 17 #include "base/single_thread_task_runner.h" |
| 18 #include "base/synchronization/lock.h" | 18 #include "base/synchronization/lock.h" |
| 19 #include "base/threading/thread.h" | 19 #include "base/threading/thread.h" |
| 20 #include "cc/input/input_handler.h" | 20 #include "cc/input/input_handler.h" |
| 21 #include "cc/layers/layer.h" | 21 #include "cc/layers/layer.h" |
| 22 #include "cc/output/compositor_frame.h" | 22 #include "cc/output/compositor_frame.h" |
| 23 #include "cc/output/context_provider.h" | 23 #include "cc/output/context_provider.h" |
| 24 #include "cc/output/output_surface.h" | 24 #include "cc/output/output_surface.h" |
| 25 #include "cc/resources/scoped_ui_resource.h" | 25 #include "cc/resources/scoped_ui_resource.h" |
| 26 #include "cc/resources/ui_resource_bitmap.h" | 26 #include "cc/resources/ui_resource_bitmap.h" |
| 27 #include "cc/trees/layer_tree_host.h" | 27 #include "cc/trees/layer_tree_host.h" |
| 28 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" | 28 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
| 29 #include "content/browser/gpu/gpu_surface_tracker.h" | 29 #include "content/browser/gpu/gpu_surface_tracker.h" |
| 30 #include "content/browser/renderer_host/compositor_observer.h" |
| 30 #include "content/common/gpu/client/command_buffer_proxy_impl.h" | 31 #include "content/common/gpu/client/command_buffer_proxy_impl.h" |
| 31 #include "content/common/gpu/client/context_provider_command_buffer.h" | 32 #include "content/common/gpu/client/context_provider_command_buffer.h" |
| 32 #include "content/common/gpu/client/gl_helper.h" | 33 #include "content/common/gpu/client/gl_helper.h" |
| 33 #include "content/common/gpu/client/gpu_channel_host.h" | 34 #include "content/common/gpu/client/gpu_channel_host.h" |
| 34 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 35 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
| 35 #include "content/common/gpu/gpu_process_launch_causes.h" | 36 #include "content/common/gpu/gpu_process_launch_causes.h" |
| 36 #include "content/public/browser/android/compositor_client.h" | 37 #include "content/public/browser/android/compositor_client.h" |
| 37 #include "content/public/common/content_switches.h" | 38 #include "content/public/common/content_switches.h" |
| 38 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" | 39 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" |
| 39 #include "third_party/khronos/GLES2/gl2.h" | 40 #include "third_party/khronos/GLES2/gl2.h" |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 break; | 494 break; |
| 494 case ANDROID_BITMAP_FORMAT_RGBA_8888: | 495 case ANDROID_BITMAP_FORMAT_RGBA_8888: |
| 495 return GL_UNSIGNED_BYTE; | 496 return GL_UNSIGNED_BYTE; |
| 496 break; | 497 break; |
| 497 case ANDROID_BITMAP_FORMAT_RGB_565: | 498 case ANDROID_BITMAP_FORMAT_RGB_565: |
| 498 default: | 499 default: |
| 499 return GL_UNSIGNED_SHORT_5_6_5; | 500 return GL_UNSIGNED_SHORT_5_6_5; |
| 500 } | 501 } |
| 501 } | 502 } |
| 502 | 503 |
| 504 void CompositorImpl::AddObserver(CompositorObserver* observer) { |
| 505 observer_list_.AddObserver(observer); |
| 506 } |
| 507 |
| 508 void CompositorImpl::RemoveObserver(CompositorObserver* observer) { |
| 509 observer_list_.RemoveObserver(observer); |
| 510 } |
| 511 |
| 512 bool CompositorImpl::HasObserver(CompositorObserver* observer) { |
| 513 return observer_list_.HasObserver(observer); |
| 514 } |
| 515 |
| 516 void CompositorImpl::DidCommit() { |
| 517 FOR_EACH_OBSERVER(CompositorObserver, |
| 518 observer_list_, |
| 519 OnCompositingDidCommit(this)); |
| 520 } |
| 521 |
| 503 } // namespace content | 522 } // namespace content |
| OLD | NEW |