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 CCScopedTexture_h | 5 #ifndef CCScopedTexture_h |
6 #define CCScopedTexture_h | 6 #define CCScopedTexture_h |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "CCTexture.h" | 10 #include "CCTexture.h" |
11 | 11 |
12 #if !ASSERT_DISABLED | 12 #if !ASSERT_DISABLED |
13 #include "base/threading/platform_thread.h" | 13 #include "base/threading/platform_thread.h" |
14 #endif | 14 #endif |
15 | 15 |
16 namespace cc { | 16 namespace cc { |
17 | 17 |
18 class CCScopedTexture : protected CCTexture { | 18 class ScopedTexture : protected Texture { |
19 public: | 19 public: |
20 static scoped_ptr<CCScopedTexture> create(CCResourceProvider* resourceProvid
er) { return make_scoped_ptr(new CCScopedTexture(resourceProvider)); } | 20 static scoped_ptr<ScopedTexture> create(ResourceProvider* resourceProvider)
{ return make_scoped_ptr(new ScopedTexture(resourceProvider)); } |
21 virtual ~CCScopedTexture(); | 21 virtual ~ScopedTexture(); |
22 | 22 |
23 using CCTexture::id; | 23 using Texture::id; |
24 using CCTexture::size; | 24 using Texture::size; |
25 using CCTexture::format; | 25 using Texture::format; |
26 using CCTexture::bytes; | 26 using Texture::bytes; |
27 | 27 |
28 bool allocate(int pool, const IntSize&, GC3Denum format, CCResourceProvider:
:TextureUsageHint); | 28 bool allocate(int pool, const IntSize&, GC3Denum format, ResourceProvider::T
extureUsageHint); |
29 void free(); | 29 void free(); |
30 void leak(); | 30 void leak(); |
31 | 31 |
32 protected: | 32 protected: |
33 explicit CCScopedTexture(CCResourceProvider*); | 33 explicit ScopedTexture(ResourceProvider*); |
34 | 34 |
35 private: | 35 private: |
36 CCResourceProvider* m_resourceProvider; | 36 ResourceProvider* m_resourceProvider; |
37 | 37 |
38 #if !ASSERT_DISABLED | 38 #if !ASSERT_DISABLED |
39 base::PlatformThreadId m_allocateThreadIdentifier; | 39 base::PlatformThreadId m_allocateThreadIdentifier; |
40 #endif | 40 #endif |
41 | 41 |
42 DISALLOW_COPY_AND_ASSIGN(CCScopedTexture); | 42 DISALLOW_COPY_AND_ASSIGN(ScopedTexture); |
43 }; | 43 }; |
44 | 44 |
45 } | 45 } |
46 | 46 |
47 #endif | 47 #endif |
OLD | NEW |