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 "gpu/ipc/gl_in_process_context.h" | 5 #include "gpu/ipc/gl_in_process_context.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // GLInProcessContext implementation: | 65 // GLInProcessContext implementation: |
66 gpu::Capabilities GetCapabilities() override; | 66 gpu::Capabilities GetCapabilities() override; |
67 gles2::GLES2Implementation* GetImplementation() override; | 67 gles2::GLES2Implementation* GetImplementation() override; |
68 void SetSwapBuffersCompletionCallback( | 68 void SetSwapBuffersCompletionCallback( |
69 const gpu::InProcessCommandBuffer::SwapBuffersCompletionCallback& | 69 const gpu::InProcessCommandBuffer::SwapBuffersCompletionCallback& |
70 callback) override; | 70 callback) override; |
71 void SetUpdateVSyncParametersCallback( | 71 void SetUpdateVSyncParametersCallback( |
72 const gpu::InProcessCommandBuffer::UpdateVSyncParametersCallback& | 72 const gpu::InProcessCommandBuffer::UpdateVSyncParametersCallback& |
73 callback) override; | 73 callback) override; |
74 void SetLock(base::Lock* lock) override; | 74 void SetLock(base::Lock* lock) override; |
| 75 void SetLatencyInfo( |
| 76 const std::vector<ui::LatencyInfo>& latency_info) override; |
75 | 77 |
76 private: | 78 private: |
77 void Destroy(); | 79 void Destroy(); |
78 void OnSignalSyncPoint(const base::Closure& callback); | 80 void OnSignalSyncPoint(const base::Closure& callback); |
79 | 81 |
80 std::unique_ptr<gles2::GLES2CmdHelper> gles2_helper_; | 82 std::unique_ptr<gles2::GLES2CmdHelper> gles2_helper_; |
81 std::unique_ptr<TransferBuffer> transfer_buffer_; | 83 std::unique_ptr<TransferBuffer> transfer_buffer_; |
82 std::unique_ptr<gles2::GLES2Implementation> gles2_implementation_; | 84 std::unique_ptr<gles2::GLES2Implementation> gles2_implementation_; |
83 std::unique_ptr<InProcessCommandBuffer> command_buffer_; | 85 std::unique_ptr<InProcessCommandBuffer> command_buffer_; |
84 | 86 |
(...skipping 23 matching lines...) Expand all Loading... |
108 void GLInProcessContextImpl::SetUpdateVSyncParametersCallback( | 110 void GLInProcessContextImpl::SetUpdateVSyncParametersCallback( |
109 const gpu::InProcessCommandBuffer::UpdateVSyncParametersCallback& | 111 const gpu::InProcessCommandBuffer::UpdateVSyncParametersCallback& |
110 callback) { | 112 callback) { |
111 command_buffer_->SetUpdateVSyncParametersCallback(callback); | 113 command_buffer_->SetUpdateVSyncParametersCallback(callback); |
112 } | 114 } |
113 | 115 |
114 void GLInProcessContextImpl::SetLock(base::Lock* lock) { | 116 void GLInProcessContextImpl::SetLock(base::Lock* lock) { |
115 NOTREACHED(); | 117 NOTREACHED(); |
116 } | 118 } |
117 | 119 |
| 120 void GLInProcessContextImpl::SetLatencyInfo( |
| 121 const std::vector<ui::LatencyInfo>& latency_info) { |
| 122 return command_buffer_->SetLatencyInfo(latency_info); |
| 123 } |
| 124 |
118 bool GLInProcessContextImpl::Initialize( | 125 bool GLInProcessContextImpl::Initialize( |
119 scoped_refptr<gl::GLSurface> surface, | 126 scoped_refptr<gl::GLSurface> surface, |
120 bool is_offscreen, | 127 bool is_offscreen, |
121 GLInProcessContext* share_context, | 128 GLInProcessContext* share_context, |
122 SurfaceHandle window, | 129 SurfaceHandle window, |
123 const gles2::ContextCreationAttribHelper& attribs, | 130 const gles2::ContextCreationAttribHelper& attribs, |
124 const scoped_refptr<InProcessCommandBuffer::Service>& service, | 131 const scoped_refptr<InProcessCommandBuffer::Service>& service, |
125 const SharedMemoryLimits& mem_limits, | 132 const SharedMemoryLimits& mem_limits, |
126 GpuMemoryBufferManager* gpu_memory_buffer_manager, | 133 GpuMemoryBufferManager* gpu_memory_buffer_manager, |
127 ImageFactory* image_factory, | 134 ImageFactory* image_factory, |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 if (!context->Initialize(surface, is_offscreen, share_context, window, | 233 if (!context->Initialize(surface, is_offscreen, share_context, window, |
227 attribs, service, memory_limits, | 234 attribs, service, memory_limits, |
228 gpu_memory_buffer_manager, image_factory, | 235 gpu_memory_buffer_manager, image_factory, |
229 std::move(task_runner))) | 236 std::move(task_runner))) |
230 return NULL; | 237 return NULL; |
231 | 238 |
232 return context.release(); | 239 return context.release(); |
233 } | 240 } |
234 | 241 |
235 } // namespace gpu | 242 } // namespace gpu |
OLD | NEW |