OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 SkImageGenerator_DEFINED | 8 #ifndef SkImageGenerator_DEFINED |
9 #define SkImageGenerator_DEFINED | 9 #define SkImageGenerator_DEFINED |
10 | 10 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 * null. | 137 * null. |
138 * | 138 * |
139 * If the caller passes a non-null context, then the generator should only
succeed if: | 139 * If the caller passes a non-null context, then the generator should only
succeed if: |
140 * - it has no intrinsic context, and will use the caller's | 140 * - it has no intrinsic context, and will use the caller's |
141 * - its internal context is the same | 141 * - its internal context is the same |
142 * - it can somehow convert its texture into one that is valid for the prov
ided context. | 142 * - it can somehow convert its texture into one that is valid for the prov
ided context. |
143 * | 143 * |
144 * Regarding the SkImageUsageType parameter: | 144 * Regarding the SkImageUsageType parameter: |
145 * | 145 * |
146 * If the context (the provided one or the generator's intrinsic one) deter
mines that to | 146 * If the context (the provided one or the generator's intrinsic one) deter
mines that to |
147 * support the specified usage, it must return a different sized texture (f
rom the generator's | 147 * support the specified usage, it must return a different sized texture it
may, |
148 * native size) it may, so the caller must inspect the texture's width/heig
ht | 148 * so the caller must inspect the texture's width/height and compare them t
o the generator's |
149 * (unless kUntiled_SkImageUsedType was specified). | 149 * getInfo() width/height. |
150 */ | 150 */ |
151 GrTexture* generateTexture(GrContext*, SkImageUsageType); | 151 GrTexture* generateTexture(GrContext*, SkImageUsageType); |
152 | 152 |
153 /** | 153 /** |
154 * If the default image decoder system can interpret the specified (encoded
) data, then | 154 * If the default image decoder system can interpret the specified (encoded
) data, then |
155 * this returns a new ImageGenerator for it. Otherwise this returns NULL. E
ither way | 155 * this returns a new ImageGenerator for it. Otherwise this returns NULL. E
ither way |
156 * the caller is still responsible for managing their ownership of the data
. | 156 * the caller is still responsible for managing their ownership of the data
. |
157 */ | 157 */ |
158 static SkImageGenerator* NewFromEncoded(SkData*); | 158 static SkImageGenerator* NewFromEncoded(SkData*); |
159 | 159 |
(...skipping 22 matching lines...) Expand all Loading... |
182 const SkImageInfo fInfo; | 182 const SkImageInfo fInfo; |
183 const uint32_t fUniqueID; | 183 const uint32_t fUniqueID; |
184 | 184 |
185 // This is our default impl, which may be different on different platforms. | 185 // This is our default impl, which may be different on different platforms. |
186 // It is called from NewFromEncoded() after it has checked for any runtime f
actory. | 186 // It is called from NewFromEncoded() after it has checked for any runtime f
actory. |
187 // The SkData will never be NULL, as that will have been checked by NewFromE
ncoded. | 187 // The SkData will never be NULL, as that will have been checked by NewFromE
ncoded. |
188 static SkImageGenerator* NewFromEncodedImpl(SkData*); | 188 static SkImageGenerator* NewFromEncodedImpl(SkData*); |
189 }; | 189 }; |
190 | 190 |
191 #endif // SkImageGenerator_DEFINED | 191 #endif // SkImageGenerator_DEFINED |
OLD | NEW |