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 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 | 298 |
299 private: | 299 private: |
300 ResourceProvider* resource_provider_; | 300 ResourceProvider* resource_provider_; |
301 ResourceProvider::ResourceId resource_id_; | 301 ResourceProvider::ResourceId resource_id_; |
302 SkBitmap sk_bitmap_; | 302 SkBitmap sk_bitmap_; |
303 scoped_ptr<SkCanvas> sk_canvas_; | 303 scoped_ptr<SkCanvas> sk_canvas_; |
304 | 304 |
305 DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockSoftware); | 305 DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockSoftware); |
306 }; | 306 }; |
307 | 307 |
| 308 class CC_EXPORT ScopedExportLock { |
| 309 public: |
| 310 ScopedExportLock(ResourceProvider* resource_provider, |
| 311 ResourceProvider::ResourceId resource_id); |
| 312 virtual ~ScopedExportLock(); |
| 313 |
| 314 const gpu::Mailbox& GetMailbox() const; |
| 315 |
| 316 protected: |
| 317 ResourceProvider* resource_provider_; |
| 318 ResourceProvider::ResourceId resource_id_; |
| 319 |
| 320 private: |
| 321 DISALLOW_COPY_AND_ASSIGN(ScopedExportLock); |
| 322 }; |
| 323 |
308 class Fence : public base::RefCounted<Fence> { | 324 class Fence : public base::RefCounted<Fence> { |
309 public: | 325 public: |
310 Fence() {} | 326 Fence() {} |
311 virtual bool HasPassed() = 0; | 327 virtual bool HasPassed() = 0; |
312 | 328 |
313 protected: | 329 protected: |
314 friend class base::RefCounted<Fence>; | 330 friend class base::RefCounted<Fence>; |
315 virtual ~Fence() {} | 331 virtual ~Fence() {} |
316 | 332 |
317 private: | 333 private: |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
565 bool use_rgba_4444_texture_format, | 581 bool use_rgba_4444_texture_format, |
566 size_t id_allocation_chunk_size); | 582 size_t id_allocation_chunk_size); |
567 | 583 |
568 void CleanUpGLIfNeeded(); | 584 void CleanUpGLIfNeeded(); |
569 | 585 |
570 Resource* GetResource(ResourceId id); | 586 Resource* GetResource(ResourceId id); |
571 const Resource* LockForRead(ResourceId id); | 587 const Resource* LockForRead(ResourceId id); |
572 void UnlockForRead(ResourceId id); | 588 void UnlockForRead(ResourceId id); |
573 const Resource* LockForWrite(ResourceId id); | 589 const Resource* LockForWrite(ResourceId id); |
574 void UnlockForWrite(ResourceId id); | 590 void UnlockForWrite(ResourceId id); |
| 591 const Resource* LockForExport(ResourceId id); |
| 592 void UnlockForExport(ResourceId id); |
575 static void PopulateSkBitmapWithResource(SkBitmap* sk_bitmap, | 593 static void PopulateSkBitmapWithResource(SkBitmap* sk_bitmap, |
576 const Resource* resource); | 594 const Resource* resource); |
577 | 595 |
578 void TransferResource(gpu::gles2::GLES2Interface* gl, | 596 void TransferResource(gpu::gles2::GLES2Interface* gl, |
579 ResourceId id, | 597 ResourceId id, |
580 TransferableResource* resource); | 598 TransferableResource* resource); |
581 enum DeleteStyle { | 599 enum DeleteStyle { |
582 Normal, | 600 Normal, |
583 ForShutdown, | 601 ForShutdown, |
584 }; | 602 }; |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 return format_gl_data_format[format]; | 710 return format_gl_data_format[format]; |
693 } | 711 } |
694 | 712 |
695 inline GLenum GLInternalFormat(ResourceFormat format) { | 713 inline GLenum GLInternalFormat(ResourceFormat format) { |
696 return GLDataFormat(format); | 714 return GLDataFormat(format); |
697 } | 715 } |
698 | 716 |
699 } // namespace cc | 717 } // namespace cc |
700 | 718 |
701 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ | 719 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ |
OLD | NEW |