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 <stdint.h> | 9 #include <stdint.h> |
10 #include <unordered_set> | 10 #include <unordered_set> |
(...skipping 13 matching lines...) Expand all Loading... | |
24 #include "base/synchronization/lock.h" | 24 #include "base/synchronization/lock.h" |
25 #include "base/sys_info.h" | 25 #include "base/sys_info.h" |
26 #include "base/threading/simple_thread.h" | 26 #include "base/threading/simple_thread.h" |
27 #include "base/threading/thread.h" | 27 #include "base/threading/thread.h" |
28 #include "base/threading/thread_checker.h" | 28 #include "base/threading/thread_checker.h" |
29 #include "base/threading/thread_task_runner_handle.h" | 29 #include "base/threading/thread_task_runner_handle.h" |
30 #include "cc/animation/animation_host.h" | 30 #include "cc/animation/animation_host.h" |
31 #include "cc/base/switches.h" | 31 #include "cc/base/switches.h" |
32 #include "cc/input/input_handler.h" | 32 #include "cc/input/input_handler.h" |
33 #include "cc/layers/layer.h" | 33 #include "cc/layers/layer.h" |
34 #include "cc/output/buffer_to_texture_target_map.h" | |
34 #include "cc/output/compositor_frame.h" | 35 #include "cc/output/compositor_frame.h" |
35 #include "cc/output/context_provider.h" | 36 #include "cc/output/context_provider.h" |
36 #include "cc/output/output_surface.h" | 37 #include "cc/output/output_surface.h" |
37 #include "cc/output/output_surface_client.h" | 38 #include "cc/output/output_surface_client.h" |
38 #include "cc/output/output_surface_frame.h" | 39 #include "cc/output/output_surface_frame.h" |
39 #include "cc/output/texture_mailbox_deleter.h" | 40 #include "cc/output/texture_mailbox_deleter.h" |
40 #include "cc/output/vulkan_in_process_context_provider.h" | 41 #include "cc/output/vulkan_in_process_context_provider.h" |
41 #include "cc/raster/single_thread_task_graph_runner.h" | 42 #include "cc/raster/single_thread_task_graph_runner.h" |
42 #include "cc/resources/ui_resource_manager.h" | 43 #include "cc/resources/ui_resource_manager.h" |
43 #include "cc/surfaces/direct_compositor_frame_sink.h" | 44 #include "cc/surfaces/direct_compositor_frame_sink.h" |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
522 settings.use_zero_copy = true; | 523 settings.use_zero_copy = true; |
523 | 524 |
524 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 525 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
525 settings.initial_debug_state.SetRecordRenderingStats( | 526 settings.initial_debug_state.SetRecordRenderingStats( |
526 command_line->HasSwitch(cc::switches::kEnableGpuBenchmarking)); | 527 command_line->HasSwitch(cc::switches::kEnableGpuBenchmarking)); |
527 settings.initial_debug_state.show_fps_counter = | 528 settings.initial_debug_state.show_fps_counter = |
528 command_line->HasSwitch(cc::switches::kUIShowFPSCounter); | 529 command_line->HasSwitch(cc::switches::kUIShowFPSCounter); |
529 settings.single_thread_proxy_scheduler = true; | 530 settings.single_thread_proxy_scheduler = true; |
530 | 531 |
531 animation_host_ = cc::AnimationHost::CreateMainInstance(); | 532 animation_host_ = cc::AnimationHost::CreateMainInstance(); |
533 for (int usage_idx = 0; usage_idx <= static_cast<int>(gfx::BufferUsage::LAST); | |
boliu
2017/06/07 23:14:48
I think this code to generate a map from gpu::GetI
sujith
2017/06/08 10:40:30
yes currently its been generated in 3 different pl
boliu
2017/06/08 17:00:00
Add a method to content/browser/gpu/compositor_uti
| |
534 ++usage_idx) { | |
535 gfx::BufferUsage usage = static_cast<gfx::BufferUsage>(usage_idx); | |
536 for (int format_idx = 0; | |
537 format_idx <= static_cast<int>(gfx::BufferFormat::LAST); | |
538 ++format_idx) { | |
539 gfx::BufferFormat format = static_cast<gfx::BufferFormat>(format_idx); | |
540 uint32_t target = gpu::GetImageTextureTarget(format, usage); | |
541 settings.buffer_to_texture_target_map[std::make_pair(usage, format)] = | |
boliu
2017/06/07 23:14:48
you need a rebase I think, this setting moved into
sujith
2017/06/08 10:40:30
i have rebased the current patch based on the late
| |
542 target; | |
543 } | |
544 } | |
532 | 545 |
533 cc::LayerTreeHost::InitParams params; | 546 cc::LayerTreeHost::InitParams params; |
534 params.client = this; | 547 params.client = this; |
535 params.task_graph_runner = &g_compositor_dependencies.Get().task_graph_runner; | 548 params.task_graph_runner = &g_compositor_dependencies.Get().task_graph_runner; |
536 params.main_task_runner = base::ThreadTaskRunnerHandle::Get(); | 549 params.main_task_runner = base::ThreadTaskRunnerHandle::Get(); |
537 params.settings = &settings; | 550 params.settings = &settings; |
538 params.mutator_host = animation_host_.get(); | 551 params.mutator_host = animation_host_.get(); |
539 host_ = cc::LayerTreeHost::CreateSingleThreaded(this, ¶ms); | 552 host_ = cc::LayerTreeHost::CreateSingleThreaded(this, ¶ms); |
540 DCHECK(!host_->IsVisible()); | 553 DCHECK(!host_->IsVisible()); |
541 host_->SetRootLayer(root_window_->GetLayer()); | 554 host_->SetRootLayer(root_window_->GetLayer()); |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
881 } | 894 } |
882 GetSurfaceManager()->UnregisterFrameSinkHierarchy(frame_sink_id_, | 895 GetSurfaceManager()->UnregisterFrameSinkHierarchy(frame_sink_id_, |
883 frame_sink_id); | 896 frame_sink_id); |
884 } | 897 } |
885 | 898 |
886 bool CompositorImpl::HavePendingReadbacks() { | 899 bool CompositorImpl::HavePendingReadbacks() { |
887 return !readback_layer_tree_->children().empty(); | 900 return !readback_layer_tree_->children().empty(); |
888 } | 901 } |
889 | 902 |
890 } // namespace content | 903 } // namespace content |
OLD | NEW |