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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 void CreateForTesting(ResourceId id); | 414 void CreateForTesting(ResourceId id); |
415 | 415 |
416 // Sets the current read fence. If a resource is locked for read | 416 // Sets the current read fence. If a resource is locked for read |
417 // and has read fences enabled, the resource will not allow writes | 417 // and has read fences enabled, the resource will not allow writes |
418 // until this fence has passed. | 418 // until this fence has passed. |
419 void SetReadLockFence(Fence* fence) { current_read_lock_fence_ = fence; } | 419 void SetReadLockFence(Fence* fence) { current_read_lock_fence_ = fence; } |
420 | 420 |
421 // Indicates if we can currently lock this resource for write. | 421 // Indicates if we can currently lock this resource for write. |
422 bool CanLockForWrite(ResourceId id); | 422 bool CanLockForWrite(ResourceId id); |
423 | 423 |
| 424 // Indicates if this resource is currently being used as an overlay by the |
| 425 // windowing system. |
| 426 // TODO(ccameron): This should be entirely hidden inside CanLockForWrite, but |
| 427 // will erratically returns true, potentially breaking DCHECKs. |
| 428 // http://crbug.com/577121 |
| 429 bool IsInUseByMacOSWindowServer(ResourceId id); |
| 430 |
424 // Indicates if this resource may be used for a hardware overlay plane. | 431 // Indicates if this resource may be used for a hardware overlay plane. |
425 bool IsOverlayCandidate(ResourceId id); | 432 bool IsOverlayCandidate(ResourceId id); |
426 | 433 |
427 void WaitSyncTokenIfNeeded(ResourceId id); | 434 void WaitSyncTokenIfNeeded(ResourceId id); |
428 | 435 |
429 static GLint GetActiveTextureUnit(gpu::gles2::GLES2Interface* gl); | 436 static GLint GetActiveTextureUnit(gpu::gles2::GLES2Interface* gl); |
430 | 437 |
431 OutputSurface* output_surface() { return output_surface_; } | 438 OutputSurface* output_surface() { return output_surface_; } |
432 | 439 |
433 void ValidateResource(ResourceId id) const; | 440 void ValidateResource(ResourceId id) const; |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
615 // A process-unique ID used for disambiguating memory dumps from different | 622 // A process-unique ID used for disambiguating memory dumps from different |
616 // resource providers. | 623 // resource providers. |
617 int tracing_id_; | 624 int tracing_id_; |
618 | 625 |
619 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); | 626 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); |
620 }; | 627 }; |
621 | 628 |
622 } // namespace cc | 629 } // namespace cc |
623 | 630 |
624 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ | 631 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ |
OLD | NEW |