| 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 #include "components/viz/service/display_embedder/server_shared_bitmap_manager.h
" | 52 #include "components/viz/service/display_embedder/server_shared_bitmap_manager.h
" |
| 53 #include "components/viz/service/frame_sinks/frame_sink_manager_impl.h" | 53 #include "components/viz/service/frame_sinks/frame_sink_manager_impl.h" |
| 54 #include "content/browser/compositor/surface_utils.h" | 54 #include "content/browser/compositor/surface_utils.h" |
| 55 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" | 55 #include "content/browser/gpu/browser_gpu_channel_host_factory.h" |
| 56 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" | 56 #include "content/browser/gpu/browser_gpu_memory_buffer_manager.h" |
| 57 #include "content/browser/gpu/compositor_util.h" | 57 #include "content/browser/gpu/compositor_util.h" |
| 58 #include "content/browser/renderer_host/render_widget_host_impl.h" | 58 #include "content/browser/renderer_host/render_widget_host_impl.h" |
| 59 #include "content/common/gpu_stream_constants.h" | 59 #include "content/common/gpu_stream_constants.h" |
| 60 #include "content/public/browser/android/compositor.h" | 60 #include "content/public/browser/android/compositor.h" |
| 61 #include "content/public/browser/android/compositor_client.h" | 61 #include "content/public/browser/android/compositor_client.h" |
| 62 #include "content/public/browser/browser_thread.h" |
| 62 #include "content/public/common/content_switches.h" | 63 #include "content/public/common/content_switches.h" |
| 63 #include "gpu/command_buffer/client/context_support.h" | 64 #include "gpu/command_buffer/client/context_support.h" |
| 64 #include "gpu/command_buffer/client/gles2_interface.h" | 65 #include "gpu/command_buffer/client/gles2_interface.h" |
| 65 #include "gpu/ipc/client/command_buffer_proxy_impl.h" | 66 #include "gpu/ipc/client/command_buffer_proxy_impl.h" |
| 66 #include "gpu/ipc/client/gpu_channel_host.h" | 67 #include "gpu/ipc/client/gpu_channel_host.h" |
| 67 #include "gpu/ipc/common/gpu_surface_tracker.h" | 68 #include "gpu/ipc/common/gpu_surface_tracker.h" |
| 68 #include "gpu/vulkan/features.h" | 69 #include "gpu/vulkan/features.h" |
| 69 #include "gpu/vulkan/vulkan_surface.h" | 70 #include "gpu/vulkan/vulkan_surface.h" |
| 70 #include "services/ui/public/cpp/gpu/context_provider_command_buffer.h" | 71 #include "services/ui/public/cpp/gpu/context_provider_command_buffer.h" |
| 71 #include "third_party/khronos/GLES2/gl2.h" | 72 #include "third_party/khronos/GLES2/gl2.h" |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 DCHECK(!CompositorImpl::IsInitialized()); | 403 DCHECK(!CompositorImpl::IsInitialized()); |
| 403 g_initialized = true; | 404 g_initialized = true; |
| 404 } | 405 } |
| 405 | 406 |
| 406 // static | 407 // static |
| 407 void Compositor::CreateContextProvider( | 408 void Compositor::CreateContextProvider( |
| 408 gpu::SurfaceHandle handle, | 409 gpu::SurfaceHandle handle, |
| 409 gpu::gles2::ContextCreationAttribHelper attributes, | 410 gpu::gles2::ContextCreationAttribHelper attributes, |
| 410 gpu::SharedMemoryLimits shared_memory_limits, | 411 gpu::SharedMemoryLimits shared_memory_limits, |
| 411 ContextProviderCallback callback) { | 412 ContextProviderCallback callback) { |
| 413 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 412 BrowserGpuChannelHostFactory::instance()->EstablishGpuChannel( | 414 BrowserGpuChannelHostFactory::instance()->EstablishGpuChannel( |
| 413 base::Bind(&CreateContextProviderAfterGpuChannelEstablished, handle, | 415 base::Bind(&CreateContextProviderAfterGpuChannelEstablished, handle, |
| 414 attributes, shared_memory_limits, callback)); | 416 attributes, shared_memory_limits, callback)); |
| 415 } | 417 } |
| 416 | 418 |
| 417 // static | 419 // static |
| 418 cc::SurfaceManager* CompositorImpl::GetSurfaceManager() { | 420 cc::SurfaceManager* CompositorImpl::GetSurfaceManager() { |
| 419 return g_compositor_dependencies.Get().frame_sink_manager->surface_manager(); | 421 return g_compositor_dependencies.Get().frame_sink_manager->surface_manager(); |
| 420 } | 422 } |
| 421 | 423 |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 906 } | 908 } |
| 907 GetSurfaceManager()->UnregisterFrameSinkHierarchy(frame_sink_id_, | 909 GetSurfaceManager()->UnregisterFrameSinkHierarchy(frame_sink_id_, |
| 908 frame_sink_id); | 910 frame_sink_id); |
| 909 } | 911 } |
| 910 | 912 |
| 911 bool CompositorImpl::HavePendingReadbacks() { | 913 bool CompositorImpl::HavePendingReadbacks() { |
| 912 return !readback_layer_tree_->children().empty(); | 914 return !readback_layer_tree_->children().empty(); |
| 913 } | 915 } |
| 914 | 916 |
| 915 } // namespace content | 917 } // namespace content |
| OLD | NEW |