| Index: src/gpu/GrImageIDTextureAdjuster.cpp
|
| diff --git a/src/gpu/GrImageIDTextureAdjuster.cpp b/src/gpu/GrImageIDTextureAdjuster.cpp
|
| index 2edff60553c2118466f5e11773bf87781309ba77..5e8b0097d0ab35a30796c3175e5e3872e322f767 100644
|
| --- a/src/gpu/GrImageIDTextureAdjuster.cpp
|
| +++ b/src/gpu/GrImageIDTextureAdjuster.cpp
|
| @@ -10,6 +10,7 @@
|
| #include "GrContext.h"
|
| #include "GrGpuResourcePriv.h"
|
| #include "SkBitmap.h"
|
| +#include "SkCanvas.h"
|
| #include "SkGrPriv.h"
|
| #include "SkImage_Base.h"
|
| #include "SkImageCacherator.h"
|
| @@ -81,7 +82,7 @@ GrBitmapTextureMaker::GrBitmapTextureMaker(GrContext* context, const SkBitmap& b
|
| }
|
| }
|
|
|
| -GrTexture* GrBitmapTextureMaker::refOriginalTexture() {
|
| +GrTexture* GrBitmapTextureMaker::refOriginalTexture(bool willBeMipped) {
|
| GrTexture* tex;
|
|
|
| if (fOriginalKey.isValid()) {
|
| @@ -91,7 +92,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 +131,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) {
|
|
|