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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 } | 96 } |
97 ResourceFormat best_texture_format() const { return best_texture_format_; } | 97 ResourceFormat best_texture_format() const { return best_texture_format_; } |
98 ResourceFormat yuv_resource_format() const { return yuv_resource_format_; } | 98 ResourceFormat yuv_resource_format() const { return yuv_resource_format_; } |
99 bool use_sync_query() const { return use_sync_query_; } | 99 bool use_sync_query() const { return use_sync_query_; } |
100 size_t num_resources() const { return resources_.size(); } | 100 size_t num_resources() const { return resources_.size(); } |
101 | 101 |
102 // Checks whether a resource is in use by a consumer. | 102 // Checks whether a resource is in use by a consumer. |
103 bool InUseByConsumer(ResourceId id); | 103 bool InUseByConsumer(ResourceId id); |
104 | 104 |
105 bool IsLost(ResourceId id); | 105 bool IsLost(ResourceId id); |
106 bool AllowOverlay(ResourceId id); | |
107 | 106 |
108 // Producer interface. | 107 // Producer interface. |
109 | 108 |
110 ResourceType default_resource_type() const { return default_resource_type_; } | 109 ResourceType default_resource_type() const { return default_resource_type_; } |
111 ResourceType GetResourceType(ResourceId id); | 110 ResourceType GetResourceType(ResourceId id); |
112 | 111 |
113 // Creates a resource of the default resource type. | 112 // Creates a resource of the default resource type. |
114 ResourceId CreateResource(const gfx::Size& size, | 113 ResourceId CreateResource(const gfx::Size& size, |
115 GLint wrap_mode, | 114 GLint wrap_mode, |
116 TextureHint hint, | 115 TextureHint hint, |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 int exported_count; | 480 int exported_count; |
482 bool dirty_image : 1; | 481 bool dirty_image : 1; |
483 bool locked_for_write : 1; | 482 bool locked_for_write : 1; |
484 bool lost : 1; | 483 bool lost : 1; |
485 bool marked_for_deletion : 1; | 484 bool marked_for_deletion : 1; |
486 bool pending_set_pixels : 1; | 485 bool pending_set_pixels : 1; |
487 bool set_pixels_completion_forced : 1; | 486 bool set_pixels_completion_forced : 1; |
488 bool allocated : 1; | 487 bool allocated : 1; |
489 bool read_lock_fences_enabled : 1; | 488 bool read_lock_fences_enabled : 1; |
490 bool has_shared_bitmap_id : 1; | 489 bool has_shared_bitmap_id : 1; |
491 bool allow_overlay : 1; | |
492 scoped_refptr<Fence> read_lock_fence; | 490 scoped_refptr<Fence> read_lock_fence; |
493 gfx::Size size; | 491 gfx::Size size; |
494 Origin origin; | 492 Origin origin; |
495 GLenum target; | 493 GLenum target; |
496 // TODO(skyostil): Use a separate sampler object for filter state. | 494 // TODO(skyostil): Use a separate sampler object for filter state. |
497 GLenum original_filter; | 495 GLenum original_filter; |
498 GLenum filter; | 496 GLenum filter; |
499 unsigned image_id; | 497 unsigned image_id; |
500 unsigned bound_image_id; | 498 unsigned bound_image_id; |
501 GLenum texture_pool; | 499 GLenum texture_pool; |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 return format_gl_data_format[format]; | 659 return format_gl_data_format[format]; |
662 } | 660 } |
663 | 661 |
664 inline GLenum GLInternalFormat(ResourceFormat format) { | 662 inline GLenum GLInternalFormat(ResourceFormat format) { |
665 return GLDataFormat(format); | 663 return GLDataFormat(format); |
666 } | 664 } |
667 | 665 |
668 } // namespace cc | 666 } // namespace cc |
669 | 667 |
670 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ | 668 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ |
OLD | NEW |