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

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

Issue 1249543003: Creating functions for uploading a mipmapped texture. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Removing the concept of a dirty mipmap. It is expected that the texture upload provides the mipmaps. Created 5 years, 3 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
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 11 matching lines...) Expand all
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698