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 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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); | 438 void ValidateResource(ResourceId id); |
439 | 439 |
| 440 void FreeGrResources(); |
| 441 |
440 private: | 442 private: |
441 struct Resource { | 443 struct Resource { |
442 enum Origin { INTERNAL, EXTERNAL, DELEGATED }; | 444 enum Origin { INTERNAL, EXTERNAL, DELEGATED }; |
443 | 445 |
444 Resource(); | 446 Resource(); |
445 ~Resource(); | 447 ~Resource(); |
446 Resource(unsigned texture_id, | 448 Resource(unsigned texture_id, |
447 const gfx::Size& size, | 449 const gfx::Size& size, |
448 Origin origin, | 450 Origin origin, |
449 GLenum target, | 451 GLenum target, |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
661 return format_gl_data_format[format]; | 663 return format_gl_data_format[format]; |
662 } | 664 } |
663 | 665 |
664 inline GLenum GLInternalFormat(ResourceFormat format) { | 666 inline GLenum GLInternalFormat(ResourceFormat format) { |
665 return GLDataFormat(format); | 667 return GLDataFormat(format); |
666 } | 668 } |
667 | 669 |
668 } // namespace cc | 670 } // namespace cc |
669 | 671 |
670 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ | 672 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ |
OLD | NEW |