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 24 matching lines...) Expand all Loading... |
35 * platform. e.g. on OpenGL, return the texture ID. | 35 * platform. e.g. on OpenGL, return the texture ID. |
36 */ | 36 */ |
37 virtual GrBackendObject getTextureHandle() const = 0; | 37 virtual GrBackendObject getTextureHandle() const = 0; |
38 | 38 |
39 /** | 39 /** |
40 * This function indicates that the texture parameters (wrap mode, filtering
, ...) have been | 40 * This function indicates that the texture parameters (wrap mode, filtering
, ...) have been |
41 * changed externally to Skia. | 41 * changed externally to Skia. |
42 */ | 42 */ |
43 virtual void textureParamsModified() = 0; | 43 virtual void textureParamsModified() = 0; |
44 | 44 |
| 45 /** |
| 46 * Informational texture flags. This will be removed soon. |
| 47 */ |
| 48 enum FlagBits { |
| 49 kFirstBit = (kLastPublic_GrTextureFlagBit << 1), |
| 50 |
| 51 /** |
| 52 * This texture should be returned to the texture cache when |
| 53 * it is no longer reffed |
| 54 */ |
| 55 kReturnToCache_FlagBit = kFirstBit, |
| 56 }; |
| 57 |
| 58 void resetFlag(GrTextureFlags flags) { |
| 59 fDesc.fFlags = fDesc.fFlags & ~flags; |
| 60 } |
| 61 |
45 #ifdef SK_DEBUG | 62 #ifdef SK_DEBUG |
46 void validate() const { | 63 void validate() const { |
47 this->INHERITED::validate(); | 64 this->INHERITED::validate(); |
48 this->validateDesc(); | 65 this->validateDesc(); |
49 } | 66 } |
50 #endif | 67 #endif |
51 | 68 |
52 /** Access methods that are only to be used within Skia code. */ | 69 /** Access methods that are only to be used within Skia code. */ |
53 inline GrTexturePriv texturePriv(); | 70 inline GrTexturePriv texturePriv(); |
54 inline const GrTexturePriv texturePriv() const; | 71 inline const GrTexturePriv texturePriv() const; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 fTexture.reset(SkSafeRef(texture)); | 138 fTexture.reset(SkSafeRef(texture)); |
122 return texture; | 139 return texture; |
123 } | 140 } |
124 | 141 |
125 private: | 142 private: |
126 SkAutoTUnref<GrTexture> fTexture; | 143 SkAutoTUnref<GrTexture> fTexture; |
127 SkIPoint fOffset; | 144 SkIPoint fOffset; |
128 }; | 145 }; |
129 | 146 |
130 #endif | 147 #endif |
OLD | NEW |