OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #ifndef CC_RESOURCES_RESOURCE_PROVIDER_H_ | 5 #ifndef CC_RESOURCES_RESOURCE_PROVIDER_H_ |
6 #define CC_RESOURCES_RESOURCE_PROVIDER_H_ | 6 #define CC_RESOURCES_RESOURCE_PROVIDER_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
312 | 312 |
313 DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockSoftware); | 313 DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockSoftware); |
314 }; | 314 }; |
315 | 315 |
316 class CC_EXPORT ScopedWriteLockGpuMemoryBuffer { | 316 class CC_EXPORT ScopedWriteLockGpuMemoryBuffer { |
317 public: | 317 public: |
318 ScopedWriteLockGpuMemoryBuffer(ResourceProvider* resource_provider, | 318 ScopedWriteLockGpuMemoryBuffer(ResourceProvider* resource_provider, |
319 ResourceId resource_id); | 319 ResourceId resource_id); |
320 ~ScopedWriteLockGpuMemoryBuffer(); | 320 ~ScopedWriteLockGpuMemoryBuffer(); |
321 | 321 |
322 gfx::GpuMemoryBuffer* GetGpuMemoryBuffer(); | 322 // If |persistent| is true, the contents of the buffer will remain the same |
323 // each time you lock and use it. | |
324 bool AllocateGpuMemoryBuffer(bool persistent); | |
reveman
2015/05/22 17:15:13
To allocate with MAP_PERSISTENT usage or not is NO
danakj
2015/05/26 19:02:52
Ah, ya okay that sounds good.
danakj
2015/05/26 23:37:34
Done.
| |
325 | |
326 gfx::GpuMemoryBuffer* gpu_memory_buffer() { return gpu_memory_buffer_; } | |
323 | 327 |
324 private: | 328 private: |
325 ResourceProvider* resource_provider_; | 329 ResourceProvider* resource_provider_; |
326 ResourceProvider::Resource* resource_; | 330 ResourceProvider::Resource* resource_; |
327 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; | 331 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; |
328 gfx::GpuMemoryBuffer* gpu_memory_buffer_; | 332 gfx::GpuMemoryBuffer* gpu_memory_buffer_; |
329 gfx::Size size_; | 333 gfx::Size size_; |
330 ResourceFormat format_; | 334 ResourceFormat format_; |
331 base::ThreadChecker thread_checker_; | 335 base::ThreadChecker thread_checker_; |
332 | 336 |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
659 return format_gl_data_format[format]; | 663 return format_gl_data_format[format]; |
660 } | 664 } |
661 | 665 |
662 inline GLenum GLInternalFormat(ResourceFormat format) { | 666 inline GLenum GLInternalFormat(ResourceFormat format) { |
663 return GLDataFormat(format); | 667 return GLDataFormat(format); |
664 } | 668 } |
665 | 669 |
666 } // namespace cc | 670 } // namespace cc |
667 | 671 |
668 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ | 672 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ |
OLD | NEW |