| 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_RESOURCE_PROVIDER_H_ | 5 #ifndef CC_RESOURCE_PROVIDER_H_ |
| 6 #define CC_RESOURCE_PROVIDER_H_ | 6 #define CC_RESOURCE_PROVIDER_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 // Destroys accounting for the child, deleting all accounted resources. | 116 // Destroys accounting for the child, deleting all accounted resources. |
| 117 void destroyChild(int child); | 117 void destroyChild(int child); |
| 118 | 118 |
| 119 // Gets the child->parent resource ID map. | 119 // Gets the child->parent resource ID map. |
| 120 const ResourceIdMap& getChildToParentMap(int child) const; | 120 const ResourceIdMap& getChildToParentMap(int child) const; |
| 121 | 121 |
| 122 // Prepares resources to be transfered to the parent, moving them to | 122 // Prepares resources to be transfered to the parent, moving them to |
| 123 // mailboxes and serializing meta-data into TransferableResources. | 123 // mailboxes and serializing meta-data into TransferableResources. |
| 124 // Resources are not removed from the ResourceProvider, but are marked as | 124 // Resources are not removed from the ResourceProvider, but are marked as |
| 125 // "in use". | 125 // "in use". |
| 126 void prepareSendToParent(const ResourceIdArray&, TransferableResourceList*); | 126 void prepareSendToParent(const ResourceIdArray& resources, TransferableResou
rceArray* transferableResources); |
| 127 | 127 |
| 128 // Prepares resources to be transfered back to the child, moving them to | 128 // Prepares resources to be transfered back to the child, moving them to |
| 129 // mailboxes and serializing meta-data into TransferableResources. | 129 // mailboxes and serializing meta-data into TransferableResources. |
| 130 // Resources are removed from the ResourceProvider. Note: the resource IDs | 130 // Resources are removed from the ResourceProvider. Note: the resource IDs |
| 131 // passed are in the parent namespace and will be translated to the child | 131 // passed are in the parent namespace and will be translated to the child |
| 132 // namespace when returned. | 132 // namespace when returned. |
| 133 void prepareSendToChild(int child, const ResourceIdArray&, TransferableResou
rceList*); | 133 void prepareSendToChild(int child, const ResourceIdArray& resources, Transfe
rableResourceArray* transferableResources); |
| 134 | 134 |
| 135 // Receives resources from a child, moving them from mailboxes. Resource IDs | 135 // Receives resources from a child, moving them from mailboxes. Resource IDs |
| 136 // passed are in the child namespace, and will be translated to the parent | 136 // passed are in the child namespace, and will be translated to the parent |
| 137 // namespace, added to the child->parent map. | 137 // namespace, added to the child->parent map. |
| 138 // NOTE: if the syncPoint filed in TransferableResourceList is set, this | 138 // NOTE: if the sync_point is set on any TransferableResource, this will |
| 139 // will wait on it. | 139 // wait on it. |
| 140 void receiveFromChild(int child, const TransferableResourceList&); | 140 void receiveFromChild(int child, const TransferableResourceArray& transferab
leResources); |
| 141 | 141 |
| 142 // Receives resources from the parent, moving them from mailboxes. Resource
IDs | 142 // Receives resources from the parent, moving them from mailboxes. Resource
IDs |
| 143 // passed are in the child namespace. | 143 // passed are in the child namespace. |
| 144 // NOTE: if the syncPoint filed in TransferableResourceList is set, this | 144 // NOTE: if the sync_point is set on any TransferableResource, this will |
| 145 // will wait on it. | 145 // wait on it. |
| 146 void receiveFromParent(const TransferableResourceList&); | 146 void receiveFromParent(const TransferableResourceArray& transferableResource
s); |
| 147 | 147 |
| 148 // Bind the given GL resource to a texture target for sampling using the | 148 // Bind the given GL resource to a texture target for sampling using the |
| 149 // specified filter for both minification and magnification. The resource | 149 // specified filter for both minification and magnification. The resource |
| 150 // must be locked for reading. | 150 // must be locked for reading. |
| 151 void bindForSampling(ResourceProvider::ResourceId, GLenum target, GLenum fil
ter); | 151 void bindForSampling(ResourceProvider::ResourceId, GLenum target, GLenum fil
ter); |
| 152 | 152 |
| 153 // The following lock classes are part of the ResourceProvider API and are | 153 // The following lock classes are part of the ResourceProvider API and are |
| 154 // needed to read and write the resource contents. The user must ensure | 154 // needed to read and write the resource contents. The user must ensure |
| 155 // that they only use GL locks on GL resources, etc, and this is enforced | 155 // that they only use GL locks on GL resources, etc, and this is enforced |
| 156 // by assertions. | 156 // by assertions. |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 base::ThreadChecker m_threadChecker; | 343 base::ThreadChecker m_threadChecker; |
| 344 | 344 |
| 345 scoped_refptr<Fence> m_currentReadLockFence; | 345 scoped_refptr<Fence> m_currentReadLockFence; |
| 346 | 346 |
| 347 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); | 347 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); |
| 348 }; | 348 }; |
| 349 | 349 |
| 350 } | 350 } |
| 351 | 351 |
| 352 #endif // CC_RESOURCE_PROVIDER_H_ | 352 #endif // CC_RESOURCE_PROVIDER_H_ |
| OLD | NEW |