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