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 static GrResourceKey::ResourceType ResourceType() { | |
43 static const GrResourceKey::ResourceType gType = GrResourceKey::Generate
ResourceType(); | |
44 return gType; | |
45 } | |
46 | |
47 static GrResourceKey ComputeKey(const GrGpu* gpu, | 42 static GrResourceKey ComputeKey(const GrGpu* gpu, |
48 const GrTextureParams* params, | 43 const GrTextureParams* params, |
49 const GrSurfaceDesc& desc, | 44 const GrSurfaceDesc& desc, |
50 const GrCacheID& cacheID); | 45 const GrCacheID& cacheID); |
51 static GrResourceKey ComputeScratchKey(const GrSurfaceDesc& desc); | 46 static void ComputeScratchKey(const GrSurfaceDesc&, GrScratchKey*); |
52 static bool NeedsResizing(const GrResourceKey& key); | 47 static bool NeedsResizing(const GrResourceKey& key); |
53 static bool NeedsBilerp(const GrResourceKey& key); | 48 static bool NeedsBilerp(const GrResourceKey& key); |
54 | 49 |
55 | 50 |
56 // TODO: Move this logic and the shift values out of here and to the callers
. | 51 // TODO: Move this logic and the shift values out of here and to the callers
. |
57 SkFixed normalizeFixedX(SkFixed x) const { | 52 SkFixed normalizeFixedX(SkFixed x) const { |
58 SkASSERT(SkIsPow2(fTexture->fDesc.fWidth)); | 53 SkASSERT(SkIsPow2(fTexture->fDesc.fWidth)); |
59 return x >> fTexture->fShiftFixedX; | 54 return x >> fTexture->fShiftFixedX; |
60 } | 55 } |
61 | 56 |
(...skipping 16 matching lines...) Expand all Loading... |
78 friend class GrTexture; // to construct/copy this type. | 73 friend class GrTexture; // to construct/copy this type. |
79 }; | 74 }; |
80 | 75 |
81 inline GrTexturePriv GrTexture::texturePriv() { return GrTexturePriv(this); } | 76 inline GrTexturePriv GrTexture::texturePriv() { return GrTexturePriv(this); } |
82 | 77 |
83 inline const GrTexturePriv GrTexture::texturePriv () const { | 78 inline const GrTexturePriv GrTexture::texturePriv () const { |
84 return GrTexturePriv(const_cast<GrTexture*>(this)); | 79 return GrTexturePriv(const_cast<GrTexture*>(this)); |
85 } | 80 } |
86 | 81 |
87 #endif | 82 #endif |
OLD | NEW |