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

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: Rebasing. Created 4 years, 10 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
« no previous file with comments | « src/gpu/GrTextureParamsAdjuster.h ('k') | src/gpu/GrTexturePriv.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrTextureParamsAdjuster.cpp
diff --git a/src/gpu/GrTextureParamsAdjuster.cpp b/src/gpu/GrTextureParamsAdjuster.cpp
index a78987cfb77602d9357d4da1751bd766a4b42168..7affae6561a32bdd18e3288d08694c2bbfa5ea47 100644
--- a/src/gpu/GrTextureParamsAdjuster.cpp
+++ b/src/gpu/GrTextureParamsAdjuster.cpp
@@ -432,9 +432,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);
@@ -445,7 +451,7 @@ GrTexture* GrTextureMaker::refTextureForParams(const GrTextureParams& params) {
}
}
- GrTexture* result = this->generateTextureForParams(copyParams);
+ GrTexture* result = this->generateTextureForParams(copyParams, willBeMipped);
if (!result) {
return nullptr;
}
@@ -499,8 +505,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;
}
« no previous file with comments | « src/gpu/GrTextureParamsAdjuster.h ('k') | src/gpu/GrTexturePriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698