| 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 <deque> | 8 #include <deque> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 bool use_rgba_4444_texture_format, | 88 bool use_rgba_4444_texture_format, |
| 89 size_t id_allocation_chunk_size); | 89 size_t id_allocation_chunk_size); |
| 90 virtual ~ResourceProvider(); | 90 virtual ~ResourceProvider(); |
| 91 | 91 |
| 92 void InitializeSoftware(); | 92 void InitializeSoftware(); |
| 93 void InitializeGL(); | 93 void InitializeGL(); |
| 94 | 94 |
| 95 void DidLoseOutputSurface() { lost_output_surface_ = true; } | 95 void DidLoseOutputSurface() { lost_output_surface_ = true; } |
| 96 | 96 |
| 97 int max_texture_size() const { return max_texture_size_; } | 97 int max_texture_size() const { return max_texture_size_; } |
| 98 ResourceFormat memory_efficient_texture_format() const { | 98 ResourceFormat memory_efficient_texture_format( |
| 99 return use_rgba_4444_texture_format_ ? RGBA_4444 : best_texture_format_; | 99 ResourceFormatUsage usage) const; |
| 100 } | |
| 101 ResourceFormat best_texture_format() const { return best_texture_format_; } | 100 ResourceFormat best_texture_format() const { return best_texture_format_; } |
| 102 ResourceFormat yuv_resource_format() const { return yuv_resource_format_; } | 101 ResourceFormat yuv_resource_format() const { return yuv_resource_format_; } |
| 103 bool use_sync_query() const { return use_sync_query_; } | 102 bool use_sync_query() const { return use_sync_query_; } |
| 104 size_t num_resources() const { return resources_.size(); } | 103 size_t num_resources() const { return resources_.size(); } |
| 105 | 104 |
| 106 // Checks whether a resource is in use by a consumer. | 105 // Checks whether a resource is in use by a consumer. |
| 107 bool InUseByConsumer(ResourceId id); | 106 bool InUseByConsumer(ResourceId id); |
| 108 | 107 |
| 109 bool IsLost(ResourceId id); | 108 bool IsLost(ResourceId id); |
| 110 bool AllowOverlay(ResourceId id); | 109 bool AllowOverlay(ResourceId id); |
| (...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 651 return format_gl_data_format[format]; | 650 return format_gl_data_format[format]; |
| 652 } | 651 } |
| 653 | 652 |
| 654 inline GLenum GLInternalFormat(ResourceFormat format) { | 653 inline GLenum GLInternalFormat(ResourceFormat format) { |
| 655 return GLDataFormat(format); | 654 return GLDataFormat(format); |
| 656 } | 655 } |
| 657 | 656 |
| 658 } // namespace cc | 657 } // namespace cc |
| 659 | 658 |
| 660 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ | 659 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ |
| OLD | NEW |