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

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: Fix unit test hang by explicitly NULLing out impl_thread_message_loop_proxy_ 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
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 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"
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 "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 "ui/gfx/size.h" 18 #include "ui/gfx/size.h"
18 #include <deque> 19 #include <deque>
19 #include <vector> 20 #include <vector>
20 21
21 namespace WebKit { 22 namespace WebKit {
22 class WebGraphicsContext3D; 23 class WebGraphicsContext3D;
23 } 24 }
24 25
25 namespace gfx { 26 namespace gfx {
26 class Rect; 27 class Rect;
27 class Vector2d; 28 class Vector2d;
28 } 29 }
29 30
30 namespace cc { 31 namespace cc {
31 32
32 class TextureUploader; 33 class TextureUploader;
33 34
34 // Thread-safety notes: this class is not thread-safe and can only be called 35 // This class is not thread-safe and can only be called from the thread it was
35 // from the thread it was created on (in practice, the compositor thread). 36 // created on (in practice, the impl thread).
36 class CC_EXPORT ResourceProvider { 37 class CC_EXPORT ResourceProvider {
37 public: 38 public:
38 typedef unsigned ResourceId; 39 typedef unsigned ResourceId;
39 typedef std::vector<ResourceId> ResourceIdArray; 40 typedef std::vector<ResourceId> ResourceIdArray;
40 typedef base::hash_map<ResourceId, ResourceId> ResourceIdMap; 41 typedef base::hash_map<ResourceId, ResourceId> ResourceIdMap;
41 enum TextureUsageHint { TextureUsageAny, TextureUsageFramebuffer }; 42 enum TextureUsageHint { TextureUsageAny, TextureUsageFramebuffer };
42 enum ResourceType { 43 enum ResourceType {
43 GLTexture = 1, 44 GLTexture = 1,
44 Bitmap, 45 Bitmap,
45 }; 46 };
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 std::deque<Mailbox> m_mailboxes; 271 std::deque<Mailbox> m_mailboxes;
271 272
272 ResourceType m_defaultResourceType; 273 ResourceType m_defaultResourceType;
273 bool m_useTextureStorageExt; 274 bool m_useTextureStorageExt;
274 bool m_useTextureUsageHint; 275 bool m_useTextureUsageHint;
275 bool m_useShallowFlush; 276 bool m_useShallowFlush;
276 scoped_ptr<TextureUploader> m_textureUploader; 277 scoped_ptr<TextureUploader> m_textureUploader;
277 scoped_ptr<AcceleratedTextureCopier> m_textureCopier; 278 scoped_ptr<AcceleratedTextureCopier> m_textureCopier;
278 int m_maxTextureSize; 279 int m_maxTextureSize;
279 280
281 base::ThreadChecker m_threadChecker;
282
280 DISALLOW_COPY_AND_ASSIGN(ResourceProvider); 283 DISALLOW_COPY_AND_ASSIGN(ResourceProvider);
281 }; 284 };
282 285
283 } 286 }
284 287
285 #endif 288 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698