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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 // Map/unmap the acquired pixel buffer. | 237 // Map/unmap the acquired pixel buffer. |
238 uint8_t* mapPixelBuffer(ResourceId id); | 238 uint8_t* mapPixelBuffer(ResourceId id); |
239 void unmapPixelBuffer(ResourceId id); | 239 void unmapPixelBuffer(ResourceId id); |
240 | 240 |
241 // Update pixels from acquired pixel buffer. | 241 // Update pixels from acquired pixel buffer. |
242 void setPixelsFromBuffer(ResourceId id); | 242 void setPixelsFromBuffer(ResourceId id); |
243 | 243 |
244 // Asynchronously update pixels from acquired pixel buffer. | 244 // Asynchronously update pixels from acquired pixel buffer. |
245 void beginSetPixels(ResourceId id); | 245 void beginSetPixels(ResourceId id); |
246 bool didSetPixelsComplete(ResourceId id); | 246 bool didSetPixelsComplete(ResourceId id); |
| 247 void abortSetPixels(ResourceId id); |
247 | 248 |
248 // For tests only! This prevents detecting uninitialized reads. | 249 // For tests only! This prevents detecting uninitialized reads. |
249 // Use setPixels or lockForWrite to allocate implicitly. | 250 // Use setPixels or lockForWrite to allocate implicitly. |
250 void allocateForTesting(ResourceId id); | 251 void allocateForTesting(ResourceId id); |
251 | 252 |
252 // Sets the current read fence. If a resource is locked for read | 253 // Sets the current read fence. If a resource is locked for read |
253 // and has read fences enabled, the resource will not allow writes | 254 // and has read fences enabled, the resource will not allow writes |
254 // until this fence has passed. | 255 // until this fence has passed. |
255 void setReadLockFence(scoped_refptr<Fence> fence) { m_currentReadLockFence =
fence; } | 256 void setReadLockFence(scoped_refptr<Fence> fence) { m_currentReadLockFence =
fence; } |
256 Fence* getReadLockFence() { return m_currentReadLockFence; } | 257 Fence* getReadLockFence() { return m_currentReadLockFence; } |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 base::ThreadChecker m_threadChecker; | 336 base::ThreadChecker m_threadChecker; |
336 | 337 |
337 scoped_refptr<Fence> m_currentReadLockFence; | 338 scoped_refptr<Fence> m_currentReadLockFence; |
338 | 339 |
339 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); | 340 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); |
340 }; | 341 }; |
341 | 342 |
342 } | 343 } |
343 | 344 |
344 #endif // CC_RESOURCE_PROVIDER_H_ | 345 #endif // CC_RESOURCE_PROVIDER_H_ |
OLD | NEW |