| 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 ResourceId CreateResourceFromTextureMailbox( | 143 ResourceId CreateResourceFromTextureMailbox( |
| 144 const TextureMailbox& mailbox, | 144 const TextureMailbox& mailbox, |
| 145 std::unique_ptr<SingleReleaseCallbackImpl> release_callback_impl); | 145 std::unique_ptr<SingleReleaseCallbackImpl> release_callback_impl); |
| 146 | 146 |
| 147 ResourceId CreateResourceFromTextureMailbox( | 147 ResourceId CreateResourceFromTextureMailbox( |
| 148 const TextureMailbox& mailbox, | 148 const TextureMailbox& mailbox, |
| 149 std::unique_ptr<SingleReleaseCallbackImpl> release_callback_impl, | 149 std::unique_ptr<SingleReleaseCallbackImpl> release_callback_impl, |
| 150 bool read_lock_fences_enabled); | 150 bool read_lock_fences_enabled); |
| 151 | 151 |
| 152 void DeleteResource(ResourceId id); | 152 void DeleteResource(ResourceId id); |
| 153 // In the case of GPU resources, we may need to flush the GL context to ensure |
| 154 // that texture deletions are seen in a timely fashion. This function should |
| 155 // be called after texture deletions that may happen during an idle state. |
| 156 void FlushPendingDeletions() const; |
| 153 | 157 |
| 154 // Update pixels from image, copying source_rect (in image) to dest_offset (in | 158 // Update pixels from image, copying source_rect (in image) to dest_offset (in |
| 155 // the resource). | 159 // the resource). |
| 156 void CopyToResource(ResourceId id, | 160 void CopyToResource(ResourceId id, |
| 157 const uint8_t* image, | 161 const uint8_t* image, |
| 158 const gfx::Size& image_size); | 162 const gfx::Size& image_size); |
| 159 | 163 |
| 160 // Generates sync tokesn for resources which need a sync token. | 164 // Generates sync tokesn for resources which need a sync token. |
| 161 void GenerateSyncTokenForResource(ResourceId resource_id); | 165 void GenerateSyncTokenForResource(ResourceId resource_id); |
| 162 void GenerateSyncTokenForResources(const ResourceIdArray& resource_ids); | 166 void GenerateSyncTokenForResources(const ResourceIdArray& resource_ids); |
| (...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 // Set of resource Ids that would like to be notified about promotion hints. | 753 // Set of resource Ids that would like to be notified about promotion hints. |
| 750 ResourceIdSet wants_promotion_hints_set_; | 754 ResourceIdSet wants_promotion_hints_set_; |
| 751 #endif | 755 #endif |
| 752 | 756 |
| 753 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); | 757 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); |
| 754 }; | 758 }; |
| 755 | 759 |
| 756 } // namespace cc | 760 } // namespace cc |
| 757 | 761 |
| 758 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ | 762 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ |
| OLD | NEW |