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 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 gfx::Size size_; | 325 gfx::Size size_; |
326 ResourceFormat format_; | 326 ResourceFormat format_; |
327 base::ThreadChecker thread_checker_; | 327 base::ThreadChecker thread_checker_; |
328 | 328 |
329 DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockGpuMemoryBuffer); | 329 DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockGpuMemoryBuffer); |
330 }; | 330 }; |
331 | 331 |
332 class CC_EXPORT ScopedWriteLockGr { | 332 class CC_EXPORT ScopedWriteLockGr { |
333 public: | 333 public: |
334 ScopedWriteLockGr(ResourceProvider* resource_provider, | 334 ScopedWriteLockGr(ResourceProvider* resource_provider, |
335 ResourceProvider::ResourceId resource_id); | 335 ResourceProvider::ResourceId resource_id, |
| 336 bool use_distance_field_text, |
| 337 bool can_use_lcd_text, |
| 338 int msaa_sample_count); |
336 ~ScopedWriteLockGr(); | 339 ~ScopedWriteLockGr(); |
337 | 340 |
338 SkSurface* GetSkSurface(bool use_distance_field_text, | 341 SkSurface* get_sk_surface() { return sk_surface_.get(); } |
339 bool can_use_lcd_text, | |
340 int msaa_sample_count); | |
341 | 342 |
342 private: | 343 private: |
343 bool SurfaceHasMatchingProperties(bool use_distance_field_text, | |
344 bool can_use_lcd_text) const; | |
345 | |
346 ResourceProvider* resource_provider_; | 344 ResourceProvider* resource_provider_; |
347 ResourceProvider::Resource* resource_; | 345 ResourceProvider::Resource* resource_; |
348 base::ThreadChecker thread_checker_; | 346 base::ThreadChecker thread_checker_; |
| 347 skia::RefPtr<SkSurface> sk_surface_; |
349 | 348 |
350 DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockGr); | 349 DISALLOW_COPY_AND_ASSIGN(ScopedWriteLockGr); |
351 }; | 350 }; |
352 | 351 |
353 class Fence : public base::RefCounted<Fence> { | 352 class Fence : public base::RefCounted<Fence> { |
354 public: | 353 public: |
355 Fence() {} | 354 Fence() {} |
356 | 355 |
357 virtual void Set() = 0; | 356 virtual void Set() = 0; |
358 virtual bool HasPassed() = 0; | 357 virtual bool HasPassed() = 0; |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
488 unsigned image_id; | 487 unsigned image_id; |
489 unsigned bound_image_id; | 488 unsigned bound_image_id; |
490 GLenum texture_pool; | 489 GLenum texture_pool; |
491 GLint wrap_mode; | 490 GLint wrap_mode; |
492 TextureHint hint; | 491 TextureHint hint; |
493 ResourceType type; | 492 ResourceType type; |
494 ResourceFormat format; | 493 ResourceFormat format; |
495 SharedBitmapId shared_bitmap_id; | 494 SharedBitmapId shared_bitmap_id; |
496 SharedBitmap* shared_bitmap; | 495 SharedBitmap* shared_bitmap; |
497 gfx::GpuMemoryBuffer* gpu_memory_buffer; | 496 gfx::GpuMemoryBuffer* gpu_memory_buffer; |
498 skia::RefPtr<SkSurface> sk_surface; | |
499 }; | 497 }; |
500 typedef base::hash_map<ResourceId, Resource> ResourceMap; | 498 typedef base::hash_map<ResourceId, Resource> ResourceMap; |
501 | 499 |
502 static bool CompareResourceMapIteratorsByChildId( | 500 static bool CompareResourceMapIteratorsByChildId( |
503 const std::pair<ReturnedResource, ResourceMap::iterator>& a, | 501 const std::pair<ReturnedResource, ResourceMap::iterator>& a, |
504 const std::pair<ReturnedResource, ResourceMap::iterator>& b); | 502 const std::pair<ReturnedResource, ResourceMap::iterator>& b); |
505 | 503 |
506 struct Child { | 504 struct Child { |
507 Child(); | 505 Child(); |
508 ~Child(); | 506 ~Child(); |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 return format_gl_data_format[format]; | 650 return format_gl_data_format[format]; |
653 } | 651 } |
654 | 652 |
655 inline GLenum GLInternalFormat(ResourceFormat format) { | 653 inline GLenum GLInternalFormat(ResourceFormat format) { |
656 return GLDataFormat(format); | 654 return GLDataFormat(format); |
657 } | 655 } |
658 | 656 |
659 } // namespace cc | 657 } // namespace cc |
660 | 658 |
661 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ | 659 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ |
OLD | NEW |