OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef GrTexturePriv_DEFINED | 8 #ifndef GrTexturePriv_DEFINED |
9 #define GrTexturePriv_DEFINED | 9 #define GrTexturePriv_DEFINED |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 void dirtyMipMaps(bool mipMapsDirty) { fTexture->dirtyMipMaps(mipMapsDirty);
} | 32 void dirtyMipMaps(bool mipMapsDirty) { fTexture->dirtyMipMaps(mipMapsDirty);
} |
33 | 33 |
34 bool mipMapsAreDirty() const { | 34 bool mipMapsAreDirty() const { |
35 return GrTexture::kValid_MipMapsStatus != fTexture->fMipMapsStatus; | 35 return GrTexture::kValid_MipMapsStatus != fTexture->fMipMapsStatus; |
36 } | 36 } |
37 | 37 |
38 bool hasMipMaps() const { | 38 bool hasMipMaps() const { |
39 return GrTexture::kNotAllocated_MipMapsStatus != fTexture->fMipMapsStatu
s; | 39 return GrTexture::kNotAllocated_MipMapsStatus != fTexture->fMipMapsStatu
s; |
40 } | 40 } |
41 | 41 |
| 42 void setMaxMipMapLevel(int maxMipMapLevel) const { |
| 43 fTexture->fMaxMipMapLevel = maxMipMapLevel; |
| 44 } |
| 45 |
| 46 int maxMipMapLevel() const { |
| 47 return fTexture->fMaxMipMapLevel; |
| 48 } |
| 49 |
42 static void ComputeScratchKey(const GrSurfaceDesc&, GrScratchKey*); | 50 static void ComputeScratchKey(const GrSurfaceDesc&, GrScratchKey*); |
43 | 51 |
44 private: | 52 private: |
45 GrTexturePriv(GrTexture* texture) : fTexture(texture) { } | 53 GrTexturePriv(GrTexture* texture) : fTexture(texture) { } |
46 GrTexturePriv(const GrTexturePriv& that) : fTexture(that.fTexture) { } | 54 GrTexturePriv(const GrTexturePriv& that) : fTexture(that.fTexture) { } |
47 GrTexturePriv& operator=(const GrTexturePriv&); // unimpl | 55 GrTexturePriv& operator=(const GrTexturePriv&); // unimpl |
48 | 56 |
49 // No taking addresses of this type. | 57 // No taking addresses of this type. |
50 const GrTexturePriv* operator&() const; | 58 const GrTexturePriv* operator&() const; |
51 GrTexturePriv* operator&(); | 59 GrTexturePriv* operator&(); |
52 | 60 |
53 GrTexture* fTexture; | 61 GrTexture* fTexture; |
54 | 62 |
55 friend class GrTexture; // to construct/copy this type. | 63 friend class GrTexture; // to construct/copy this type. |
56 }; | 64 }; |
57 | 65 |
58 inline GrTexturePriv GrTexture::texturePriv() { return GrTexturePriv(this); } | 66 inline GrTexturePriv GrTexture::texturePriv() { return GrTexturePriv(this); } |
59 | 67 |
60 inline const GrTexturePriv GrTexture::texturePriv () const { | 68 inline const GrTexturePriv GrTexture::texturePriv () const { |
61 return GrTexturePriv(const_cast<GrTexture*>(this)); | 69 return GrTexturePriv(const_cast<GrTexture*>(this)); |
62 } | 70 } |
63 | 71 |
64 #endif | 72 #endif |
OLD | NEW |