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