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