Chromium Code Reviews| 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 <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 273 | 273 |
| 274 // Map/unmap the acquired pixel buffer. | 274 // Map/unmap the acquired pixel buffer. |
| 275 uint8_t* MapPixelBuffer(ResourceId id); | 275 uint8_t* MapPixelBuffer(ResourceId id); |
| 276 void UnmapPixelBuffer(ResourceId id); | 276 void UnmapPixelBuffer(ResourceId id); |
| 277 | 277 |
| 278 // Update pixels from acquired pixel buffer. | 278 // Update pixels from acquired pixel buffer. |
| 279 void SetPixelsFromBuffer(ResourceId id); | 279 void SetPixelsFromBuffer(ResourceId id); |
| 280 | 280 |
| 281 // Asynchronously update pixels from acquired pixel buffer. | 281 // Asynchronously update pixels from acquired pixel buffer. |
| 282 void BeginSetPixels(ResourceId id); | 282 void BeginSetPixels(ResourceId id); |
| 283 void InsertWaitForSetPixels(ResourceId id); | |
|
nduca
2013/03/11 19:41:47
ForceSetPixelsToComplete?
Sami
2013/03/12 14:13:07
sgtm, done.
| |
| 283 bool DidSetPixelsComplete(ResourceId id); | 284 bool DidSetPixelsComplete(ResourceId id); |
| 284 void AbortSetPixels(ResourceId id); | 285 void AbortSetPixels(ResourceId id); |
| 285 | 286 |
| 286 // For tests only! This prevents detecting uninitialized reads. | 287 // For tests only! This prevents detecting uninitialized reads. |
| 287 // Use SetPixels or LockForWrite to allocate implicitly. | 288 // Use SetPixels or LockForWrite to allocate implicitly. |
| 288 void AllocateForTesting(ResourceId id); | 289 void AllocateForTesting(ResourceId id); |
| 289 | 290 |
| 290 // Sets the current read fence. If a resource is locked for read | 291 // Sets the current read fence. If a resource is locked for read |
| 291 // and has read fences enabled, the resource will not allow writes | 292 // and has read fences enabled, the resource will not allow writes |
| 292 // until this fence has passed. | 293 // until this fence has passed. |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 321 unsigned gl_upload_query_id; | 322 unsigned gl_upload_query_id; |
| 322 TextureMailbox mailbox; | 323 TextureMailbox mailbox; |
| 323 uint8_t* pixels; | 324 uint8_t* pixels; |
| 324 uint8_t* pixel_buffer; | 325 uint8_t* pixel_buffer; |
| 325 int lock_for_read_count; | 326 int lock_for_read_count; |
| 326 bool locked_for_write; | 327 bool locked_for_write; |
| 327 bool external; | 328 bool external; |
| 328 bool exported; | 329 bool exported; |
| 329 bool marked_for_deletion; | 330 bool marked_for_deletion; |
| 330 bool pending_set_pixels; | 331 bool pending_set_pixels; |
| 332 bool wait_for_set_pixels_inserted; | |
| 331 bool allocated; | 333 bool allocated; |
| 332 bool enable_read_lock_fences; | 334 bool enable_read_lock_fences; |
| 333 scoped_refptr<Fence> read_lock_fence; | 335 scoped_refptr<Fence> read_lock_fence; |
| 334 gfx::Size size; | 336 gfx::Size size; |
| 335 GLenum format; | 337 GLenum format; |
| 336 // TODO(skyostil): Use a separate sampler object for filter state. | 338 // TODO(skyostil): Use a separate sampler object for filter state. |
| 337 GLenum filter; | 339 GLenum filter; |
| 338 ResourceType type; | 340 ResourceType type; |
| 339 }; | 341 }; |
| 340 typedef base::hash_map<ResourceId, Resource> ResourceMap; | 342 typedef base::hash_map<ResourceId, Resource> ResourceMap; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 388 base::ThreadChecker thread_checker_; | 390 base::ThreadChecker thread_checker_; |
| 389 | 391 |
| 390 scoped_refptr<Fence> current_read_lock_fence_; | 392 scoped_refptr<Fence> current_read_lock_fence_; |
| 391 | 393 |
| 392 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); | 394 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); |
| 393 }; | 395 }; |
| 394 | 396 |
| 395 } | 397 } |
| 396 | 398 |
| 397 #endif // CC_RESOURCE_PROVIDER_H_ | 399 #endif // CC_RESOURCE_PROVIDER_H_ |
| OLD | NEW |