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 <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 102 |
103 void Initialize(); | 103 void Initialize(); |
104 | 104 |
105 void DidLoseContextProvider() { lost_context_provider_ = true; } | 105 void DidLoseContextProvider() { lost_context_provider_ = true; } |
106 | 106 |
107 int max_texture_size() const { return max_texture_size_; } | 107 int max_texture_size() const { return max_texture_size_; } |
108 ResourceFormat best_texture_format() const { return best_texture_format_; } | 108 ResourceFormat best_texture_format() const { return best_texture_format_; } |
109 ResourceFormat best_render_buffer_format() const { | 109 ResourceFormat best_render_buffer_format() const { |
110 return best_render_buffer_format_; | 110 return best_render_buffer_format_; |
111 } | 111 } |
| 112 ResourceFormat YuvResourceFormat(int bits) const; |
112 bool use_sync_query() const { return use_sync_query_; } | 113 bool use_sync_query() const { return use_sync_query_; } |
113 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager() { | 114 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager() { |
114 return gpu_memory_buffer_manager_; | 115 return gpu_memory_buffer_manager_; |
115 } | 116 } |
116 size_t num_resources() const { return resources_.size(); } | 117 size_t num_resources() const { return resources_.size(); } |
117 | 118 |
118 bool IsResourceFormatSupported(ResourceFormat format) const; | 119 bool IsResourceFormatSupported(ResourceFormat format) const; |
119 | 120 |
120 // Checks whether a resource is in use by a consumer. | 121 // Checks whether a resource is in use by a consumer. |
121 bool InUseByConsumer(ResourceId id); | 122 bool InUseByConsumer(ResourceId id); |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 int next_child_; | 690 int next_child_; |
690 ChildMap children_; | 691 ChildMap children_; |
691 | 692 |
692 const bool delegated_sync_points_required_; | 693 const bool delegated_sync_points_required_; |
693 | 694 |
694 ResourceType default_resource_type_; | 695 ResourceType default_resource_type_; |
695 bool use_texture_storage_ext_; | 696 bool use_texture_storage_ext_; |
696 bool use_texture_format_bgra_; | 697 bool use_texture_format_bgra_; |
697 bool use_texture_usage_hint_; | 698 bool use_texture_usage_hint_; |
698 bool use_compressed_texture_etc1_; | 699 bool use_compressed_texture_etc1_; |
| 700 ResourceFormat yuv_resource_format_; |
| 701 ResourceFormat yuv_highbit_resource_format_; |
699 int max_texture_size_; | 702 int max_texture_size_; |
700 ResourceFormat best_texture_format_; | 703 ResourceFormat best_texture_format_; |
701 ResourceFormat best_render_buffer_format_; | 704 ResourceFormat best_render_buffer_format_; |
702 const bool enable_color_correct_rendering_ = false; | 705 const bool enable_color_correct_rendering_ = false; |
703 | 706 |
704 base::ThreadChecker thread_checker_; | 707 base::ThreadChecker thread_checker_; |
705 | 708 |
706 scoped_refptr<Fence> current_read_lock_fence_; | 709 scoped_refptr<Fence> current_read_lock_fence_; |
707 | 710 |
708 const size_t id_allocation_chunk_size_; | 711 const size_t id_allocation_chunk_size_; |
709 std::unique_ptr<IdAllocator> texture_id_allocator_; | 712 std::unique_ptr<IdAllocator> texture_id_allocator_; |
710 std::unique_ptr<IdAllocator> buffer_id_allocator_; | 713 std::unique_ptr<IdAllocator> buffer_id_allocator_; |
711 | 714 |
712 bool use_sync_query_; | 715 bool use_sync_query_; |
713 BufferToTextureTargetMap buffer_to_texture_target_map_; | 716 BufferToTextureTargetMap buffer_to_texture_target_map_; |
714 | 717 |
715 // A process-unique ID used for disambiguating memory dumps from different | 718 // A process-unique ID used for disambiguating memory dumps from different |
716 // resource providers. | 719 // resource providers. |
717 int tracing_id_; | 720 int tracing_id_; |
718 | 721 |
719 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); | 722 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); |
720 }; | 723 }; |
721 | 724 |
722 } // namespace cc | 725 } // namespace cc |
723 | 726 |
724 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ | 727 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ |
OLD | NEW |