| 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" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 | 28 |
| 29 namespace ui { | 29 namespace ui { |
| 30 | 30 |
| 31 SurfacesContextProvider::SurfacesContextProvider( | 31 SurfacesContextProvider::SurfacesContextProvider( |
| 32 gfx::AcceleratedWidget widget, | 32 gfx::AcceleratedWidget widget, |
| 33 const scoped_refptr<GpuState>& state) | 33 const scoped_refptr<GpuState>& state) |
| 34 : use_chrome_gpu_command_buffer_(false), | 34 : use_chrome_gpu_command_buffer_(false), |
| 35 delegate_(nullptr), | 35 delegate_(nullptr), |
| 36 widget_(widget), | 36 widget_(widget), |
| 37 command_buffer_local_(nullptr) { | 37 command_buffer_local_(nullptr) { |
| 38 // TODO(penghuang): Kludge: Use mojo command buffer when running on Windows | |
| 39 // since Chrome command buffer breaks unit tests | |
| 40 #if defined(OS_WIN) | |
| 41 use_chrome_gpu_command_buffer_ = false; | |
| 42 #else | |
| 43 use_chrome_gpu_command_buffer_ = | 38 use_chrome_gpu_command_buffer_ = |
| 44 !base::CommandLine::ForCurrentProcess()->HasSwitch( | 39 !base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 45 switches::kUseMojoGpuCommandBufferInMus); | 40 switches::kUseMojoGpuCommandBufferInMus); |
| 46 #endif | |
| 47 if (!use_chrome_gpu_command_buffer_) { | 41 if (!use_chrome_gpu_command_buffer_) { |
| 48 command_buffer_local_ = new CommandBufferLocal(this, widget_, state); | 42 command_buffer_local_ = new CommandBufferLocal(this, widget_, state); |
| 49 } else { | 43 } else { |
| 50 GpuServiceMus* service = GpuServiceMus::GetInstance(); | 44 GpuServiceMus* service = GpuServiceMus::GetInstance(); |
| 51 gpu::CommandBufferProxyImpl* shared_command_buffer = nullptr; | 45 gpu::CommandBufferProxyImpl* shared_command_buffer = nullptr; |
| 52 gpu::GpuStreamId stream_id = gpu::GpuStreamId::GPU_STREAM_DEFAULT; | 46 gpu::GpuStreamId stream_id = gpu::GpuStreamId::GPU_STREAM_DEFAULT; |
| 53 gpu::GpuStreamPriority stream_priority = gpu::GpuStreamPriority::NORMAL; | 47 gpu::GpuStreamPriority stream_priority = gpu::GpuStreamPriority::NORMAL; |
| 54 gpu::gles2::ContextCreationAttribHelper attributes; | 48 gpu::gles2::ContextCreationAttribHelper attributes; |
| 55 attributes.alpha_size = -1; | 49 attributes.alpha_size = -1; |
| 56 attributes.depth_size = 0; | 50 attributes.depth_size = 0; |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 if (delegate_) | 191 if (delegate_) |
| 198 delegate_->OnVSyncParametersUpdated(timebase, interval); | 192 delegate_->OnVSyncParametersUpdated(timebase, interval); |
| 199 } | 193 } |
| 200 | 194 |
| 201 void SurfacesContextProvider::SetSwapBuffersCompletionCallback( | 195 void SurfacesContextProvider::SetSwapBuffersCompletionCallback( |
| 202 gl::GLSurface::SwapCompletionCallback callback) { | 196 gl::GLSurface::SwapCompletionCallback callback) { |
| 203 swap_buffers_completion_callback_ = callback; | 197 swap_buffers_completion_callback_ = callback; |
| 204 } | 198 } |
| 205 | 199 |
| 206 } // namespace ui | 200 } // namespace ui |
| OLD | NEW |