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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 83 |
84 void DidLoseOutputSurface() { lost_output_surface_ = true; } | 84 void DidLoseOutputSurface() { lost_output_surface_ = true; } |
85 | 85 |
86 int max_texture_size() const { return max_texture_size_; } | 86 int max_texture_size() const { return max_texture_size_; } |
87 ResourceFormat memory_efficient_texture_format() const { | 87 ResourceFormat memory_efficient_texture_format() const { |
88 return use_rgba_4444_texture_format_ ? RGBA_4444 : best_texture_format_; | 88 return use_rgba_4444_texture_format_ ? RGBA_4444 : best_texture_format_; |
89 } | 89 } |
90 ResourceFormat best_texture_format() const { return best_texture_format_; } | 90 ResourceFormat best_texture_format() const { return best_texture_format_; } |
91 size_t num_resources() const { return resources_.size(); } | 91 size_t num_resources() const { return resources_.size(); } |
92 | 92 |
| 93 unsigned num_gpu_rasterization_samples() const { |
| 94 return num_gpu_rasterization_samples_; |
| 95 } |
| 96 |
93 // Checks whether a resource is in use by a consumer. | 97 // Checks whether a resource is in use by a consumer. |
94 bool InUseByConsumer(ResourceId id); | 98 bool InUseByConsumer(ResourceId id); |
95 | 99 |
96 bool IsLost(ResourceId id); | 100 bool IsLost(ResourceId id); |
97 | 101 |
98 // Producer interface. | 102 // Producer interface. |
99 | 103 |
100 ResourceType default_resource_type() const { return default_resource_type_; } | 104 ResourceType default_resource_type() const { return default_resource_type_; } |
101 ResourceType GetResourceType(ResourceId id); | 105 ResourceType GetResourceType(ResourceId id); |
102 | 106 |
(...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 int next_child_; | 632 int next_child_; |
629 ChildMap children_; | 633 ChildMap children_; |
630 | 634 |
631 ResourceType default_resource_type_; | 635 ResourceType default_resource_type_; |
632 bool use_texture_storage_ext_; | 636 bool use_texture_storage_ext_; |
633 bool use_texture_usage_hint_; | 637 bool use_texture_usage_hint_; |
634 bool use_compressed_texture_etc1_; | 638 bool use_compressed_texture_etc1_; |
635 scoped_ptr<TextureUploader> texture_uploader_; | 639 scoped_ptr<TextureUploader> texture_uploader_; |
636 int max_texture_size_; | 640 int max_texture_size_; |
637 ResourceFormat best_texture_format_; | 641 ResourceFormat best_texture_format_; |
638 | 642 unsigned num_gpu_rasterization_samples_; |
639 base::ThreadChecker thread_checker_; | 643 base::ThreadChecker thread_checker_; |
640 | 644 |
641 scoped_refptr<Fence> current_read_lock_fence_; | 645 scoped_refptr<Fence> current_read_lock_fence_; |
642 bool use_rgba_4444_texture_format_; | 646 bool use_rgba_4444_texture_format_; |
643 | 647 |
644 const size_t id_allocation_chunk_size_; | 648 const size_t id_allocation_chunk_size_; |
645 scoped_ptr<IdAllocator> texture_id_allocator_; | 649 scoped_ptr<IdAllocator> texture_id_allocator_; |
646 scoped_ptr<IdAllocator> buffer_id_allocator_; | 650 scoped_ptr<IdAllocator> buffer_id_allocator_; |
647 | 651 |
648 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); | 652 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
690 return format_gl_data_format[format]; | 694 return format_gl_data_format[format]; |
691 } | 695 } |
692 | 696 |
693 inline GLenum GLInternalFormat(ResourceFormat format) { | 697 inline GLenum GLInternalFormat(ResourceFormat format) { |
694 return GLDataFormat(format); | 698 return GLDataFormat(format); |
695 } | 699 } |
696 | 700 |
697 } // namespace cc | 701 } // namespace cc |
698 | 702 |
699 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ | 703 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ |
OLD | NEW |