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 11 matching lines...) Expand all Loading... |
22 } | 22 } |
23 | 23 |
24 void resetFlag(GrSurfaceFlags flags) { | 24 void resetFlag(GrSurfaceFlags flags) { |
25 fTexture->fDesc.fFlags = fTexture->fDesc.fFlags & ~flags; | 25 fTexture->fDesc.fFlags = fTexture->fDesc.fFlags & ~flags; |
26 } | 26 } |
27 | 27 |
28 bool isSetFlag(GrSurfaceFlags flags) const { | 28 bool isSetFlag(GrSurfaceFlags flags) const { |
29 return 0 != (fTexture->fDesc.fFlags & flags); | 29 return 0 != (fTexture->fDesc.fFlags & flags); |
30 } | 30 } |
31 | 31 |
32 void dirtyMipMaps(bool mipMapsDirty) { fTexture->dirtyMipMaps(mipMapsDirty);
} | |
33 | |
34 bool mipMapsAreDirty() const { | |
35 return GrTexture::kValid_MipMapsStatus != fTexture->fMipMapsStatus; | |
36 } | |
37 | |
38 bool hasMipMaps() const { | 32 bool hasMipMaps() const { |
39 return GrTexture::kNotAllocated_MipMapsStatus != fTexture->fMipMapsStatu
s; | 33 return GrTexture::kNotAllocated_MipMapsStatus != fTexture->fMipMapsStatu
s; |
40 } | 34 } |
41 | 35 |
42 static void ComputeScratchKey(const GrSurfaceDesc&, GrScratchKey*); | 36 static void ComputeScratchKey(const GrSurfaceDesc&, GrScratchKey*); |
43 | 37 |
44 // TODO: Move this logic and the shift values out of here and to the callers
. | 38 // TODO: Move this logic and the shift values out of here and to the callers
. |
45 SkFixed normalizeFixedX(SkFixed x) const { | 39 SkFixed normalizeFixedX(SkFixed x) const { |
46 SkASSERT(SkIsPow2(fTexture->fDesc.fWidth)); | 40 SkASSERT(SkIsPow2(fTexture->fDesc.fWidth)); |
47 return x >> fTexture->fShiftFixedX; | 41 return x >> fTexture->fShiftFixedX; |
(...skipping 18 matching lines...) Expand all Loading... |
66 friend class GrTexture; // to construct/copy this type. | 60 friend class GrTexture; // to construct/copy this type. |
67 }; | 61 }; |
68 | 62 |
69 inline GrTexturePriv GrTexture::texturePriv() { return GrTexturePriv(this); } | 63 inline GrTexturePriv GrTexture::texturePriv() { return GrTexturePriv(this); } |
70 | 64 |
71 inline const GrTexturePriv GrTexture::texturePriv () const { | 65 inline const GrTexturePriv GrTexture::texturePriv () const { |
72 return GrTexturePriv(const_cast<GrTexture*>(this)); | 66 return GrTexturePriv(const_cast<GrTexture*>(this)); |
73 } | 67 } |
74 | 68 |
75 #endif | 69 #endif |
OLD | NEW |