| 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/command_buffer/client/gl_in_process_context.h" | 5 #include "gpu/command_buffer/client/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 <set> | 10 #include <set> |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 gfx::GpuPreference gpu_preference, | 64 gfx::GpuPreference gpu_preference, |
| 65 const scoped_refptr<InProcessCommandBuffer::Service>& service, | 65 const scoped_refptr<InProcessCommandBuffer::Service>& service, |
| 66 GpuMemoryBufferManager* gpu_memory_buffer_manager, | 66 GpuMemoryBufferManager* gpu_memory_buffer_manager, |
| 67 ImageFactory* image_factory); | 67 ImageFactory* image_factory); |
| 68 | 68 |
| 69 // GLInProcessContext implementation: | 69 // GLInProcessContext implementation: |
| 70 gles2::GLES2Implementation* GetImplementation() override; | 70 gles2::GLES2Implementation* GetImplementation() override; |
| 71 size_t GetMappedMemoryLimit() override; | 71 size_t GetMappedMemoryLimit() override; |
| 72 void SetLock(base::Lock* lock) override; | 72 void SetLock(base::Lock* lock) override; |
| 73 | 73 |
| 74 #if defined(OS_ANDROID) | |
| 75 scoped_refptr<gfx::SurfaceTexture> GetSurfaceTexture( | |
| 76 uint32_t stream_id) override; | |
| 77 uint32_t CreateStreamTexture(uint32_t texture_id) override; | |
| 78 #endif | |
| 79 | |
| 80 private: | 74 private: |
| 81 void Destroy(); | 75 void Destroy(); |
| 82 void OnSignalSyncPoint(const base::Closure& callback); | 76 void OnSignalSyncPoint(const base::Closure& callback); |
| 83 | 77 |
| 84 scoped_ptr<gles2::GLES2CmdHelper> gles2_helper_; | 78 scoped_ptr<gles2::GLES2CmdHelper> gles2_helper_; |
| 85 scoped_ptr<TransferBuffer> transfer_buffer_; | 79 scoped_ptr<TransferBuffer> transfer_buffer_; |
| 86 scoped_ptr<gles2::GLES2Implementation> gles2_implementation_; | 80 scoped_ptr<gles2::GLES2Implementation> gles2_implementation_; |
| 87 scoped_ptr<InProcessCommandBuffer> command_buffer_; | 81 scoped_ptr<InProcessCommandBuffer> command_buffer_; |
| 88 | 82 |
| 89 const GLInProcessContextSharedMemoryLimits mem_limits_; | 83 const GLInProcessContextSharedMemoryLimits mem_limits_; |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 gles2_implementation_->Flush(); | 194 gles2_implementation_->Flush(); |
| 201 | 195 |
| 202 gles2_implementation_.reset(); | 196 gles2_implementation_.reset(); |
| 203 } | 197 } |
| 204 | 198 |
| 205 transfer_buffer_.reset(); | 199 transfer_buffer_.reset(); |
| 206 gles2_helper_.reset(); | 200 gles2_helper_.reset(); |
| 207 command_buffer_.reset(); | 201 command_buffer_.reset(); |
| 208 } | 202 } |
| 209 | 203 |
| 210 #if defined(OS_ANDROID) | |
| 211 scoped_refptr<gfx::SurfaceTexture> GLInProcessContextImpl::GetSurfaceTexture( | |
| 212 uint32_t stream_id) { | |
| 213 return command_buffer_->GetSurfaceTexture(stream_id); | |
| 214 } | |
| 215 | |
| 216 uint32_t GLInProcessContextImpl::CreateStreamTexture(uint32_t texture_id) { | |
| 217 return command_buffer_->CreateStreamTexture(texture_id); | |
| 218 } | |
| 219 #endif | |
| 220 | |
| 221 } // anonymous namespace | 204 } // anonymous namespace |
| 222 | 205 |
| 223 GLInProcessContextSharedMemoryLimits::GLInProcessContextSharedMemoryLimits() | 206 GLInProcessContextSharedMemoryLimits::GLInProcessContextSharedMemoryLimits() |
| 224 : command_buffer_size(kDefaultCommandBufferSize), | 207 : command_buffer_size(kDefaultCommandBufferSize), |
| 225 start_transfer_buffer_size(kDefaultStartTransferBufferSize), | 208 start_transfer_buffer_size(kDefaultStartTransferBufferSize), |
| 226 min_transfer_buffer_size(kDefaultMinTransferBufferSize), | 209 min_transfer_buffer_size(kDefaultMinTransferBufferSize), |
| 227 max_transfer_buffer_size(kDefaultMaxTransferBufferSize), | 210 max_transfer_buffer_size(kDefaultMaxTransferBufferSize), |
| 228 mapped_memory_reclaim_limit(gles2::GLES2Implementation::kNoLimit) { | 211 mapped_memory_reclaim_limit(gles2::GLES2Implementation::kNoLimit) { |
| 229 } | 212 } |
| 230 | 213 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 258 gpu_preference, | 241 gpu_preference, |
| 259 service, | 242 service, |
| 260 gpu_memory_buffer_manager, | 243 gpu_memory_buffer_manager, |
| 261 image_factory)) | 244 image_factory)) |
| 262 return NULL; | 245 return NULL; |
| 263 | 246 |
| 264 return context.release(); | 247 return context.release(); |
| 265 } | 248 } |
| 266 | 249 |
| 267 } // namespace gpu | 250 } // namespace gpu |
| OLD | NEW |