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" |
11 #include "base/threading/thread_checker.h" | 11 #include "base/threading/thread_checker.h" |
12 #include "cc/cc_export.h" | 12 #include "cc/cc_export.h" |
13 #include "cc/output_surface.h" | 13 #include "cc/output_surface.h" |
14 #include "cc/texture_copier.h" | 14 #include "cc/texture_copier.h" |
15 #include "cc/transferable_resource.h" | 15 #include "cc/transferable_resource.h" |
16 #include "third_party/khronos/GLES2/gl2.h" | 16 #include "third_party/khronos/GLES2/gl2.h" |
17 #include "third_party/skia/include/core/SkBitmap.h" | 17 #include "third_party/skia/include/core/SkBitmap.h" |
18 #include "third_party/skia/include/core/SkCanvas.h" | 18 #include "third_party/skia/include/core/SkCanvas.h" |
19 #include "ui/gfx/size.h" | 19 #include "ui/gfx/size.h" |
20 #include <deque> | 20 #include <deque> |
| 21 #include <string> |
21 #include <vector> | 22 #include <vector> |
22 | 23 |
23 namespace WebKit { | 24 namespace WebKit { |
24 class WebGraphicsContext3D; | 25 class WebGraphicsContext3D; |
25 } | 26 } |
26 | 27 |
27 namespace gfx { | 28 namespace gfx { |
28 class Rect; | 29 class Rect; |
29 class Vector2d; | 30 class Vector2d; |
30 } | 31 } |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 // Creates a resource which is tagged as being managed for GPU memory accoun
ting purposes. | 76 // 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 ResourceId createManagedResource(const gfx::Size&, GLenum format, TextureUsa
geHint); |
77 | 78 |
78 // You can also explicitly create a specific resource type. | 79 // You can also explicitly create a specific resource type. |
79 ResourceId createGLTexture(const gfx::Size&, GLenum format, GLenum texturePo
ol, TextureUsageHint); | 80 ResourceId createGLTexture(const gfx::Size&, GLenum format, GLenum texturePo
ol, TextureUsageHint); |
80 | 81 |
81 ResourceId createBitmap(const gfx::Size&); | 82 ResourceId createBitmap(const gfx::Size&); |
82 // Wraps an external texture into a GL resource. | 83 // Wraps an external texture into a GL resource. |
83 ResourceId createResourceFromExternalTexture(unsigned textureId); | 84 ResourceId createResourceFromExternalTexture(unsigned textureId); |
84 | 85 |
| 86 // Wraps an external texture mailbox into a GL resource. |
| 87 ResourceId createResourceFromTextureMailbox(const std::string& mailboxName); |
| 88 |
85 void deleteResource(ResourceId); | 89 void deleteResource(ResourceId); |
86 | 90 |
87 // Update pixels from image, copying sourceRect (in image) into destRect (in
the resource). | 91 // Update pixels from image, copying sourceRect (in image) into destRect (in
the resource). |
88 void setPixels(ResourceId, const uint8_t* image, const gfx::Rect& imageRect,
const gfx::Rect& sourceRect, const gfx::Vector2d& destOffset); | 92 void setPixels(ResourceId, const uint8_t* image, const gfx::Rect& imageRect,
const gfx::Rect& sourceRect, const gfx::Vector2d& destOffset); |
89 | 93 |
90 // Check upload status. | 94 // Check upload status. |
91 size_t numBlockingUploads(); | 95 size_t numBlockingUploads(); |
92 void markPendingUploadsAsNonBlocking(); | 96 void markPendingUploadsAsNonBlocking(); |
93 double estimatedUploadsPerSecond(); | 97 double estimatedUploadsPerSecond(); |
94 void flushUploads(); | 98 void flushUploads(); |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 GLenum m_bestTextureFormat; | 298 GLenum m_bestTextureFormat; |
295 | 299 |
296 base::ThreadChecker m_threadChecker; | 300 base::ThreadChecker m_threadChecker; |
297 | 301 |
298 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); | 302 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); |
299 }; | 303 }; |
300 | 304 |
301 } | 305 } |
302 | 306 |
303 #endif // CC_RESOURCE_PROVIDER_H_ | 307 #endif // CC_RESOURCE_PROVIDER_H_ |
OLD | NEW |