| 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 | 9 |
| 10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
| 11 #include "base/android/scoped_java_ref.h" | 11 #include "base/android/scoped_java_ref.h" |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/containers/hash_tables.h" | 14 #include "base/containers/hash_tables.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 "base/threading/thread_checker.h" | 20 #include "base/threading/thread_checker.h" |
| 21 #include "cc/base/switches.h" | 21 #include "cc/base/switches.h" |
| 22 #include "cc/input/input_handler.h" | 22 #include "cc/input/input_handler.h" |
| 23 #include "cc/layers/layer.h" | 23 #include "cc/layers/layer.h" |
| 24 #include "cc/output/compositor_frame.h" | 24 #include "cc/output/compositor_frame.h" |
| 25 #include "cc/output/context_provider.h" | 25 #include "cc/output/context_provider.h" |
| 26 #include "cc/output/output_surface.h" | 26 #include "cc/output/output_surface.h" |
| 27 #include "cc/scheduler/begin_frame_manager.h" |
| 27 #include "cc/trees/layer_tree_host.h" | 28 #include "cc/trees/layer_tree_host.h" |
| 28 #include "content/browser/android/child_process_launcher_android.h" | 29 #include "content/browser/android/child_process_launcher_android.h" |
| 29 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" | 30 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
| 30 #include "content/browser/gpu/gpu_surface_tracker.h" | 31 #include "content/browser/gpu/gpu_surface_tracker.h" |
| 31 #include "content/common/gpu/client/command_buffer_proxy_impl.h" | 32 #include "content/common/gpu/client/command_buffer_proxy_impl.h" |
| 32 #include "content/common/gpu/client/context_provider_command_buffer.h" | 33 #include "content/common/gpu/client/context_provider_command_buffer.h" |
| 33 #include "content/common/gpu/client/gl_helper.h" | 34 #include "content/common/gpu/client/gl_helper.h" |
| 34 #include "content/common/gpu/client/gpu_channel_host.h" | 35 #include "content/common/gpu/client/gpu_channel_host.h" |
| 35 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 36 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
| 36 #include "content/common/gpu/gpu_process_launch_causes.h" | 37 #include "content/common/gpu/gpu_process_launch_causes.h" |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 surface_id_(0), | 195 surface_id_(0), |
| 195 client_(client), | 196 client_(client), |
| 196 root_window_(root_window), | 197 root_window_(root_window), |
| 197 did_post_swapbuffers_(false), | 198 did_post_swapbuffers_(false), |
| 198 ignore_schedule_composite_(false), | 199 ignore_schedule_composite_(false), |
| 199 needs_composite_(false), | 200 needs_composite_(false), |
| 200 needs_animate_(false), | 201 needs_animate_(false), |
| 201 will_composite_immediately_(false), | 202 will_composite_immediately_(false), |
| 202 composite_on_vsync_trigger_(DO_NOT_COMPOSITE), | 203 composite_on_vsync_trigger_(DO_NOT_COMPOSITE), |
| 203 pending_swapbuffers_(0U), | 204 pending_swapbuffers_(0U), |
| 205 begin_frame_manager_(new cc::BeginFrameManager), |
| 204 weak_factory_(this) { | 206 weak_factory_(this) { |
| 205 DCHECK(client); | 207 DCHECK(client); |
| 206 DCHECK(root_window); | 208 DCHECK(root_window); |
| 207 ImageTransportFactoryAndroid::AddObserver(this); | 209 ImageTransportFactoryAndroid::AddObserver(this); |
| 208 root_window->AttachCompositor(this); | 210 root_window->AttachCompositor(this); |
| 209 } | 211 } |
| 210 | 212 |
| 211 CompositorImpl::~CompositorImpl() { | 213 CompositorImpl::~CompositorImpl() { |
| 212 root_window_->DetachCompositor(); | 214 root_window_->DetachCompositor(); |
| 213 ImageTransportFactoryAndroid::RemoveObserver(this); | 215 ImageTransportFactoryAndroid::RemoveObserver(this); |
| (...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 } | 642 } |
| 641 | 643 |
| 642 void CompositorImpl::SetNeedsAnimate() { | 644 void CompositorImpl::SetNeedsAnimate() { |
| 643 if (!host_) | 645 if (!host_) |
| 644 return; | 646 return; |
| 645 | 647 |
| 646 host_->SetNeedsAnimate(); | 648 host_->SetNeedsAnimate(); |
| 647 } | 649 } |
| 648 | 650 |
| 649 } // namespace content | 651 } // namespace content |
| OLD | NEW |