| 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 <deque> | 8 #include <deque> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 | 110 |
| 111 bool IsLost(ResourceId id); | 111 bool IsLost(ResourceId id); |
| 112 | 112 |
| 113 void LoseResourceForTesting(ResourceId id); | 113 void LoseResourceForTesting(ResourceId id); |
| 114 void EnableReadLockFencesForTesting(ResourceId id); | 114 void EnableReadLockFencesForTesting(ResourceId id); |
| 115 | 115 |
| 116 // Producer interface. | 116 // Producer interface. |
| 117 | 117 |
| 118 ResourceType default_resource_type() const { return default_resource_type_; } | 118 ResourceType default_resource_type() const { return default_resource_type_; } |
| 119 ResourceType GetResourceType(ResourceId id); | 119 ResourceType GetResourceType(ResourceId id); |
| 120 GLenum GetResourceTextureTarget(ResourceId id); |
| 120 | 121 |
| 121 // Creates a resource of the default resource type. | 122 // Creates a resource of the default resource type. |
| 122 ResourceId CreateResource(const gfx::Size& size, | 123 ResourceId CreateResource(const gfx::Size& size, |
| 123 TextureHint hint, | 124 TextureHint hint, |
| 124 ResourceFormat format); | 125 ResourceFormat format); |
| 125 | 126 |
| 126 // Creates a resource for a particular texture target (the distinction between | 127 // Creates a resource for a particular texture target (the distinction between |
| 127 // texture targets has no effect in software mode). | 128 // texture targets has no effect in software mode). |
| 128 ResourceId CreateResourceWithImageTextureTarget(const gfx::Size& size, | 129 ResourceId CreateResourceWithImageTextureTarget(const gfx::Size& size, |
| 129 TextureHint hint, | 130 TextureHint hint, |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 void ForceSetPixelsToComplete(ResourceId id); | 391 void ForceSetPixelsToComplete(ResourceId id); |
| 391 bool DidSetPixelsComplete(ResourceId id); | 392 bool DidSetPixelsComplete(ResourceId id); |
| 392 | 393 |
| 393 // For tests only! This prevents detecting uninitialized reads. | 394 // For tests only! This prevents detecting uninitialized reads. |
| 394 // Use SetPixels or LockForWrite to allocate implicitly. | 395 // Use SetPixels or LockForWrite to allocate implicitly. |
| 395 void AllocateForTesting(ResourceId id); | 396 void AllocateForTesting(ResourceId id); |
| 396 | 397 |
| 397 // For tests only! | 398 // For tests only! |
| 398 void CreateForTesting(ResourceId id); | 399 void CreateForTesting(ResourceId id); |
| 399 | 400 |
| 400 GLenum TargetForTesting(ResourceId id); | |
| 401 | |
| 402 // Sets the current read fence. If a resource is locked for read | 401 // Sets the current read fence. If a resource is locked for read |
| 403 // and has read fences enabled, the resource will not allow writes | 402 // and has read fences enabled, the resource will not allow writes |
| 404 // until this fence has passed. | 403 // until this fence has passed. |
| 405 void SetReadLockFence(Fence* fence) { current_read_lock_fence_ = fence; } | 404 void SetReadLockFence(Fence* fence) { current_read_lock_fence_ = fence; } |
| 406 | 405 |
| 407 // Indicates if we can currently lock this resource for write. | 406 // Indicates if we can currently lock this resource for write. |
| 408 bool CanLockForWrite(ResourceId id); | 407 bool CanLockForWrite(ResourceId id); |
| 409 | 408 |
| 410 // Indicates if this resource may be used for a hardware overlay plane. | 409 // Indicates if this resource may be used for a hardware overlay plane. |
| 411 bool IsOverlayCandidate(ResourceId id); | 410 bool IsOverlayCandidate(ResourceId id); |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 593 // A process-unique ID used for disambiguating memory dumps from different | 592 // A process-unique ID used for disambiguating memory dumps from different |
| 594 // resource providers. | 593 // resource providers. |
| 595 int tracing_id_; | 594 int tracing_id_; |
| 596 | 595 |
| 597 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); | 596 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); |
| 598 }; | 597 }; |
| 599 | 598 |
| 600 } // namespace cc | 599 } // namespace cc |
| 601 | 600 |
| 602 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ | 601 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ |
| OLD | NEW |