Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(483)

Unified Diff: src/gpu/GrTextureParamsAdjuster.cpp

Issue 1249543003: Creating functions for uploading a mipmapped texture. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Fixing iOS. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/GrTextureParamsAdjuster.cpp
diff --git a/src/gpu/GrTextureParamsAdjuster.cpp b/src/gpu/GrTextureParamsAdjuster.cpp
index 336ab6b10c4a8f37d9bf96763be57f7144e6c3c7..0d36370d083327b804478cdbfef347e02fc53784 100644
--- a/src/gpu/GrTextureParamsAdjuster.cpp
+++ b/src/gpu/GrTextureParamsAdjuster.cpp
@@ -410,9 +410,15 @@ const GrFragmentProcessor* GrTextureAdjuster::createFragmentProcessor(
GrTexture* GrTextureMaker::refTextureForParams(const GrTextureParams& params) {
CopyParams copyParams;
+ bool willBeMipped = params.filterMode() == GrTextureParams::kMipMap_FilterMode;
+
+ if (!fContext->caps()->mipMapSupport()) {
+ willBeMipped = false;
+ }
+
if (!fContext->getGpu()->makeCopyForTextureParams(this->width(), this->height(), params,
&copyParams)) {
- return this->refOriginalTexture();
+ return this->refOriginalTexture(willBeMipped);
}
GrUniqueKey copyKey;
this->makeCopyKey(copyParams, &copyKey);
@@ -423,7 +429,7 @@ GrTexture* GrTextureMaker::refTextureForParams(const GrTextureParams& params) {
}
}
- GrTexture* result = this->generateTextureForParams(copyParams);
+ GrTexture* result = this->generateTextureForParams(copyParams, willBeMipped);
if (!result) {
return nullptr;
}
@@ -477,8 +483,9 @@ const GrFragmentProcessor* GrTextureMaker::createFragmentProcessor(
filterOrNullForBicubic);
}
-GrTexture* GrTextureMaker::generateTextureForParams(const CopyParams& copyParams) {
- SkAutoTUnref<GrTexture> original(this->refOriginalTexture());
+GrTexture* GrTextureMaker::generateTextureForParams(const CopyParams& copyParams,
+ bool willBeMipped) {
+ SkAutoTUnref<GrTexture> original(this->refOriginalTexture(willBeMipped));
if (!original) {
return nullptr;
}

Powered by Google App Engine
This is Rietveld 408576698