| 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 | 143 |
| 144 // Wraps an external texture mailbox into a GL resource. | 144 // Wraps an external texture mailbox into a GL resource. |
| 145 ResourceId CreateResourceFromTextureMailbox( | 145 ResourceId CreateResourceFromTextureMailbox( |
| 146 const TextureMailbox& mailbox, | 146 const TextureMailbox& mailbox, |
| 147 scoped_ptr<SingleReleaseCallbackImpl> release_callback_impl); | 147 scoped_ptr<SingleReleaseCallbackImpl> release_callback_impl); |
| 148 | 148 |
| 149 void DeleteResource(ResourceId id); | 149 void DeleteResource(ResourceId id); |
| 150 | 150 |
| 151 // Update pixels from image, copying source_rect (in image) to dest_offset (in | 151 // Update pixels from image, copying source_rect (in image) to dest_offset (in |
| 152 // the resource). | 152 // the resource). |
| 153 // NOTE: DEPRECATED. Use CopyToResource() instead. |
| 153 void SetPixels(ResourceId id, | 154 void SetPixels(ResourceId id, |
| 154 const uint8_t* image, | 155 const uint8_t* image, |
| 155 const gfx::Rect& image_rect, | 156 const gfx::Rect& image_rect, |
| 156 const gfx::Rect& source_rect, | 157 const gfx::Rect& source_rect, |
| 157 const gfx::Vector2d& dest_offset); | 158 const gfx::Vector2d& dest_offset); |
| 159 void CopyToResource(ResourceId id, |
| 160 const uint8_t* image, |
| 161 const gfx::Size& image_size); |
| 158 | 162 |
| 159 // Check upload status. | 163 // Check upload status. |
| 160 size_t NumBlockingUploads(); | 164 size_t NumBlockingUploads(); |
| 161 void MarkPendingUploadsAsNonBlocking(); | 165 void MarkPendingUploadsAsNonBlocking(); |
| 162 size_t EstimatedUploadsPerTick(); | 166 size_t EstimatedUploadsPerTick(); |
| 163 void FlushUploads(); | 167 void FlushUploads(); |
| 164 void ReleaseCachedData(); | 168 void ReleaseCachedData(); |
| 165 base::TimeTicks EstimatedUploadCompletionTime(size_t uploads_per_tick); | 169 base::TimeTicks EstimatedUploadCompletionTime(size_t uploads_per_tick); |
| 166 | 170 |
| 167 // Only flush the command buffer if supported. | 171 // Only flush the command buffer if supported. |
| (...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 656 return format_gl_data_format[format]; | 660 return format_gl_data_format[format]; |
| 657 } | 661 } |
| 658 | 662 |
| 659 inline GLenum GLInternalFormat(ResourceFormat format) { | 663 inline GLenum GLInternalFormat(ResourceFormat format) { |
| 660 return GLDataFormat(format); | 664 return GLDataFormat(format); |
| 661 } | 665 } |
| 662 | 666 |
| 663 } // namespace cc | 667 } // namespace cc |
| 664 | 668 |
| 665 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ | 669 #endif // CC_RESOURCES_RESOURCE_PROVIDER_H_ |
| OLD | NEW |