OLD | NEW |
---|---|
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 #ifndef GrTexture_DEFINED | 9 #ifndef GrTexture_DEFINED |
10 #define GrTexture_DEFINED | 10 #define GrTexture_DEFINED |
(...skipping 25 matching lines...) Expand all Loading... | |
36 | 36 |
37 void setFlag(GrTextureFlags flags) { | 37 void setFlag(GrTextureFlags flags) { |
38 fDesc.fFlags = fDesc.fFlags | flags; | 38 fDesc.fFlags = fDesc.fFlags | flags; |
39 } | 39 } |
40 void resetFlag(GrTextureFlags flags) { | 40 void resetFlag(GrTextureFlags flags) { |
41 fDesc.fFlags = fDesc.fFlags & ~flags; | 41 fDesc.fFlags = fDesc.fFlags & ~flags; |
42 } | 42 } |
43 bool isSetFlag(GrTextureFlags flags) const { | 43 bool isSetFlag(GrTextureFlags flags) const { |
44 return 0 != (fDesc.fFlags & flags); | 44 return 0 != (fDesc.fFlags & flags); |
45 } | 45 } |
46 | |
47 void dirtyMipMaps(bool mipMapsDirty) { | |
reed1
2013/07/25 21:24:36
Do these need to be public? Seems like an easy way
| |
48 fMipMapsDirty = mipMapsDirty; | |
49 } | |
50 | |
51 bool mipMapsAreDirty() const { | |
52 return fMipMapsDirty; | |
53 } | |
46 | 54 |
47 /** | 55 /** |
48 * Approximate number of bytes used by the texture | 56 * Approximate number of bytes used by the texture |
49 */ | 57 */ |
50 virtual size_t sizeInBytes() const SK_OVERRIDE { | 58 virtual size_t sizeInBytes() const SK_OVERRIDE { |
51 return (size_t) fDesc.fWidth * | 59 return (size_t) fDesc.fWidth * |
52 fDesc.fHeight * | 60 fDesc.fHeight * |
53 GrBytesPerPixel(fDesc.fConfig); | 61 GrBytesPerPixel(fDesc.fConfig); |
54 } | 62 } |
55 | 63 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
148 virtual void onRelease() SK_OVERRIDE; | 156 virtual void onRelease() SK_OVERRIDE; |
149 virtual void onAbandon() SK_OVERRIDE; | 157 virtual void onAbandon() SK_OVERRIDE; |
150 | 158 |
151 void validateDesc() const; | 159 void validateDesc() const; |
152 | 160 |
153 private: | 161 private: |
154 // these two shift a fixed-point value into normalized coordinates | 162 // these two shift a fixed-point value into normalized coordinates |
155 // for this texture if the texture is power of two sized. | 163 // for this texture if the texture is power of two sized. |
156 int fShiftFixedX; | 164 int fShiftFixedX; |
157 int fShiftFixedY; | 165 int fShiftFixedY; |
166 | |
167 bool fMipMapsDirty; | |
bsalomon
2013/07/25 21:36:58
need to init this in the cons to true, right?
| |
158 | 168 |
159 virtual void internal_dispose() const SK_OVERRIDE; | 169 virtual void internal_dispose() const SK_OVERRIDE; |
160 | 170 |
161 typedef GrSurface INHERITED; | 171 typedef GrSurface INHERITED; |
162 }; | 172 }; |
163 | 173 |
164 /** | 174 /** |
165 * Represents a texture that is intended to be accessed in device coords with an offset. | 175 * Represents a texture that is intended to be accessed in device coords with an offset. |
166 */ | 176 */ |
167 class GrDeviceCoordTexture { | 177 class GrDeviceCoordTexture { |
(...skipping 25 matching lines...) Expand all Loading... | |
193 GrTexture* setTexture(GrTexture* texture) { | 203 GrTexture* setTexture(GrTexture* texture) { |
194 fTexture.reset(SkSafeRef(texture)); | 204 fTexture.reset(SkSafeRef(texture)); |
195 return texture; | 205 return texture; |
196 } | 206 } |
197 private: | 207 private: |
198 SkAutoTUnref<GrTexture> fTexture; | 208 SkAutoTUnref<GrTexture> fTexture; |
199 SkIPoint fOffset; | 209 SkIPoint fOffset; |
200 }; | 210 }; |
201 | 211 |
202 #endif | 212 #endif |
OLD | NEW |