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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 bool read_lock_fences_enabled); | 152 bool read_lock_fences_enabled); |
153 | 153 |
154 void DeleteResource(ResourceId id); | 154 void DeleteResource(ResourceId id); |
155 | 155 |
156 // Update pixels from image, copying source_rect (in image) to dest_offset (in | 156 // Update pixels from image, copying source_rect (in image) to dest_offset (in |
157 // the resource). | 157 // the resource). |
158 void CopyToResource(ResourceId id, | 158 void CopyToResource(ResourceId id, |
159 const uint8_t* image, | 159 const uint8_t* image, |
160 const gfx::Size& image_size); | 160 const gfx::Size& image_size); |
161 | 161 |
162 // Only flush the command buffer if supported. | 162 // Generates sync tokesn for resources which need a sync token. |
163 // Returns true if the shallow flush occurred, false otherwise. | 163 void GenerateSyncTokenForResource(ResourceId resource_id); |
164 bool ShallowFlushIfSupported(); | 164 void GenerateSyncTokenForResources(const ResourceIdArray& resource_ids); |
165 | 165 |
166 // Creates accounting for a child. Returns a child ID. | 166 // Creates accounting for a child. Returns a child ID. |
167 int CreateChild(const ReturnCallback& return_callback); | 167 int CreateChild(const ReturnCallback& return_callback); |
168 | 168 |
169 // Destroys accounting for the child, deleting all accounted resources. | 169 // Destroys accounting for the child, deleting all accounted resources. |
170 void DestroyChild(int child); | 170 void DestroyChild(int child); |
171 | 171 |
172 // Sets whether resources need sync points set on them when returned to this | 172 // Sets whether resources need sync points set on them when returned to this |
173 // child. Defaults to true. | 173 // child. Defaults to true. |
174 void SetChildNeedsSyncTokens(int child, bool needs_sync_tokens); | 174 void SetChildNeedsSyncTokens(int child, bool needs_sync_tokens); |
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
674 // A process-unique ID used for disambiguating memory dumps from different | 674 // A process-unique ID used for disambiguating memory dumps from different |
675 // resource providers. | 675 // resource providers. |
676 int tracing_id_; | 676 int tracing_id_; |
677 | 677 |
678 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); | 678 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); |
679 }; | 679 }; |
680 | 680 |
681 } // namespace cc | 681 } // namespace cc |
682 | 682 |
683 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ | 683 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ |
OLD | NEW |