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" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "base/threading/thread_checker.h" | 21 #include "base/threading/thread_checker.h" |
22 #include "cc/base/switches.h" | 22 #include "cc/base/switches.h" |
23 #include "cc/input/input_handler.h" | 23 #include "cc/input/input_handler.h" |
24 #include "cc/layers/layer.h" | 24 #include "cc/layers/layer.h" |
25 #include "cc/output/compositor_frame.h" | 25 #include "cc/output/compositor_frame.h" |
26 #include "cc/output/context_provider.h" | 26 #include "cc/output/context_provider.h" |
27 #include "cc/output/output_surface.h" | 27 #include "cc/output/output_surface.h" |
28 #include "cc/trees/layer_tree_host.h" | 28 #include "cc/trees/layer_tree_host.h" |
29 #include "content/browser/android/child_process_launcher_android.h" | 29 #include "content/browser/android/child_process_launcher_android.h" |
30 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" | 30 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
| 31 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" |
31 #include "content/browser/gpu/gpu_surface_tracker.h" | 32 #include "content/browser/gpu/gpu_surface_tracker.h" |
32 #include "content/common/gpu/client/command_buffer_proxy_impl.h" | 33 #include "content/common/gpu/client/command_buffer_proxy_impl.h" |
33 #include "content/common/gpu/client/context_provider_command_buffer.h" | 34 #include "content/common/gpu/client/context_provider_command_buffer.h" |
34 #include "content/common/gpu/client/gl_helper.h" | 35 #include "content/common/gpu/client/gl_helper.h" |
35 #include "content/common/gpu/client/gpu_channel_host.h" | 36 #include "content/common/gpu/client/gpu_channel_host.h" |
36 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 37 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
37 #include "content/common/gpu/gpu_process_launch_causes.h" | 38 #include "content/common/gpu/gpu_process_launch_causes.h" |
38 #include "content/common/host_shared_bitmap_manager.h" | 39 #include "content/common/host_shared_bitmap_manager.h" |
39 #include "content/public/browser/android/compositor_client.h" | 40 #include "content/public/browser/android/compositor_client.h" |
40 #include "gpu/command_buffer/client/gles2_interface.h" | 41 #include "gpu/command_buffer/client/gles2_interface.h" |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 command_line->HasSwitch(cc::switches::kEnableGpuBenchmarking)); | 460 command_line->HasSwitch(cc::switches::kEnableGpuBenchmarking)); |
460 settings.initial_debug_state.show_fps_counter = | 461 settings.initial_debug_state.show_fps_counter = |
461 command_line->HasSwitch(cc::switches::kUIShowFPSCounter); | 462 command_line->HasSwitch(cc::switches::kUIShowFPSCounter); |
462 // TODO(enne): Update this this compositor to use the scheduler. | 463 // TODO(enne): Update this this compositor to use the scheduler. |
463 settings.single_thread_proxy_scheduler = false; | 464 settings.single_thread_proxy_scheduler = false; |
464 | 465 |
465 host_ = cc::LayerTreeHost::CreateSingleThreaded( | 466 host_ = cc::LayerTreeHost::CreateSingleThreaded( |
466 this, | 467 this, |
467 this, | 468 this, |
468 HostSharedBitmapManager::current(), | 469 HostSharedBitmapManager::current(), |
| 470 BrowserGpuMemoryBufferManager::current(), |
469 settings, | 471 settings, |
470 base::MessageLoopProxy::current()); | 472 base::MessageLoopProxy::current()); |
471 host_->SetRootLayer(root_layer_); | 473 host_->SetRootLayer(root_layer_); |
472 | 474 |
473 host_->SetVisible(true); | 475 host_->SetVisible(true); |
474 host_->SetLayerTreeHostClientReady(); | 476 host_->SetLayerTreeHostClientReady(); |
475 host_->SetViewportSize(size_); | 477 host_->SetViewportSize(size_); |
476 host_->set_has_transparent_background(has_transparent_background_); | 478 host_->set_has_transparent_background(has_transparent_background_); |
477 host_->SetDeviceScaleFactor(device_scale_factor_); | 479 host_->SetDeviceScaleFactor(device_scale_factor_); |
478 ui_resource_provider_.SetLayerTreeHost(host_.get()); | 480 ui_resource_provider_.SetLayerTreeHost(host_.get()); |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
687 } | 689 } |
688 | 690 |
689 void CompositorImpl::SetNeedsAnimate() { | 691 void CompositorImpl::SetNeedsAnimate() { |
690 if (!host_) | 692 if (!host_) |
691 return; | 693 return; |
692 | 694 |
693 host_->SetNeedsAnimate(); | 695 host_->SetNeedsAnimate(); |
694 } | 696 } |
695 | 697 |
696 } // namespace content | 698 } // namespace content |
OLD | NEW |