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

Side by Side Diff: src/gpu/GrTexturePriv.h

Issue 858123002: Add specialized content key class for resources. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove default template arg Created 5 years, 11 months 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
« no previous file with comments | « src/gpu/GrTexture.cpp ('k') | src/gpu/SkGr.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 ComputeKey(const GrGpu* gpu,
43 const GrTextureParams* params,
44 const GrSurfaceDesc& desc,
45 const GrCacheID& cacheID);
46 static void ComputeScratchKey(const GrSurfaceDesc&, GrScratchKey*); 42 static void ComputeScratchKey(const GrSurfaceDesc&, GrScratchKey*);
47 static bool NeedsResizing(const GrResourceKey& key);
48 static bool NeedsBilerp(const GrResourceKey& key);
49
50 43
51 // TODO: Move this logic and the shift values out of here and to the callers . 44 // TODO: Move this logic and the shift values out of here and to the callers .
52 SkFixed normalizeFixedX(SkFixed x) const { 45 SkFixed normalizeFixedX(SkFixed x) const {
53 SkASSERT(SkIsPow2(fTexture->fDesc.fWidth)); 46 SkASSERT(SkIsPow2(fTexture->fDesc.fWidth));
54 return x >> fTexture->fShiftFixedX; 47 return x >> fTexture->fShiftFixedX;
55 } 48 }
56 49
57 SkFixed normalizeFixedY(SkFixed y) const { 50 SkFixed normalizeFixedY(SkFixed y) const {
58 SkASSERT(SkIsPow2(fTexture->fDesc.fHeight)); 51 SkASSERT(SkIsPow2(fTexture->fDesc.fHeight));
59 return y >> fTexture->fShiftFixedY; 52 return y >> fTexture->fShiftFixedY;
(...skipping 13 matching lines...) Expand all
73 friend class GrTexture; // to construct/copy this type. 66 friend class GrTexture; // to construct/copy this type.
74 }; 67 };
75 68
76 inline GrTexturePriv GrTexture::texturePriv() { return GrTexturePriv(this); } 69 inline GrTexturePriv GrTexture::texturePriv() { return GrTexturePriv(this); }
77 70
78 inline const GrTexturePriv GrTexture::texturePriv () const { 71 inline const GrTexturePriv GrTexture::texturePriv () const {
79 return GrTexturePriv(const_cast<GrTexture*>(this)); 72 return GrTexturePriv(const_cast<GrTexture*>(this));
80 } 73 }
81 74
82 #endif 75 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrTexture.cpp ('k') | src/gpu/SkGr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698