Chromium Code Reviews| 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 |
| 204 /* | |
| 210 #if defined(OS_ANDROID) | 205 #if defined(OS_ANDROID) |
|
no sievers
2016/04/18 23:00:50
you forgot to remove this block after commenting i
boliu
2016/04/18 23:05:06
Oops, removed
| |
| 211 scoped_refptr<gfx::SurfaceTexture> GLInProcessContextImpl::GetSurfaceTexture( | 206 scoped_refptr<gfx::SurfaceTexture> GLInProcessContextImpl::GetSurfaceTexture( |
| 212 uint32_t stream_id) { | 207 uint32_t stream_id) { |
| 213 return command_buffer_->GetSurfaceTexture(stream_id); | 208 return command_buffer_->GetSurfaceTexture(stream_id); |
| 214 } | 209 } |
| 215 | 210 |
| 216 uint32_t GLInProcessContextImpl::CreateStreamTexture(uint32_t texture_id) { | 211 uint32_t GLInProcessContextImpl::CreateStreamTexture(uint32_t texture_id) { |
| 217 return command_buffer_->CreateStreamTexture(texture_id); | 212 return command_buffer_->CreateStreamTexture(texture_id); |
| 218 } | 213 } |
| 219 #endif | 214 #endif |
| 215 */ | |
| 220 | 216 |
| 221 } // anonymous namespace | 217 } // anonymous namespace |
| 222 | 218 |
| 223 GLInProcessContextSharedMemoryLimits::GLInProcessContextSharedMemoryLimits() | 219 GLInProcessContextSharedMemoryLimits::GLInProcessContextSharedMemoryLimits() |
| 224 : command_buffer_size(kDefaultCommandBufferSize), | 220 : command_buffer_size(kDefaultCommandBufferSize), |
| 225 start_transfer_buffer_size(kDefaultStartTransferBufferSize), | 221 start_transfer_buffer_size(kDefaultStartTransferBufferSize), |
| 226 min_transfer_buffer_size(kDefaultMinTransferBufferSize), | 222 min_transfer_buffer_size(kDefaultMinTransferBufferSize), |
| 227 max_transfer_buffer_size(kDefaultMaxTransferBufferSize), | 223 max_transfer_buffer_size(kDefaultMaxTransferBufferSize), |
| 228 mapped_memory_reclaim_limit(gles2::GLES2Implementation::kNoLimit) { | 224 mapped_memory_reclaim_limit(gles2::GLES2Implementation::kNoLimit) { |
| 229 } | 225 } |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 258 gpu_preference, | 254 gpu_preference, |
| 259 service, | 255 service, |
| 260 gpu_memory_buffer_manager, | 256 gpu_memory_buffer_manager, |
| 261 image_factory)) | 257 image_factory)) |
| 262 return NULL; | 258 return NULL; |
| 263 | 259 |
| 264 return context.release(); | 260 return context.release(); |
| 265 } | 261 } |
| 266 | 262 |
| 267 } // namespace gpu | 263 } // namespace gpu |
| OLD | NEW |