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 30 matching lines...) Expand all Loading... |
41 #include "cc/raster/single_thread_task_graph_runner.h" | 41 #include "cc/raster/single_thread_task_graph_runner.h" |
42 #include "cc/resources/ui_resource_manager.h" | 42 #include "cc/resources/ui_resource_manager.h" |
43 #include "cc/surfaces/direct_compositor_frame_sink.h" | 43 #include "cc/surfaces/direct_compositor_frame_sink.h" |
44 #include "cc/surfaces/display.h" | 44 #include "cc/surfaces/display.h" |
45 #include "cc/surfaces/display_scheduler.h" | 45 #include "cc/surfaces/display_scheduler.h" |
46 #include "cc/surfaces/frame_sink_id_allocator.h" | 46 #include "cc/surfaces/frame_sink_id_allocator.h" |
47 #include "cc/trees/layer_tree_host.h" | 47 #include "cc/trees/layer_tree_host.h" |
48 #include "cc/trees/layer_tree_settings.h" | 48 #include "cc/trees/layer_tree_settings.h" |
49 #include "components/display_compositor/compositor_overlay_candidate_validator_a
ndroid.h" | 49 #include "components/display_compositor/compositor_overlay_candidate_validator_a
ndroid.h" |
50 #include "components/display_compositor/gl_helper.h" | 50 #include "components/display_compositor/gl_helper.h" |
| 51 #include "components/display_compositor/host_shared_bitmap_manager.h" |
51 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" | 52 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
52 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" | 53 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" |
53 #include "content/browser/gpu/compositor_util.h" | 54 #include "content/browser/gpu/compositor_util.h" |
54 #include "content/browser/renderer_host/render_widget_host_impl.h" | 55 #include "content/browser/renderer_host/render_widget_host_impl.h" |
55 #include "content/common/host_shared_bitmap_manager.h" | |
56 #include "content/public/browser/android/compositor.h" | 56 #include "content/public/browser/android/compositor.h" |
57 #include "content/public/browser/android/compositor_client.h" | 57 #include "content/public/browser/android/compositor_client.h" |
58 #include "content/public/common/content_switches.h" | 58 #include "content/public/common/content_switches.h" |
59 #include "gpu/command_buffer/client/context_support.h" | 59 #include "gpu/command_buffer/client/context_support.h" |
60 #include "gpu/command_buffer/client/gles2_interface.h" | 60 #include "gpu/command_buffer/client/gles2_interface.h" |
61 #include "gpu/ipc/client/command_buffer_proxy_impl.h" | 61 #include "gpu/ipc/client/command_buffer_proxy_impl.h" |
62 #include "gpu/ipc/client/gpu_channel_host.h" | 62 #include "gpu/ipc/client/gpu_channel_host.h" |
63 #include "gpu/ipc/common/gpu_surface_tracker.h" | 63 #include "gpu/ipc/common/gpu_surface_tracker.h" |
64 #include "gpu/vulkan/features.h" | 64 #include "gpu/vulkan/features.h" |
65 #include "gpu/vulkan/vulkan_surface.h" | 65 #include "gpu/vulkan/vulkan_surface.h" |
(...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
752 } else { | 752 } else { |
753 // TODO(danakj): Populate gpu_capabilities_ for VulkanContextProvider. | 753 // TODO(danakj): Populate gpu_capabilities_ for VulkanContextProvider. |
754 } | 754 } |
755 | 755 |
756 cc::SurfaceManager* manager = GetSurfaceManager(); | 756 cc::SurfaceManager* manager = GetSurfaceManager(); |
757 auto* task_runner = base::ThreadTaskRunnerHandle::Get().get(); | 757 auto* task_runner = base::ThreadTaskRunnerHandle::Get().get(); |
758 std::unique_ptr<cc::DisplayScheduler> scheduler(new cc::DisplayScheduler( | 758 std::unique_ptr<cc::DisplayScheduler> scheduler(new cc::DisplayScheduler( |
759 task_runner, display_output_surface->capabilities().max_frames_pending)); | 759 task_runner, display_output_surface->capabilities().max_frames_pending)); |
760 | 760 |
761 display_.reset(new cc::Display( | 761 display_.reset(new cc::Display( |
762 HostSharedBitmapManager::current(), | 762 display_compositor::HostSharedBitmapManager::current(), |
763 BrowserGpuMemoryBufferManager::current(), | 763 BrowserGpuMemoryBufferManager::current(), |
764 host_->GetSettings().renderer_settings, frame_sink_id_, | 764 host_->GetSettings().renderer_settings, frame_sink_id_, |
765 root_window_->GetBeginFrameSource(), std::move(display_output_surface), | 765 root_window_->GetBeginFrameSource(), std::move(display_output_surface), |
766 std::move(scheduler), | 766 std::move(scheduler), |
767 base::MakeUnique<cc::TextureMailboxDeleter>(task_runner))); | 767 base::MakeUnique<cc::TextureMailboxDeleter>(task_runner))); |
768 | 768 |
769 auto compositor_frame_sink = | 769 auto compositor_frame_sink = |
770 vulkan_context_provider | 770 vulkan_context_provider |
771 ? base::MakeUnique<cc::DirectCompositorFrameSink>( | 771 ? base::MakeUnique<cc::DirectCompositorFrameSink>( |
772 frame_sink_id_, manager, display_.get(), | 772 frame_sink_id_, manager, display_.get(), |
773 vulkan_context_provider) | 773 vulkan_context_provider) |
774 : base::MakeUnique<cc::DirectCompositorFrameSink>( | 774 : base::MakeUnique<cc::DirectCompositorFrameSink>( |
775 frame_sink_id_, manager, display_.get(), context_provider, | 775 frame_sink_id_, manager, display_.get(), context_provider, |
776 nullptr, BrowserGpuMemoryBufferManager::current(), | 776 nullptr, BrowserGpuMemoryBufferManager::current(), |
777 HostSharedBitmapManager::current()); | 777 display_compositor::HostSharedBitmapManager::current()); |
778 | 778 |
779 display_->SetVisible(true); | 779 display_->SetVisible(true); |
780 display_->Resize(size_); | 780 display_->Resize(size_); |
781 host_->SetCompositorFrameSink(std::move(compositor_frame_sink)); | 781 host_->SetCompositorFrameSink(std::move(compositor_frame_sink)); |
782 } | 782 } |
783 | 783 |
784 void CompositorImpl::DidSwapBuffers() { | 784 void CompositorImpl::DidSwapBuffers() { |
785 client_->DidSwapBuffers(); | 785 client_->DidSwapBuffers(); |
786 } | 786 } |
787 | 787 |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
862 } | 862 } |
863 GetSurfaceManager()->UnregisterFrameSinkHierarchy(frame_sink_id_, | 863 GetSurfaceManager()->UnregisterFrameSinkHierarchy(frame_sink_id_, |
864 frame_sink_id); | 864 frame_sink_id); |
865 } | 865 } |
866 | 866 |
867 bool CompositorImpl::HavePendingReadbacks() { | 867 bool CompositorImpl::HavePendingReadbacks() { |
868 return !readback_layer_tree_->children().empty(); | 868 return !readback_layer_tree_->children().empty(); |
869 } | 869 } |
870 | 870 |
871 } // namespace content | 871 } // namespace content |
OLD | NEW |