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 CCResourceProvider_h | 5 #ifndef CCResourceProvider_h |
6 #define CCResourceProvider_h | 6 #define CCResourceProvider_h |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/hash_tables.h" | 9 #include "base/hash_tables.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 ResourceId createGLTexture(int pool, const gfx::Size&, GLenum format, Textur
eUsageHint); | 88 ResourceId createGLTexture(int pool, const gfx::Size&, GLenum format, Textur
eUsageHint); |
89 ResourceId createBitmap(int pool, const gfx::Size&); | 89 ResourceId createBitmap(int pool, const gfx::Size&); |
90 // Wraps an external texture into a GL resource. | 90 // Wraps an external texture into a GL resource. |
91 ResourceId createResourceFromExternalTexture(unsigned textureId); | 91 ResourceId createResourceFromExternalTexture(unsigned textureId); |
92 | 92 |
93 void deleteResource(ResourceId); | 93 void deleteResource(ResourceId); |
94 | 94 |
95 // Deletes all resources owned by a given pool. | 95 // Deletes all resources owned by a given pool. |
96 void deleteOwnedResources(int pool); | 96 void deleteOwnedResources(int pool); |
97 | 97 |
98 // Upload data from image, copying sourceRect (in image) into destRect (in t
he resource). | 98 // Update pixels from image, copying sourceRect (in image) into destRect (in
the resource). |
99 void upload(ResourceId, const uint8_t* image, const gfx::Rect& imageRect, co
nst gfx::Rect& sourceRect, const gfx::Vector2d& destOffset); | 99 void setPixels(ResourceId, const uint8_t* image, const gfx::Rect& imageRect,
const gfx::Rect& sourceRect, const gfx::Vector2d& destOffset); |
100 | 100 |
101 // Check upload status. | 101 // Check upload status. |
102 size_t numBlockingUploads(); | 102 size_t numBlockingUploads(); |
103 void markPendingUploadsAsNonBlocking(); | 103 void markPendingUploadsAsNonBlocking(); |
104 double estimatedUploadsPerSecond(); | 104 double estimatedUploadsPerSecond(); |
105 | 105 |
106 // Flush all context operations, kicking uploads and ensuring ordering with | 106 // Flush all context operations, kicking uploads and ensuring ordering with |
107 // respect to other contexts. | 107 // respect to other contexts. |
108 void flush(); | 108 void flush(); |
109 | 109 |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 scoped_ptr<TextureUploader> m_textureUploader; | 277 scoped_ptr<TextureUploader> m_textureUploader; |
278 scoped_ptr<AcceleratedTextureCopier> m_textureCopier; | 278 scoped_ptr<AcceleratedTextureCopier> m_textureCopier; |
279 int m_maxTextureSize; | 279 int m_maxTextureSize; |
280 | 280 |
281 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); | 281 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); |
282 }; | 282 }; |
283 | 283 |
284 } | 284 } |
285 | 285 |
286 #endif | 286 #endif |
OLD | NEW |