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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 void Initialize(); | 99 void Initialize(); |
100 | 100 |
101 void DidLoseOutputSurface() { lost_output_surface_ = true; } | 101 void DidLoseOutputSurface() { lost_output_surface_ = true; } |
102 | 102 |
103 int max_texture_size() const { return max_texture_size_; } | 103 int max_texture_size() const { return max_texture_size_; } |
104 ResourceFormat best_texture_format() const { return best_texture_format_; } | 104 ResourceFormat best_texture_format() const { return best_texture_format_; } |
105 ResourceFormat best_render_buffer_format() const { | 105 ResourceFormat best_render_buffer_format() const { |
106 return best_render_buffer_format_; | 106 return best_render_buffer_format_; |
107 } | 107 } |
108 ResourceFormat YuvResourceFormat(int bits) const; | 108 ResourceFormat YuvResourceFormat(int bits) const; |
| 109 ResourceFormat Y16ResourceFormat(int bits) const; |
109 bool use_sync_query() const { return use_sync_query_; } | 110 bool use_sync_query() const { return use_sync_query_; } |
110 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager() { | 111 gpu::GpuMemoryBufferManager* gpu_memory_buffer_manager() { |
111 return gpu_memory_buffer_manager_; | 112 return gpu_memory_buffer_manager_; |
112 } | 113 } |
113 size_t num_resources() const { return resources_.size(); } | 114 size_t num_resources() const { return resources_.size(); } |
114 | 115 |
115 bool IsResourceFormatSupported(ResourceFormat format) const; | 116 bool IsResourceFormatSupported(ResourceFormat format) const; |
116 | 117 |
117 // Checks whether a resource is in use by a consumer. | 118 // Checks whether a resource is in use by a consumer. |
118 bool InUseByConsumer(ResourceId id); | 119 bool InUseByConsumer(ResourceId id); |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
635 | 636 |
636 const bool delegated_sync_points_required_; | 637 const bool delegated_sync_points_required_; |
637 | 638 |
638 ResourceType default_resource_type_; | 639 ResourceType default_resource_type_; |
639 bool use_texture_storage_ext_; | 640 bool use_texture_storage_ext_; |
640 bool use_texture_format_bgra_; | 641 bool use_texture_format_bgra_; |
641 bool use_texture_usage_hint_; | 642 bool use_texture_usage_hint_; |
642 bool use_compressed_texture_etc1_; | 643 bool use_compressed_texture_etc1_; |
643 ResourceFormat yuv_resource_format_; | 644 ResourceFormat yuv_resource_format_; |
644 ResourceFormat yuv_highbit_resource_format_; | 645 ResourceFormat yuv_highbit_resource_format_; |
| 646 ResourceFormat y16_resource_format_; |
645 int max_texture_size_; | 647 int max_texture_size_; |
646 ResourceFormat best_texture_format_; | 648 ResourceFormat best_texture_format_; |
647 ResourceFormat best_render_buffer_format_; | 649 ResourceFormat best_render_buffer_format_; |
648 | 650 |
649 base::ThreadChecker thread_checker_; | 651 base::ThreadChecker thread_checker_; |
650 | 652 |
651 scoped_refptr<Fence> current_read_lock_fence_; | 653 scoped_refptr<Fence> current_read_lock_fence_; |
652 | 654 |
653 const size_t id_allocation_chunk_size_; | 655 const size_t id_allocation_chunk_size_; |
654 std::unique_ptr<IdAllocator> texture_id_allocator_; | 656 std::unique_ptr<IdAllocator> texture_id_allocator_; |
655 std::unique_ptr<IdAllocator> buffer_id_allocator_; | 657 std::unique_ptr<IdAllocator> buffer_id_allocator_; |
656 | 658 |
657 bool use_sync_query_; | 659 bool use_sync_query_; |
658 std::vector<unsigned> use_image_texture_targets_; | 660 std::vector<unsigned> use_image_texture_targets_; |
659 | 661 |
660 // A process-unique ID used for disambiguating memory dumps from different | 662 // A process-unique ID used for disambiguating memory dumps from different |
661 // resource providers. | 663 // resource providers. |
662 int tracing_id_; | 664 int tracing_id_; |
663 | 665 |
664 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); | 666 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); |
665 }; | 667 }; |
666 | 668 |
667 } // namespace cc | 669 } // namespace cc |
668 | 670 |
669 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ | 671 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ |
OLD | NEW |