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 | |
62 #ifdef SK_DEBUG | 45 #ifdef SK_DEBUG |
63 void validate() const { | 46 void validate() const { |
64 this->INHERITED::validate(); | 47 this->INHERITED::validate(); |
65 this->validateDesc(); | 48 this->validateDesc(); |
66 } | 49 } |
67 #endif | 50 #endif |
68 | 51 |
69 /** Access methods that are only to be used within Skia code. */ | 52 /** Access methods that are only to be used within Skia code. */ |
70 inline GrTexturePriv texturePriv(); | 53 inline GrTexturePriv texturePriv(); |
71 inline const GrTexturePriv texturePriv() const; | 54 inline const GrTexturePriv texturePriv() const; |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 fTexture.reset(SkSafeRef(texture)); | 121 fTexture.reset(SkSafeRef(texture)); |
139 return texture; | 122 return texture; |
140 } | 123 } |
141 | 124 |
142 private: | 125 private: |
143 SkAutoTUnref<GrTexture> fTexture; | 126 SkAutoTUnref<GrTexture> fTexture; |
144 SkIPoint fOffset; | 127 SkIPoint fOffset; |
145 }; | 128 }; |
146 | 129 |
147 #endif | 130 #endif |
OLD | NEW |