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

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

Issue 2007973002: Manually generated sRGB mipmaps. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Break long columns Created 4 years, 6 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/gl/GrGLGpu.h » ('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 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); } 32 void dirtyMipMaps(bool mipMapsDirty, bool sRGBCorrect = false) {
33 fTexture->dirtyMipMaps(mipMapsDirty, sRGBCorrect);
34 }
33 35
34 bool mipMapsAreDirty() const { 36 bool mipMapsAreDirty() const {
35 return GrTexture::kValid_MipMapsStatus != fTexture->fMipMapsStatus; 37 return GrTexture::kValid_MipMapsStatus != fTexture->fMipMapsStatus;
36 } 38 }
37 39
38 bool hasMipMaps() const { 40 bool hasMipMaps() const {
39 return GrTexture::kNotAllocated_MipMapsStatus != fTexture->fMipMapsStatu s; 41 return GrTexture::kNotAllocated_MipMapsStatus != fTexture->fMipMapsStatu s;
40 } 42 }
41 43
42 void setMaxMipMapLevel(int maxMipMapLevel) const { 44 void setMaxMipMapLevel(int maxMipMapLevel) const {
43 fTexture->fMaxMipMapLevel = maxMipMapLevel; 45 fTexture->fMaxMipMapLevel = maxMipMapLevel;
44 } 46 }
45 47
46 int maxMipMapLevel() const { 48 int maxMipMapLevel() const {
47 return fTexture->fMaxMipMapLevel; 49 return fTexture->fMaxMipMapLevel;
48 } 50 }
49 51
52 bool mipMapsAreSRGBCorrect() const {
53 return fTexture->fMipMapsAreSRGBCorrect;
54 }
55
50 static void ComputeScratchKey(const GrSurfaceDesc&, GrScratchKey*); 56 static void ComputeScratchKey(const GrSurfaceDesc&, GrScratchKey*);
51 57
52 private: 58 private:
53 GrTexturePriv(GrTexture* texture) : fTexture(texture) { } 59 GrTexturePriv(GrTexture* texture) : fTexture(texture) { }
54 GrTexturePriv(const GrTexturePriv& that) : fTexture(that.fTexture) { } 60 GrTexturePriv(const GrTexturePriv& that) : fTexture(that.fTexture) { }
55 GrTexturePriv& operator=(const GrTexturePriv&); // unimpl 61 GrTexturePriv& operator=(const GrTexturePriv&); // unimpl
56 62
57 // No taking addresses of this type. 63 // No taking addresses of this type.
58 const GrTexturePriv* operator&() const; 64 const GrTexturePriv* operator&() const;
59 GrTexturePriv* operator&(); 65 GrTexturePriv* operator&();
60 66
61 GrTexture* fTexture; 67 GrTexture* fTexture;
62 68
63 friend class GrTexture; // to construct/copy this type. 69 friend class GrTexture; // to construct/copy this type.
64 }; 70 };
65 71
66 inline GrTexturePriv GrTexture::texturePriv() { return GrTexturePriv(this); } 72 inline GrTexturePriv GrTexture::texturePriv() { return GrTexturePriv(this); }
67 73
68 inline const GrTexturePriv GrTexture::texturePriv () const { 74 inline const GrTexturePriv GrTexture::texturePriv () const {
69 return GrTexturePriv(const_cast<GrTexture*>(this)); 75 return GrTexturePriv(const_cast<GrTexture*>(this));
70 } 76 }
71 77
72 #endif 78 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrTexture.cpp ('k') | src/gpu/gl/GrGLGpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698