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 <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 // GLInProcessContext implementation: | 66 // GLInProcessContext implementation: |
67 void SetContextLostCallback(const base::Closure& callback) override; | 67 void SetContextLostCallback(const base::Closure& callback) override; |
68 gles2::GLES2Implementation* GetImplementation() override; | 68 gles2::GLES2Implementation* GetImplementation() override; |
69 size_t GetMappedMemoryLimit() override; | 69 size_t GetMappedMemoryLimit() override; |
70 void SetLock(base::Lock* lock) override; | 70 void SetLock(base::Lock* lock) override; |
71 | 71 |
72 #if defined(OS_ANDROID) | 72 #if defined(OS_ANDROID) |
73 scoped_refptr<gfx::SurfaceTexture> GetSurfaceTexture( | 73 scoped_refptr<gfx::SurfaceTexture> GetSurfaceTexture( |
74 uint32 stream_id) override; | 74 uint32 stream_id) override; |
75 #endif | 75 #endif |
| 76 uint32 CreateStreamTexture(uint32 texture_id) override; |
76 | 77 |
77 private: | 78 private: |
78 void Destroy(); | 79 void Destroy(); |
79 void OnContextLost(); | 80 void OnContextLost(); |
80 void OnSignalSyncPoint(const base::Closure& callback); | 81 void OnSignalSyncPoint(const base::Closure& callback); |
81 | 82 |
82 scoped_ptr<gles2::GLES2CmdHelper> gles2_helper_; | 83 scoped_ptr<gles2::GLES2CmdHelper> gles2_helper_; |
83 scoped_ptr<TransferBuffer> transfer_buffer_; | 84 scoped_ptr<TransferBuffer> transfer_buffer_; |
84 scoped_ptr<gles2::GLES2Implementation> gles2_implementation_; | 85 scoped_ptr<gles2::GLES2Implementation> gles2_implementation_; |
85 scoped_ptr<InProcessCommandBuffer> command_buffer_; | 86 scoped_ptr<InProcessCommandBuffer> command_buffer_; |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 command_buffer_.reset(); | 262 command_buffer_.reset(); |
262 } | 263 } |
263 | 264 |
264 #if defined(OS_ANDROID) | 265 #if defined(OS_ANDROID) |
265 scoped_refptr<gfx::SurfaceTexture> | 266 scoped_refptr<gfx::SurfaceTexture> |
266 GLInProcessContextImpl::GetSurfaceTexture(uint32 stream_id) { | 267 GLInProcessContextImpl::GetSurfaceTexture(uint32 stream_id) { |
267 return command_buffer_->GetSurfaceTexture(stream_id); | 268 return command_buffer_->GetSurfaceTexture(stream_id); |
268 } | 269 } |
269 #endif | 270 #endif |
270 | 271 |
| 272 uint32 GLInProcessContextImpl::CreateStreamTexture(uint32 texture_id) { |
| 273 return command_buffer_->CreateStreamTexture(texture_id); |
| 274 } |
| 275 |
271 } // anonymous namespace | 276 } // anonymous namespace |
272 | 277 |
273 GLInProcessContextSharedMemoryLimits::GLInProcessContextSharedMemoryLimits() | 278 GLInProcessContextSharedMemoryLimits::GLInProcessContextSharedMemoryLimits() |
274 : command_buffer_size(kDefaultCommandBufferSize), | 279 : command_buffer_size(kDefaultCommandBufferSize), |
275 start_transfer_buffer_size(kDefaultStartTransferBufferSize), | 280 start_transfer_buffer_size(kDefaultStartTransferBufferSize), |
276 min_transfer_buffer_size(kDefaultMinTransferBufferSize), | 281 min_transfer_buffer_size(kDefaultMinTransferBufferSize), |
277 max_transfer_buffer_size(kDefaultMaxTransferBufferSize), | 282 max_transfer_buffer_size(kDefaultMaxTransferBufferSize), |
278 mapped_memory_reclaim_limit(gles2::GLES2Implementation::kNoLimit) { | 283 mapped_memory_reclaim_limit(gles2::GLES2Implementation::kNoLimit) { |
279 } | 284 } |
280 | 285 |
(...skipping 30 matching lines...) Expand all Loading... |
311 gpu_preference, | 316 gpu_preference, |
312 service, | 317 service, |
313 gpu_memory_buffer_manager, | 318 gpu_memory_buffer_manager, |
314 image_factory)) | 319 image_factory)) |
315 return NULL; | 320 return NULL; |
316 | 321 |
317 return context.release(); | 322 return context.release(); |
318 } | 323 } |
319 | 324 |
320 } // namespace gpu | 325 } // namespace gpu |
OLD | NEW |