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 "IntSize.h" | 8 #include "IntSize.h" |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/hash_tables.h" | 10 #include "base/hash_tables.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/threading/thread_checker.h" |
12 #include "cc/graphics_context.h" | 13 #include "cc/graphics_context.h" |
13 #include "cc/texture_copier.h" | 14 #include "cc/texture_copier.h" |
14 #include "third_party/khronos/GLES2/gl2.h" | 15 #include "third_party/khronos/GLES2/gl2.h" |
15 #include "third_party/skia/include/core/SkBitmap.h" | 16 #include "third_party/skia/include/core/SkBitmap.h" |
16 #include "third_party/skia/include/core/SkCanvas.h" | 17 #include "third_party/skia/include/core/SkCanvas.h" |
17 #include <deque> | 18 #include <deque> |
18 #include <vector> | 19 #include <vector> |
19 | 20 |
20 namespace WebKit { | 21 namespace WebKit { |
21 class WebGraphicsContext3D; | 22 class WebGraphicsContext3D; |
22 } | 23 } |
23 | 24 |
24 namespace cc { | 25 namespace cc { |
25 | 26 |
26 class IntRect; | 27 class IntRect; |
27 class LayerTextureSubImage; | 28 class LayerTextureSubImage; |
28 class TextureCopier; | 29 class TextureCopier; |
29 class TextureUploader; | 30 class TextureUploader; |
30 | 31 |
31 // Thread-safety notes: this class is not thread-safe and can only be called | 32 // This class is not thread-safe and can only be called from the thread it was |
32 // from the thread it was created on (in practice, the compositor thread). | 33 // created on (in practice, the impl thread). |
33 class ResourceProvider { | 34 class ResourceProvider { |
34 public: | 35 public: |
35 typedef unsigned ResourceId; | 36 typedef unsigned ResourceId; |
36 typedef std::vector<ResourceId> ResourceIdArray; | 37 typedef std::vector<ResourceId> ResourceIdArray; |
37 typedef base::hash_map<ResourceId, ResourceId> ResourceIdMap; | 38 typedef base::hash_map<ResourceId, ResourceId> ResourceIdMap; |
38 enum TextureUsageHint { TextureUsageAny, TextureUsageFramebuffer }; | 39 enum TextureUsageHint { TextureUsageAny, TextureUsageFramebuffer }; |
39 enum ResourceType { | 40 enum ResourceType { |
40 GLTexture = 1, | 41 GLTexture = 1, |
41 Bitmap, | 42 Bitmap, |
42 }; | 43 }; |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 std::deque<Mailbox> m_mailboxes; | 268 std::deque<Mailbox> m_mailboxes; |
268 | 269 |
269 ResourceType m_defaultResourceType; | 270 ResourceType m_defaultResourceType; |
270 bool m_useTextureStorageExt; | 271 bool m_useTextureStorageExt; |
271 bool m_useTextureUsageHint; | 272 bool m_useTextureUsageHint; |
272 bool m_useShallowFlush; | 273 bool m_useShallowFlush; |
273 scoped_ptr<TextureUploader> m_textureUploader; | 274 scoped_ptr<TextureUploader> m_textureUploader; |
274 scoped_ptr<AcceleratedTextureCopier> m_textureCopier; | 275 scoped_ptr<AcceleratedTextureCopier> m_textureCopier; |
275 int m_maxTextureSize; | 276 int m_maxTextureSize; |
276 | 277 |
| 278 base::ThreadChecker m_threadChecker; |
| 279 |
277 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); | 280 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); |
278 }; | 281 }; |
279 | 282 |
280 } | 283 } |
281 | 284 |
282 #endif | 285 #endif |
OLD | NEW |