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

Side by Side Diff: cc/prioritized_texture_manager.h

Issue 11365025: Make cc a component (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win?? 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 | Annotate | Revision Log
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 CCPrioritizedTextureManager_h 5 #ifndef CCPrioritizedTextureManager_h
6 #define CCPrioritizedTextureManager_h 6 #define CCPrioritizedTextureManager_h
7 7
8 #include <list> 8 #include <list>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/hash_tables.h" 12 #include "base/hash_tables.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "cc/cc_export.h"
14 #include "cc/prioritized_texture.h" 15 #include "cc/prioritized_texture.h"
15 #include "cc/priority_calculator.h" 16 #include "cc/priority_calculator.h"
16 #include "cc/texture.h" 17 #include "cc/texture.h"
17 #include "third_party/khronos/GLES2/gl2.h" 18 #include "third_party/khronos/GLES2/gl2.h"
18 #include "ui/gfx/size.h" 19 #include "ui/gfx/size.h"
19 20
20 #if defined(COMPILER_GCC) 21 #if defined(COMPILER_GCC)
21 namespace BASE_HASH_NAMESPACE { 22 namespace BASE_HASH_NAMESPACE {
22 template<> 23 template<>
23 struct hash<cc::PrioritizedTexture*> { 24 struct hash<cc::PrioritizedTexture*> {
24 size_t operator()(cc::PrioritizedTexture* ptr) const { 25 size_t operator()(cc::PrioritizedTexture* ptr) const {
25 return hash<size_t>()(reinterpret_cast<size_t>(ptr)); 26 return hash<size_t>()(reinterpret_cast<size_t>(ptr));
26 } 27 }
27 }; 28 };
28 } // namespace BASE_HASH_NAMESPACE 29 } // namespace BASE_HASH_NAMESPACE
29 #endif // COMPILER 30 #endif // COMPILER
30 31
31 namespace cc { 32 namespace cc {
32 33
33 class PriorityCalculator; 34 class PriorityCalculator;
34 35
35 class PrioritizedTextureManager { 36 class CC_EXPORT PrioritizedTextureManager {
36 public: 37 public:
37 static scoped_ptr<PrioritizedTextureManager> create(size_t maxMemoryLimitByt es, int maxTextureSize, int pool) 38 static scoped_ptr<PrioritizedTextureManager> create(size_t maxMemoryLimitByt es, int maxTextureSize, int pool)
38 { 39 {
39 return make_scoped_ptr(new PrioritizedTextureManager(maxMemoryLimitBytes , maxTextureSize, pool)); 40 return make_scoped_ptr(new PrioritizedTextureManager(maxMemoryLimitBytes , maxTextureSize, pool));
40 } 41 }
41 scoped_ptr<PrioritizedTexture> createTexture(gfx::Size size, GLenum format) 42 scoped_ptr<PrioritizedTexture> createTexture(gfx::Size size, GLenum format)
42 { 43 {
43 return make_scoped_ptr(new PrioritizedTexture(this, size, format)); 44 return make_scoped_ptr(new PrioritizedTexture(this, size, format));
44 } 45 }
45 ~PrioritizedTextureManager(); 46 ~PrioritizedTextureManager();
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
184 // Statistics copied at the time of pushTexturePrioritiesToBackings. 185 // Statistics copied at the time of pushTexturePrioritiesToBackings.
185 size_t m_memoryVisibleLastPushedBytes; 186 size_t m_memoryVisibleLastPushedBytes;
186 size_t m_memoryVisibleAndNearbyLastPushedBytes; 187 size_t m_memoryVisibleAndNearbyLastPushedBytes;
187 188
188 DISALLOW_COPY_AND_ASSIGN(PrioritizedTextureManager); 189 DISALLOW_COPY_AND_ASSIGN(PrioritizedTextureManager);
189 }; 190 };
190 191
191 } // namespace cc 192 } // namespace cc
192 193
193 #endif 194 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698