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_RESOURCE_PROVIDER_H_ | 5 #ifndef CC_RESOURCE_PROVIDER_H_ |
6 #define CC_RESOURCE_PROVIDER_H_ | 6 #define CC_RESOURCE_PROVIDER_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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 | 65 |
66 // Producer interface. | 66 // Producer interface. |
67 | 67 |
68 void setDefaultResourceType(ResourceType type) { m_defaultResourceType = typ
e; } | 68 void setDefaultResourceType(ResourceType type) { m_defaultResourceType = typ
e; } |
69 ResourceType defaultResourceType() const { return m_defaultResourceType; } | 69 ResourceType defaultResourceType() const { return m_defaultResourceType; } |
70 ResourceType resourceType(ResourceId); | 70 ResourceType resourceType(ResourceId); |
71 | 71 |
72 // Creates a resource of the default resource type. | 72 // Creates a resource of the default resource type. |
73 ResourceId createResource(const gfx::Size&, GLenum format, TextureUsageHint)
; | 73 ResourceId createResource(const gfx::Size&, GLenum format, TextureUsageHint)
; |
74 | 74 |
| 75 // Creates a resource which is tagged as being managed for GPU memory accoun
ting purposes. |
| 76 ResourceId createManagedResource(const gfx::Size&, GLenum format, TextureUsa
geHint); |
| 77 |
75 // You can also explicitly create a specific resource type. | 78 // You can also explicitly create a specific resource type. |
76 ResourceId createGLTexture(const gfx::Size&, GLenum format, TextureUsageHint
); | 79 ResourceId createGLTexture(const gfx::Size&, GLenum format, GLenum texturePo
ol, TextureUsageHint); |
| 80 |
77 ResourceId createBitmap(const gfx::Size&); | 81 ResourceId createBitmap(const gfx::Size&); |
78 // Wraps an external texture into a GL resource. | 82 // Wraps an external texture into a GL resource. |
79 ResourceId createResourceFromExternalTexture(unsigned textureId); | 83 ResourceId createResourceFromExternalTexture(unsigned textureId); |
80 | 84 |
81 void deleteResource(ResourceId); | 85 void deleteResource(ResourceId); |
82 | 86 |
83 // Update pixels from image, copying sourceRect (in image) into destRect (in
the resource). | 87 // Update pixels from image, copying sourceRect (in image) into destRect (in
the resource). |
84 void setPixels(ResourceId, const uint8_t* image, const gfx::Rect& imageRect,
const gfx::Rect& sourceRect, const gfx::Vector2d& destOffset); | 88 void setPixels(ResourceId, const uint8_t* image, const gfx::Rect& imageRect,
const gfx::Rect& sourceRect, const gfx::Vector2d& destOffset); |
85 | 89 |
86 // Check upload status. | 90 // Check upload status. |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 GLenum m_bestTextureFormat; | 294 GLenum m_bestTextureFormat; |
291 | 295 |
292 base::ThreadChecker m_threadChecker; | 296 base::ThreadChecker m_threadChecker; |
293 | 297 |
294 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); | 298 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); |
295 }; | 299 }; |
296 | 300 |
297 } | 301 } |
298 | 302 |
299 #endif // CC_RESOURCE_PROVIDER_H_ | 303 #endif // CC_RESOURCE_PROVIDER_H_ |
OLD | NEW |