| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "services/ui/surfaces/surfaces_context_provider.h" | 5 #include "services/ui/surfaces/surfaces_context_provider.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/synchronization/waitable_event.h" | 12 #include "base/synchronization/waitable_event.h" |
| 13 #include "base/threading/thread_task_runner_handle.h" | 13 #include "base/threading/thread_task_runner_handle.h" |
| 14 #include "build/build_config.h" | 14 #include "build/build_config.h" |
| 15 #include "cc/output/context_cache_controller.h" | 15 #include "cc/output/context_cache_controller.h" |
| 16 #include "gpu/command_buffer/client/gles2_cmd_helper.h" | 16 #include "gpu/command_buffer/client/gles2_cmd_helper.h" |
| 17 #include "gpu/command_buffer/client/gles2_implementation.h" | 17 #include "gpu/command_buffer/client/gles2_implementation.h" |
| 18 #include "gpu/command_buffer/client/shared_memory_limits.h" | 18 #include "gpu/command_buffer/client/shared_memory_limits.h" |
| 19 #include "gpu/command_buffer/client/transfer_buffer.h" | 19 #include "gpu/command_buffer/client/transfer_buffer.h" |
| 20 #include "gpu/ipc/client/command_buffer_proxy_impl.h" | 20 #include "gpu/ipc/client/command_buffer_proxy_impl.h" |
| 21 #include "gpu/ipc/client/gpu_channel_host.h" | 21 #include "gpu/ipc/client/gpu_channel_host.h" |
| 22 #include "services/ui/common/switches.h" | 22 #include "services/ui/common/switches.h" |
| 23 #include "services/ui/surfaces/surfaces_context_provider_delegate.h" | 23 #include "services/ui/surfaces/surfaces_context_provider_delegate.h" |
| 24 #include "ui/gl/gpu_preference.h" | 24 #include "ui/gl/gpu_preference.h" |
| 25 #include "url/gurl.h" | 25 #include "url/gurl.h" |
| 26 | 26 |
| 27 namespace ui { | 27 namespace ui { |
| 28 | 28 |
| 29 SurfacesContextProvider::SurfacesContextProvider( | 29 SurfacesContextProvider::SurfacesContextProvider( |
| 30 gfx::AcceleratedWidget widget, | 30 gpu::SurfaceHandle widget, |
| 31 scoped_refptr<gpu::GpuChannelHost> gpu_channel) | 31 scoped_refptr<gpu::GpuChannelHost> gpu_channel) |
| 32 : delegate_(nullptr), | 32 : delegate_(nullptr), task_runner_(base::ThreadTaskRunnerHandle::Get()) { |
| 33 widget_(widget), | |
| 34 task_runner_(base::ThreadTaskRunnerHandle::Get()) { | |
| 35 gpu::CommandBufferProxyImpl* shared_command_buffer = nullptr; | 33 gpu::CommandBufferProxyImpl* shared_command_buffer = nullptr; |
| 36 gpu::GpuStreamId stream_id = gpu::GpuStreamId::GPU_STREAM_DEFAULT; | 34 gpu::GpuStreamId stream_id = gpu::GpuStreamId::GPU_STREAM_DEFAULT; |
| 37 gpu::GpuStreamPriority stream_priority = gpu::GpuStreamPriority::NORMAL; | 35 gpu::GpuStreamPriority stream_priority = gpu::GpuStreamPriority::NORMAL; |
| 38 gpu::gles2::ContextCreationAttribHelper attributes; | 36 gpu::gles2::ContextCreationAttribHelper attributes; |
| 39 attributes.alpha_size = -1; | 37 attributes.alpha_size = -1; |
| 40 attributes.depth_size = 0; | 38 attributes.depth_size = 0; |
| 41 attributes.stencil_size = 0; | 39 attributes.stencil_size = 0; |
| 42 attributes.samples = 0; | 40 attributes.samples = 0; |
| 43 attributes.sample_buffers = 0; | 41 attributes.sample_buffers = 0; |
| 44 attributes.bind_generates_resource = false; | 42 attributes.bind_generates_resource = false; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 if (delegate_) | 157 if (delegate_) |
| 160 delegate_->OnVSyncParametersUpdated(timebase, interval); | 158 delegate_->OnVSyncParametersUpdated(timebase, interval); |
| 161 } | 159 } |
| 162 | 160 |
| 163 void SurfacesContextProvider::SetSwapBuffersCompletionCallback( | 161 void SurfacesContextProvider::SetSwapBuffersCompletionCallback( |
| 164 gl::GLSurface::SwapCompletionCallback callback) { | 162 gl::GLSurface::SwapCompletionCallback callback) { |
| 165 swap_buffers_completion_callback_ = callback; | 163 swap_buffers_completion_callback_ = callback; |
| 166 } | 164 } |
| 167 | 165 |
| 168 } // namespace ui | 166 } // namespace ui |
| OLD | NEW |