Index: src/gpu/GrImageIDTextureAdjuster.cpp |
diff --git a/src/gpu/GrImageIDTextureAdjuster.cpp b/src/gpu/GrImageIDTextureAdjuster.cpp |
index 2edff60553c2118466f5e11773bf87781309ba77..58dc5b975b821c8958e25956b3a92763fec1a66b 100644 |
--- a/src/gpu/GrImageIDTextureAdjuster.cpp |
+++ b/src/gpu/GrImageIDTextureAdjuster.cpp |
@@ -81,7 +81,7 @@ GrBitmapTextureMaker::GrBitmapTextureMaker(GrContext* context, const SkBitmap& b |
} |
} |
-GrTexture* GrBitmapTextureMaker::refOriginalTexture() { |
+GrTexture* GrBitmapTextureMaker::refOriginalTexture(bool willBeMipped) { |
GrTexture* tex; |
if (fOriginalKey.isValid()) { |
@@ -91,7 +91,11 @@ GrTexture* GrBitmapTextureMaker::refOriginalTexture() { |
} |
} |
- tex = GrUploadBitmapToTexture(this->context(), fBitmap); |
+ if (willBeMipped) { |
+ tex = GrGenerateMipMapsAndUploadToTexture(this->context(), fBitmap); |
+ } else { |
+ tex = GrUploadBitmapToTexture(this->context(), fBitmap); |
+ } |
if (tex && fOriginalKey.isValid()) { |
tex->resourcePriv().setUniqueKey(fOriginalKey); |
GrInstallBitmapUniqueKeyInvalidator(fOriginalKey, fBitmap.pixelRef()); |
@@ -126,8 +130,8 @@ GrImageTextureMaker::GrImageTextureMaker(GrContext* context, SkImageCacherator* |
} |
} |
-GrTexture* GrImageTextureMaker::refOriginalTexture() { |
- return fCacher->lockTexture(this->context(), fOriginalKey, fClient, fCachingHint); |
+GrTexture* GrImageTextureMaker::refOriginalTexture(bool willBeMipped) { |
+ return fCacher->lockTexture(this->context(), fOriginalKey, fClient, fCachingHint, willBeMipped); |
} |
void GrImageTextureMaker::makeCopyKey(const CopyParams& stretch, GrUniqueKey* paramsCopyKey) { |