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 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 ResourceProvider::Resource* resource_; | 326 ResourceProvider::Resource* resource_; |
327 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; | 327 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager_; |
328 gfx::GpuMemoryBuffer* gpu_memory_buffer_; | 328 gfx::GpuMemoryBuffer* gpu_memory_buffer_; |
329 gfx::Size size_; | 329 gfx::Size size_; |
330 ResourceFormat format_; | 330 ResourceFormat format_; |
331 base::ThreadChecker thread_checker_; | 331 base::ThreadChecker thread_checker_; |
332 | 332 |
333 DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockGpuMemoryBuffer); | 333 DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockGpuMemoryBuffer); |
334 }; | 334 }; |
335 | 335 |
| 336 class CC_EXPORT ScopedReadLockGpuMemoryBuffer { |
| 337 public: |
| 338 ScopedReadLockGpuMemoryBuffer(ResourceProvider* resource_provider, |
| 339 ResourceProvider::ResourceId resource_id); |
| 340 ~ScopedReadLockGpuMemoryBuffer(); |
| 341 |
| 342 gfx::GpuMemoryBuffer* GetGpuMemoryBuffer(); |
| 343 |
| 344 private: |
| 345 ResourceProvider* resource_provider_; |
| 346 ResourceProvider::ResourceId resource_id_; |
| 347 gfx::GpuMemoryBuffer* gpu_memory_buffer_; |
| 348 base::ThreadChecker thread_checker_; |
| 349 |
| 350 DISALLOW_COPY_AND_ASSIGN(ScopedReadLockGpuMemoryBuffer); |
| 351 }; |
| 352 |
336 class CC_EXPORT ScopedWriteLockGr { | 353 class CC_EXPORT ScopedWriteLockGr { |
337 public: | 354 public: |
338 ScopedWriteLockGr(ResourceProvider* resource_provider, | 355 ScopedWriteLockGr(ResourceProvider* resource_provider, |
339 ResourceProvider::ResourceId resource_id); | 356 ResourceProvider::ResourceId resource_id); |
340 ~ScopedWriteLockGr(); | 357 ~ScopedWriteLockGr(); |
341 | 358 |
342 void InitSkSurface(bool use_distance_field_text, | 359 void InitSkSurface(bool use_distance_field_text, |
343 bool can_use_lcd_text, | 360 bool can_use_lcd_text, |
344 int msaa_sample_count); | 361 int msaa_sample_count); |
345 void ReleaseSkSurface(); | 362 void ReleaseSkSurface(); |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
659 return format_gl_data_format[format]; | 676 return format_gl_data_format[format]; |
660 } | 677 } |
661 | 678 |
662 inline GLenum GLInternalFormat(ResourceFormat format) { | 679 inline GLenum GLInternalFormat(ResourceFormat format) { |
663 return GLDataFormat(format); | 680 return GLDataFormat(format); |
664 } | 681 } |
665 | 682 |
666 } // namespace cc | 683 } // namespace cc |
667 | 684 |
668 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ | 685 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ |
OLD | NEW |