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 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 void CopyResource(ResourceId source_id, ResourceId dest_id); | 428 void CopyResource(ResourceId source_id, ResourceId dest_id); |
429 | 429 |
430 void WaitSyncPointIfNeeded(ResourceId id); | 430 void WaitSyncPointIfNeeded(ResourceId id); |
431 | 431 |
432 void WaitReadLockIfNeeded(ResourceId id); | 432 void WaitReadLockIfNeeded(ResourceId id); |
433 | 433 |
434 static GLint GetActiveTextureUnit(gpu::gles2::GLES2Interface* gl); | 434 static GLint GetActiveTextureUnit(gpu::gles2::GLES2Interface* gl); |
435 | 435 |
436 OutputSurface* output_surface() { return output_surface_; } | 436 OutputSurface* output_surface() { return output_surface_; } |
437 | 437 |
| 438 void ValidateResource(ResourceId id); |
| 439 |
438 private: | 440 private: |
439 struct Resource { | 441 struct Resource { |
440 enum Origin { INTERNAL, EXTERNAL, DELEGATED }; | 442 enum Origin { INTERNAL, EXTERNAL, DELEGATED }; |
441 | 443 |
442 Resource(); | 444 Resource(); |
443 ~Resource(); | 445 ~Resource(); |
444 Resource(unsigned texture_id, | 446 Resource(unsigned texture_id, |
445 const gfx::Size& size, | 447 const gfx::Size& size, |
446 Origin origin, | 448 Origin origin, |
447 GLenum target, | 449 GLenum target, |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
659 return format_gl_data_format[format]; | 661 return format_gl_data_format[format]; |
660 } | 662 } |
661 | 663 |
662 inline GLenum GLInternalFormat(ResourceFormat format) { | 664 inline GLenum GLInternalFormat(ResourceFormat format) { |
663 return GLDataFormat(format); | 665 return GLDataFormat(format); |
664 } | 666 } |
665 | 667 |
666 } // namespace cc | 668 } // namespace cc |
667 | 669 |
668 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ | 670 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ |
OLD | NEW |