Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Side by Side Diff: cc/resource_provider.h

Issue 11232051: Remove static thread pointers from CC (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Apply code review comments Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/renderer.h ('k') | cc/resource_provider.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "cc/cc_export.h" 12 #include "cc/cc_export.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 "cc/transferable_resource.h" 15 #include "cc/transferable_resource.h"
15 #include "third_party/khronos/GLES2/gl2.h" 16 #include "third_party/khronos/GLES2/gl2.h"
16 #include "third_party/skia/include/core/SkBitmap.h" 17 #include "third_party/skia/include/core/SkBitmap.h"
17 #include "third_party/skia/include/core/SkCanvas.h" 18 #include "third_party/skia/include/core/SkCanvas.h"
18 #include "ui/gfx/size.h" 19 #include "ui/gfx/size.h"
19 #include <deque> 20 #include <deque>
20 #include <vector> 21 #include <vector>
21 22
22 namespace WebKit { 23 namespace WebKit {
23 class WebGraphicsContext3D; 24 class WebGraphicsContext3D;
24 } 25 }
25 26
26 namespace gfx { 27 namespace gfx {
27 class Rect; 28 class Rect;
28 class Vector2d; 29 class Vector2d;
29 } 30 }
30 31
31 namespace cc { 32 namespace cc {
32 33
33 class TextureUploader; 34 class TextureUploader;
34 35
35 // Thread-safety notes: this class is not thread-safe and can only be called 36 // This class is not thread-safe and can only be called from the thread it was
36 // from the thread it was created on (in practice, the compositor thread). 37 // created on (in practice, the impl thread).
37 class CC_EXPORT ResourceProvider { 38 class CC_EXPORT ResourceProvider {
38 public: 39 public:
39 typedef unsigned ResourceId; 40 typedef unsigned ResourceId;
40 typedef std::vector<ResourceId> ResourceIdArray; 41 typedef std::vector<ResourceId> ResourceIdArray;
41 typedef base::hash_map<ResourceId, ResourceId> ResourceIdMap; 42 typedef base::hash_map<ResourceId, ResourceId> ResourceIdMap;
42 enum TextureUsageHint { TextureUsageAny, TextureUsageFramebuffer }; 43 enum TextureUsageHint { TextureUsageAny, TextureUsageFramebuffer };
43 enum ResourceType { 44 enum ResourceType {
44 GLTexture = 1, 45 GLTexture = 1,
45 Bitmap, 46 Bitmap,
46 }; 47 };
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 std::deque<Mailbox> m_mailboxes; 256 std::deque<Mailbox> m_mailboxes;
256 257
257 ResourceType m_defaultResourceType; 258 ResourceType m_defaultResourceType;
258 bool m_useTextureStorageExt; 259 bool m_useTextureStorageExt;
259 bool m_useTextureUsageHint; 260 bool m_useTextureUsageHint;
260 bool m_useShallowFlush; 261 bool m_useShallowFlush;
261 scoped_ptr<TextureUploader> m_textureUploader; 262 scoped_ptr<TextureUploader> m_textureUploader;
262 scoped_ptr<AcceleratedTextureCopier> m_textureCopier; 263 scoped_ptr<AcceleratedTextureCopier> m_textureCopier;
263 int m_maxTextureSize; 264 int m_maxTextureSize;
264 265
266 base::ThreadChecker m_threadChecker;
267
265 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); 268 DISALLOW_COPY_AND_ASSIGN(ResourceProvider);
266 }; 269 };
267 270
268 } 271 }
269 272
270 #endif // CC_RESOURCE_PROVIDER_H_ 273 #endif // CC_RESOURCE_PROVIDER_H_
OLDNEW
« no previous file with comments | « cc/renderer.h ('k') | cc/resource_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698