OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 GrTextureMaker_DEFINED | 8 #ifndef GrTextureMaker_DEFINED |
9 #define GrTextureMaker_DEFINED | 9 #define GrTextureMaker_DEFINED |
10 | 10 |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 | 178 |
179 protected: | 179 protected: |
180 GrTextureMaker(GrContext* context, int width, int height, bool isAlphaOnly) | 180 GrTextureMaker(GrContext* context, int width, int height, bool isAlphaOnly) |
181 : INHERITED(width, height, isAlphaOnly) | 181 : INHERITED(width, height, isAlphaOnly) |
182 , fContext(context) {} | 182 , fContext(context) {} |
183 | 183 |
184 /** | 184 /** |
185 * Return the maker's "original" texture. It is the responsibility of the m
aker to handle any | 185 * Return the maker's "original" texture. It is the responsibility of the m
aker to handle any |
186 * caching of the original if desired. | 186 * caching of the original if desired. |
187 */ | 187 */ |
188 virtual GrTexture* refOriginalTexture() = 0; | 188 virtual GrTexture* refOriginalTexture(bool willBeMipped) = 0; |
189 | 189 |
190 /** | 190 /** |
191 * Return a new (uncached) texture that is the stretch of the maker's origi
nal. | 191 * Return a new (uncached) texture that is the stretch of the maker's origi
nal. |
192 * | 192 * |
193 * The base-class handles general logic for this, and only needs access to
the following | 193 * The base-class handles general logic for this, and only needs access to
the following |
194 * method: | 194 * method: |
195 * - refOriginalTexture() | 195 * - refOriginalTexture() |
196 * | 196 * |
197 * Subclass may override this if they can handle creating the texture more
directly than | 197 * Subclass may override this if they can handle creating the texture more
directly than |
198 * by copying. | 198 * by copying. |
199 */ | 199 */ |
200 virtual GrTexture* generateTextureForParams(const CopyParams&); | 200 virtual GrTexture* generateTextureForParams(const CopyParams&, bool willBeMi
pped); |
201 | 201 |
202 GrContext* context() const { return fContext; } | 202 GrContext* context() const { return fContext; } |
203 | 203 |
204 private: | 204 private: |
205 GrContext* fContext; | 205 GrContext* fContext; |
206 | 206 |
207 typedef GrTextureProducer INHERITED; | 207 typedef GrTextureProducer INHERITED; |
208 }; | 208 }; |
209 | 209 |
210 #endif | 210 #endif |
OLD | NEW |