| 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 ResourceFormat YuvResourceFormat(int bits) const; |
| 113 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); |
| 123 | 122 |
| (...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 const bool enable_color_correct_rendering_ = false; | 704 const bool enable_color_correct_rendering_ = false; |
| 706 | 705 |
| 707 base::ThreadChecker thread_checker_; | 706 base::ThreadChecker thread_checker_; |
| 708 | 707 |
| 709 scoped_refptr<Fence> current_read_lock_fence_; | 708 scoped_refptr<Fence> current_read_lock_fence_; |
| 710 | 709 |
| 711 const size_t id_allocation_chunk_size_; | 710 const size_t id_allocation_chunk_size_; |
| 712 std::unique_ptr<IdAllocator> texture_id_allocator_; | 711 std::unique_ptr<IdAllocator> texture_id_allocator_; |
| 713 std::unique_ptr<IdAllocator> buffer_id_allocator_; | 712 std::unique_ptr<IdAllocator> buffer_id_allocator_; |
| 714 | 713 |
| 715 bool use_sync_query_; | |
| 716 BufferToTextureTargetMap buffer_to_texture_target_map_; | 714 BufferToTextureTargetMap buffer_to_texture_target_map_; |
| 717 | 715 |
| 718 // A process-unique ID used for disambiguating memory dumps from different | 716 // A process-unique ID used for disambiguating memory dumps from different |
| 719 // resource providers. | 717 // resource providers. |
| 720 int tracing_id_; | 718 int tracing_id_; |
| 721 | 719 |
| 722 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); | 720 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); |
| 723 }; | 721 }; |
| 724 | 722 |
| 725 } // namespace cc | 723 } // namespace cc |
| 726 | 724 |
| 727 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ | 725 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ |
| OLD | NEW |