Rename GrTextureParams to GrSamplerParams
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4965
Change-Id: I7d52e81c670e92ca96117284f44b274ce3cc3671
Reviewed-on: https://skia-review.googlesource.com/4965
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp b/experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp
index 3acb74d..da13732 100644
--- a/experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp
+++ b/experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp
@@ -1319,8 +1319,8 @@
m.setTranslateY(-localMatrix.getTranslateY() + SK_Scalar1);
if (fType == kImprovedNoise_Type) {
- GrTextureParams textureParams(SkShader::TileMode::kRepeat_TileMode,
- GrTextureParams::FilterMode::kNone_FilterMode);
+ GrSamplerParams textureParams(SkShader::TileMode::kRepeat_TileMode,
+ GrSamplerParams::FilterMode::kNone_FilterMode);
sk_sp<GrTexture> permutationsTexture(
GrRefCachedBitmapTexture(args.fContext, paintingData->getImprovedPermutationsBitmap(),
textureParams, args.fColorMode));
@@ -1350,10 +1350,10 @@
sk_sp<GrTexture> permutationsTexture(
GrRefCachedBitmapTexture(args.fContext, paintingData->getPermutationsBitmap(),
- GrTextureParams::ClampNoFilter(), args.fColorMode));
+ GrSamplerParams::ClampNoFilter(), args.fColorMode));
sk_sp<GrTexture> noiseTexture(
GrRefCachedBitmapTexture(args.fContext, paintingData->getNoiseBitmap(),
- GrTextureParams::ClampNoFilter(), args.fColorMode));
+ GrSamplerParams::ClampNoFilter(), args.fColorMode));
if ((permutationsTexture) && (noiseTexture)) {
sk_sp<GrFragmentProcessor> inner(
diff --git a/gm/image_pict.cpp b/gm/image_pict.cpp
index 903024b..148426d 100644
--- a/gm/image_pict.cpp
+++ b/gm/image_pict.cpp
@@ -315,7 +315,7 @@
static void draw_as_tex(SkCanvas* canvas, SkImageCacherator* cache, SkScalar x, SkScalar y) {
#if SK_SUPPORT_GPU
sk_sp<GrTexture> texture(
- cache->lockAsTexture(canvas->getGrContext(), GrTextureParams::ClampBilerp(),
+ cache->lockAsTexture(canvas->getGrContext(), GrSamplerParams::ClampBilerp(),
SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware, nullptr));
if (!texture) {
// show placeholder if we have no texture
diff --git a/gm/texturedomaineffect.cpp b/gm/texturedomaineffect.cpp
index b76c70e..ad192d6 100644
--- a/gm/texturedomaineffect.cpp
+++ b/gm/texturedomaineffect.cpp
@@ -83,7 +83,7 @@
}
sk_sp<GrTexture> texture(
- GrRefCachedBitmapTexture(context, fBmp, GrTextureParams::ClampNoFilter(),
+ GrRefCachedBitmapTexture(context, fBmp, GrSamplerParams::ClampNoFilter(),
SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware));
if (!texture) {
return;
@@ -119,7 +119,7 @@
GrTextureDomainEffect::Make(texture.get(), nullptr, textureMatrices[tm],
GrTextureDomain::MakeTexelDomain(texture.get(),
texelDomains[d]),
- mode, GrTextureParams::kNone_FilterMode));
+ mode, GrSamplerParams::kNone_FilterMode));
if (!fp) {
continue;
diff --git a/gm/yuvtorgbeffect.cpp b/gm/yuvtorgbeffect.cpp
index 307ea7c..dcc8b15 100644
--- a/gm/yuvtorgbeffect.cpp
+++ b/gm/yuvtorgbeffect.cpp
@@ -82,13 +82,13 @@
sk_sp<GrTexture> texture[3];
texture[0].reset(
- GrRefCachedBitmapTexture(context, fBmp[0], GrTextureParams::ClampBilerp(),
+ GrRefCachedBitmapTexture(context, fBmp[0], GrSamplerParams::ClampBilerp(),
SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware));
texture[1].reset(
- GrRefCachedBitmapTexture(context, fBmp[1], GrTextureParams::ClampBilerp(),
+ GrRefCachedBitmapTexture(context, fBmp[1], GrSamplerParams::ClampBilerp(),
SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware));
texture[2].reset(
- GrRefCachedBitmapTexture(context, fBmp[2], GrTextureParams::ClampBilerp(),
+ GrRefCachedBitmapTexture(context, fBmp[2], GrSamplerParams::ClampBilerp(),
SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware));
if (!texture[0] || !texture[1] || !texture[2]) {
@@ -207,13 +207,13 @@
sk_sp<GrTexture> texture[3];
texture[0].reset(
- GrRefCachedBitmapTexture(context, fBmp[0], GrTextureParams::ClampBilerp(),
+ GrRefCachedBitmapTexture(context, fBmp[0], GrSamplerParams::ClampBilerp(),
SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware));
texture[1].reset(
- GrRefCachedBitmapTexture(context, fBmp[1], GrTextureParams::ClampBilerp(),
+ GrRefCachedBitmapTexture(context, fBmp[1], GrSamplerParams::ClampBilerp(),
SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware));
texture[2].reset(
- GrRefCachedBitmapTexture(context, fBmp[1], GrTextureParams::ClampBilerp(),
+ GrRefCachedBitmapTexture(context, fBmp[1], GrSamplerParams::ClampBilerp(),
SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware));
if (!texture[0] || !texture[1] || !texture[2]) {
diff --git a/gn/gpu.gni b/gn/gpu.gni
index 6a52384..5a7e75c 100644
--- a/gn/gpu.gni
+++ b/gn/gpu.gni
@@ -33,7 +33,7 @@
"$_include/gpu/GrShaderVar.h",
"$_include/gpu/GrSurface.h",
"$_include/gpu/GrTexture.h",
- "$_include/gpu/GrTextureParams.h",
+ "$_include/gpu/GrSamplerParams.h",
"$_include/gpu/GrTextureProvider.h",
"$_include/gpu/GrTestUtils.h",
"$_include/gpu/GrTypes.h",
diff --git a/include/core/SkImageGenerator.h b/include/core/SkImageGenerator.h
index 2e34bfe..6d97f40 100644
--- a/include/core/SkImageGenerator.h
+++ b/include/core/SkImageGenerator.h
@@ -16,7 +16,7 @@
class GrContext;
class GrContextThreadSafeProxy;
class GrTexture;
-class GrTextureParams;
+class GrSamplerParams;
class SkBitmap;
class SkData;
class SkImage;
@@ -146,13 +146,6 @@
* - it has no intrinsic context, and will use the caller's
* - its internal context is the same
* - it can somehow convert its texture into one that is valid for the provided context.
- *
- * Regarding the GrTextureParams parameter:
- *
- * If the context (the provided one or the generator's intrinsic one) determines that to
- * support the specified usage, it must return a different sized texture it may,
- * so the caller must inspect the texture's width/height and compare them to the generator's
- * getInfo() width/height. For readback usage use GrTextureParams::ClampNoFilter()
*/
GrTexture* generateTexture(GrContext*, const SkIRect* subset = nullptr);
diff --git a/include/gpu/GrContext.h b/include/gpu/GrContext.h
index 6b2c27a..9965ee8 100644
--- a/include/gpu/GrContext.h
+++ b/include/gpu/GrContext.h
@@ -40,7 +40,7 @@
class GrTestTarget;
class GrTextBlobCache;
class GrTextContext;
-class GrTextureParams;
+class GrSamplerParams;
class GrVertexBuffer;
class GrSwizzle;
class SkTraceMemoryDump;
diff --git a/include/gpu/GrCoordTransform.h b/include/gpu/GrCoordTransform.h
index 3080523..1f1cac7 100644
--- a/include/gpu/GrCoordTransform.h
+++ b/include/gpu/GrCoordTransform.h
@@ -27,7 +27,7 @@
* from the texture size and filter. The texture origin also implies whether a y-reversal should
* be performed.
*/
- GrCoordTransform(const GrTexture* texture, GrTextureParams::FilterMode filter) {
+ GrCoordTransform(const GrTexture* texture, GrSamplerParams::FilterMode filter) {
SkASSERT(texture);
SkDEBUGCODE(fInProcessor = false);
this->reset(texture, filter);
@@ -38,7 +38,7 @@
* filter. The texture origin also implies whether a y-reversal should be performed.
*/
GrCoordTransform(const SkMatrix& m, const GrTexture* texture,
- GrTextureParams::FilterMode filter) {
+ GrSamplerParams::FilterMode filter) {
SkDEBUGCODE(fInProcessor = false);
SkASSERT(texture);
this->reset(m, texture, filter);
@@ -52,13 +52,13 @@
this->reset(m, precision);
}
- void reset(const GrTexture* texture, GrTextureParams::FilterMode filter) {
+ void reset(const GrTexture* texture, GrSamplerParams::FilterMode filter) {
SkASSERT(!fInProcessor);
SkASSERT(texture);
this->reset(MakeDivByTextureWHMatrix(texture), texture, filter);
}
- void reset(const SkMatrix&, const GrTexture*, GrTextureParams::FilterMode filter);
+ void reset(const SkMatrix&, const GrTexture*, GrSamplerParams::FilterMode filter);
void reset(const SkMatrix& m, GrSLPrecision precision = kDefault_GrSLPrecision);
GrCoordTransform& operator= (const GrCoordTransform& that) {
diff --git a/include/gpu/GrPaint.h b/include/gpu/GrPaint.h
index ade2319..9390d02 100644
--- a/include/gpu/GrPaint.h
+++ b/include/gpu/GrPaint.h
@@ -126,8 +126,8 @@
void addColorTextureProcessor(GrTexture*, sk_sp<GrColorSpaceXform>, const SkMatrix&);
void addCoverageTextureProcessor(GrTexture*, const SkMatrix&);
void addColorTextureProcessor(GrTexture*, sk_sp<GrColorSpaceXform>, const SkMatrix&,
- const GrTextureParams&);
- void addCoverageTextureProcessor(GrTexture*, const SkMatrix&, const GrTextureParams&);
+ const GrSamplerParams&);
+ void addCoverageTextureProcessor(GrTexture*, const SkMatrix&, const GrSamplerParams&);
int numColorFragmentProcessors() const { return fColorFragmentProcessors.count(); }
int numCoverageFragmentProcessors() const { return fCoverageFragmentProcessors.count(); }
diff --git a/include/gpu/GrProcessor.h b/include/gpu/GrProcessor.h
index e600f90..f5f3842 100644
--- a/include/gpu/GrProcessor.h
+++ b/include/gpu/GrProcessor.h
@@ -179,7 +179,7 @@
/**
* Used to represent a texture that is required by a GrProcessor. It holds a GrTexture along with
- * an associated GrTextureParams
+ * an associated GrSamplerParams
*/
class GrProcessor::TextureSampler : public SkNoncopyable {
public:
@@ -188,17 +188,17 @@
*/
TextureSampler();
- TextureSampler(GrTexture*, const GrTextureParams&);
+ TextureSampler(GrTexture*, const GrSamplerParams&);
explicit TextureSampler(GrTexture*,
- GrTextureParams::FilterMode = GrTextureParams::kNone_FilterMode,
+ GrSamplerParams::FilterMode = GrSamplerParams::kNone_FilterMode,
SkShader::TileMode tileXAndY = SkShader::kClamp_TileMode,
GrShaderFlags visibility = kFragment_GrShaderFlag);
- void reset(GrTexture*, const GrTextureParams&,
+ void reset(GrTexture*, const GrSamplerParams&,
GrShaderFlags visibility = kFragment_GrShaderFlag);
void reset(GrTexture*,
- GrTextureParams::FilterMode = GrTextureParams::kNone_FilterMode,
+ GrSamplerParams::FilterMode = GrSamplerParams::kNone_FilterMode,
SkShader::TileMode tileXAndY = SkShader::kClamp_TileMode,
GrShaderFlags visibility = kFragment_GrShaderFlag);
@@ -212,7 +212,7 @@
GrTexture* texture() const { return fTexture.get(); }
GrShaderFlags visibility() const { return fVisibility; }
- const GrTextureParams& params() const { return fParams; }
+ const GrSamplerParams& params() const { return fParams; }
/**
* For internal use by GrProcessor.
@@ -224,7 +224,7 @@
typedef GrTGpuResourceRef<GrTexture> ProgramTexture;
ProgramTexture fTexture;
- GrTextureParams fParams;
+ GrSamplerParams fParams;
GrShaderFlags fVisibility;
typedef SkNoncopyable INHERITED;
diff --git a/include/gpu/GrTextureParams.h b/include/gpu/GrSamplerParams.h
similarity index 78%
rename from include/gpu/GrTextureParams.h
rename to include/gpu/GrSamplerParams.h
index 3186b1b..512340e 100644
--- a/include/gpu/GrTextureParams.h
+++ b/include/gpu/GrSamplerParams.h
@@ -5,8 +5,8 @@
* found in the LICENSE file.
*/
-#ifndef GrTextureParams_DEFINED
-#define GrTextureParams_DEFINED
+#ifndef GrSamplerParams_DEFINED
+#define GrSamplerParams_DEFINED
#include "GrTypes.h"
#include "SkShader.h"
@@ -14,18 +14,18 @@
/**
* Represents the filtering and tile modes used to access a texture.
*/
-class GrTextureParams {
+class GrSamplerParams {
public:
- static const GrTextureParams& ClampNoFilter() {
- static const GrTextureParams gParams;
+ static const GrSamplerParams& ClampNoFilter() {
+ static const GrSamplerParams gParams;
return gParams;
}
- static const GrTextureParams& ClampBilerp() {
- static const GrTextureParams gParams(SkShader::kClamp_TileMode, kBilerp_FilterMode);
+ static const GrSamplerParams& ClampBilerp() {
+ static const GrSamplerParams gParams(SkShader::kClamp_TileMode, kBilerp_FilterMode);
return gParams;
}
- GrTextureParams() {
+ GrSamplerParams() {
this->reset();
}
@@ -35,19 +35,19 @@
kMipMap_FilterMode
};
- GrTextureParams(SkShader::TileMode tileXAndY, FilterMode filterMode) {
+ GrSamplerParams(SkShader::TileMode tileXAndY, FilterMode filterMode) {
this->reset(tileXAndY, filterMode);
}
- GrTextureParams(const SkShader::TileMode tileModes[2], FilterMode filterMode) {
+ GrSamplerParams(const SkShader::TileMode tileModes[2], FilterMode filterMode) {
this->reset(tileModes, filterMode);
}
- GrTextureParams(const GrTextureParams& params) {
+ GrSamplerParams(const GrSamplerParams& params) {
*this = params;
}
- GrTextureParams& operator= (const GrTextureParams& params) {
+ GrSamplerParams& operator= (const GrSamplerParams& params) {
fTileModes[0] = params.fTileModes[0];
fTileModes[1] = params.fTileModes[1];
fFilterMode = params.fFilterMode;
@@ -95,13 +95,13 @@
FilterMode filterMode() const { return fFilterMode; }
- bool operator== (const GrTextureParams& other) const {
+ bool operator== (const GrSamplerParams& other) const {
return fTileModes[0] == other.fTileModes[0] &&
fTileModes[1] == other.fTileModes[1] &&
fFilterMode == other.fFilterMode;
}
- bool operator!= (const GrTextureParams& other) const { return !(*this == other); }
+ bool operator!= (const GrSamplerParams& other) const { return !(*this == other); }
private:
SkShader::TileMode fTileModes[2];
diff --git a/include/gpu/GrTexture.h b/include/gpu/GrTexture.h
index 7381a90..c032cbe 100644
--- a/include/gpu/GrTexture.h
+++ b/include/gpu/GrTexture.h
@@ -10,7 +10,7 @@
#define GrTexture_DEFINED
#include "GrSurface.h"
-#include "GrTextureParams.h"
+#include "GrSamplerParams.h"
#include "SkPoint.h"
#include "SkRefCnt.h"
@@ -46,7 +46,7 @@
protected:
GrTexture(GrGpu*, const GrSurfaceDesc&, GrSLType samplerType,
- GrTextureParams::FilterMode highestFilterMode, bool wasMipMapDataProvided);
+ GrSamplerParams::FilterMode highestFilterMode, bool wasMipMapDataProvided);
void validateDesc() const;
@@ -62,7 +62,7 @@
};
GrSLType fSamplerType;
- GrTextureParams::FilterMode fHighestFilterMode;
+ GrSamplerParams::FilterMode fHighestFilterMode;
MipMapsStatus fMipMapsStatus;
int fMaxMipMapLevel;
SkDestinationSurfaceColorMode fMipColorMode;
diff --git a/include/gpu/SkGr.h b/include/gpu/SkGr.h
index ffad5cf..0e58e72 100644
--- a/include/gpu/SkGr.h
+++ b/include/gpu/SkGr.h
@@ -9,7 +9,7 @@
#define SkGr_DEFINED
#include "GrColor.h"
-#include "GrTextureParams.h"
+#include "GrSamplerParams.h"
#include "SkColor.h"
#include "SkColorPriv.h"
#include "SkFilterQuality.h"
@@ -76,13 +76,13 @@
}
////////////////////////////////////////////////////////////////////////////////
-/** Returns a texture representing the bitmap that is compatible with the GrTextureParams. The
+/** Returns a texture representing the bitmap that is compatible with the GrSamplerParams. The
texture is inserted into the cache (unless the bitmap is marked volatile) and can be
retrieved again via this function. */
-GrTexture* GrRefCachedBitmapTexture(GrContext*, const SkBitmap&, const GrTextureParams&,
+GrTexture* GrRefCachedBitmapTexture(GrContext*, const SkBitmap&, const GrSamplerParams&,
SkDestinationSurfaceColorMode);
-sk_sp<GrTexture> GrMakeCachedBitmapTexture(GrContext*, const SkBitmap&, const GrTextureParams&,
+sk_sp<GrTexture> GrMakeCachedBitmapTexture(GrContext*, const SkBitmap&, const GrSamplerParams&,
SkDestinationSurfaceColorMode);
// TODO: Move SkImageInfo2GrPixelConfig to SkGrPriv.h (requires cleanup to SkWindow its subclasses).
@@ -93,7 +93,7 @@
return SkImageInfo2GrPixelConfig(info.colorType(), info.alphaType(), info.colorSpace(), caps);
}
-GrTextureParams::FilterMode GrSkFilterQualityToGrFilterMode(SkFilterQuality paintFilterQuality,
+GrSamplerParams::FilterMode GrSkFilterQualityToGrFilterMode(SkFilterQuality paintFilterQuality,
const SkMatrix& viewM,
const SkMatrix& localM,
bool* doBicubic);
diff --git a/src/core/SkGpuBlurUtils.cpp b/src/core/SkGpuBlurUtils.cpp
index 8107642..84cc8d8 100644
--- a/src/core/SkGpuBlurUtils.cpp
+++ b/src/core/SkGpuBlurUtils.cpp
@@ -275,12 +275,12 @@
matrix,
domain,
GrTextureDomain::kDecal_Mode,
- GrTextureParams::kBilerp_FilterMode));
+ GrSamplerParams::kBilerp_FilterMode));
paint.addColorFragmentProcessor(std::move(fp));
srcRect.offset(-srcOffset);
srcOffset.set(0, 0);
} else {
- GrTextureParams params(SkShader::kClamp_TileMode, GrTextureParams::kBilerp_FilterMode);
+ GrSamplerParams params(SkShader::kClamp_TileMode, GrSamplerParams::kBilerp_FilterMode);
paint.addColorTextureProcessor(srcTexture.get(), nullptr, matrix, params);
}
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
@@ -356,7 +356,7 @@
GrPaint paint;
paint.setGammaCorrect(dstRenderTargetContext->isGammaCorrect());
// FIXME: this should be mitchell, not bilinear.
- GrTextureParams params(SkShader::kClamp_TileMode, GrTextureParams::kBilerp_FilterMode);
+ GrSamplerParams params(SkShader::kClamp_TileMode, GrSamplerParams::kBilerp_FilterMode);
sk_sp<GrTexture> tex(srcRenderTargetContext->asTexture());
paint.addColorTextureProcessor(tex.get(), nullptr, matrix, params);
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
diff --git a/src/core/SkImageCacherator.cpp b/src/core/SkImageCacherator.cpp
index 471dbd6..e291242 100644
--- a/src/core/SkImageCacherator.cpp
+++ b/src/core/SkImageCacherator.cpp
@@ -19,7 +19,7 @@
#include "GrGpuResourcePriv.h"
#include "GrImageIDTextureAdjuster.h"
#include "GrResourceKey.h"
-#include "GrTextureParams.h"
+#include "GrSamplerParams.h"
#include "GrYUVProvider.h"
#include "SkGr.h"
#include "SkGrPriv.h"
@@ -371,7 +371,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
-GrTexture* SkImageCacherator::lockAsTexture(GrContext* ctx, const GrTextureParams& params,
+GrTexture* SkImageCacherator::lockAsTexture(GrContext* ctx, const GrSamplerParams& params,
SkDestinationSurfaceColorMode colorMode,
const SkImage* client, SkImage::CachingHint chint) {
if (!ctx) {
@@ -383,7 +383,7 @@
#else
-GrTexture* SkImageCacherator::lockAsTexture(GrContext* ctx, const GrTextureParams&,
+GrTexture* SkImageCacherator::lockAsTexture(GrContext* ctx, const GrSamplerParams&,
SkDestinationSurfaceColorMode colorMode,
const SkImage* client, SkImage::CachingHint) {
return nullptr;
diff --git a/src/core/SkImageCacherator.h b/src/core/SkImageCacherator.h
index 0e8a953..3500206 100644
--- a/src/core/SkImageCacherator.h
+++ b/src/core/SkImageCacherator.h
@@ -13,7 +13,7 @@
#include "SkTemplates.h"
class GrContext;
-class GrTextureParams;
+class GrSamplerParams;
class GrUniqueKey;
class SkBitmap;
class SkImage;
@@ -50,7 +50,7 @@
*
* The caller is responsible for calling texture->unref() when they are done.
*/
- GrTexture* lockAsTexture(GrContext*, const GrTextureParams&,
+ GrTexture* lockAsTexture(GrContext*, const GrSamplerParams&,
SkDestinationSurfaceColorMode colorMode, const SkImage* client,
SkImage::CachingHint = SkImage::kAllow_CachingHint);
diff --git a/src/core/SkNormalMapSource.cpp b/src/core/SkNormalMapSource.cpp
index 25c533c..70d6c43 100644
--- a/src/core/SkNormalMapSource.cpp
+++ b/src/core/SkNormalMapSource.cpp
@@ -18,7 +18,7 @@
#if SK_SUPPORT_GPU
#include "GrCoordTransform.h"
#include "GrInvariantOutput.h"
-#include "GrTextureParams.h"
+#include "GrSamplerParams.h"
#include "glsl/GrGLSLFragmentProcessor.h"
#include "glsl/GrGLSLFragmentShaderBuilder.h"
#include "SkGr.h"
diff --git a/src/core/SkShadowShader.cpp b/src/core/SkShadowShader.cpp
index 9757298..db04638 100644
--- a/src/core/SkShadowShader.cpp
+++ b/src/core/SkShadowShader.cpp
@@ -138,7 +138,7 @@
// gets deleted when the ShadowFP is destroyed, and frees the GrTexture*
fTexture[fNumNonAmbLights] = sk_sp<GrTexture>(shadowMap->asTextureRef(context,
- GrTextureParams::ClampNoFilter(),
+ GrSamplerParams::ClampNoFilter(),
SkDestinationSurfaceColorMode::kLegacy));
fDepthMapSampler[fNumNonAmbLights].reset(fTexture[fNumNonAmbLights].get());
this->addTextureSampler(&fDepthMapSampler[fNumNonAmbLights]);
diff --git a/src/core/SkSpecialImage.cpp b/src/core/SkSpecialImage.cpp
index c97eb01..c25079e 100644
--- a/src/core/SkSpecialImage.cpp
+++ b/src/core/SkSpecialImage.cpp
@@ -18,7 +18,7 @@
#if SK_SUPPORT_GPU
#include "GrContext.h"
#include "GrTexture.h"
-#include "GrTextureParams.h"
+#include "GrSamplerParams.h"
#include "GrTextureProxy.h"
#include "SkGr.h"
#include "SkGrPriv.h"
@@ -102,7 +102,7 @@
}
sk_sp<GrTexture> resultTex(
- GrRefCachedBitmapTexture(context, bmp, GrTextureParams::ClampNoFilter(),
+ GrRefCachedBitmapTexture(context, bmp, GrSamplerParams::ClampNoFilter(),
SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware));
if (!resultTex) {
return nullptr;
@@ -241,7 +241,7 @@
sk_sp<GrTexture> onAsTextureRef(GrContext* context) const override {
if (context) {
return sk_ref_sp(
- GrRefCachedBitmapTexture(context, fBitmap, GrTextureParams::ClampNoFilter(),
+ GrRefCachedBitmapTexture(context, fBitmap, GrSamplerParams::ClampNoFilter(),
SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware));
}
@@ -253,7 +253,7 @@
sk_sp<GrTexture> tex(sk_ref_sp(GrRefCachedBitmapTexture(
context,
fBitmap,
- GrTextureParams::ClampNoFilter(),
+ GrSamplerParams::ClampNoFilter(),
SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware)));
sk_sp<GrSurfaceProxy> sProxy = GrSurfaceProxy::MakeWrapped(std::move(tex));
return sk_ref_sp(sProxy->asTextureProxy());
diff --git a/src/effects/GrAlphaThresholdFragmentProcessor.cpp b/src/effects/GrAlphaThresholdFragmentProcessor.cpp
index 4e4dbbe..99ce113 100644
--- a/src/effects/GrAlphaThresholdFragmentProcessor.cpp
+++ b/src/effects/GrAlphaThresholdFragmentProcessor.cpp
@@ -47,12 +47,12 @@
: fInnerThreshold(innerThreshold)
, fOuterThreshold(outerThreshold)
, fImageCoordTransform(GrCoordTransform::MakeDivByTextureWHMatrix(texture), texture,
- GrTextureParams::kNone_FilterMode)
+ GrSamplerParams::kNone_FilterMode)
, fImageTextureSampler(texture)
, fColorSpaceXform(std::move(colorSpaceXform))
, fMaskCoordTransform(make_div_and_translate_matrix(maskTexture, -bounds.x(), -bounds.y()),
maskTexture,
- GrTextureParams::kNone_FilterMode)
+ GrSamplerParams::kNone_FilterMode)
, fMaskTextureSampler(maskTexture) {
this->initClassID<GrAlphaThresholdFragmentProcessor>();
this->addCoordTransform(&fImageCoordTransform);
diff --git a/src/effects/GrCircleBlurFragmentProcessor.cpp b/src/effects/GrCircleBlurFragmentProcessor.cpp
index b8b2660..8afd009 100644
--- a/src/effects/GrCircleBlurFragmentProcessor.cpp
+++ b/src/effects/GrCircleBlurFragmentProcessor.cpp
@@ -92,7 +92,7 @@
: fCircle(circle)
, fSolidRadius(solidRadius)
, fTextureRadius(textureRadius)
- , fBlurProfileSampler(blurProfile, GrTextureParams::kBilerp_FilterMode) {
+ , fBlurProfileSampler(blurProfile, GrSamplerParams::kBilerp_FilterMode) {
this->initClassID<GrCircleBlurFragmentProcessor>();
this->addTextureSampler(&fBlurProfileSampler);
this->setWillReadFragmentPosition();
diff --git a/src/effects/SkColorCubeFilter.cpp b/src/effects/SkColorCubeFilter.cpp
index ad35fda..6a15c55 100644
--- a/src/effects/SkColorCubeFilter.cpp
+++ b/src/effects/SkColorCubeFilter.cpp
@@ -209,7 +209,7 @@
///////////////////////////////////////////////////////////////////////////////
GrColorCubeEffect::GrColorCubeEffect(GrTexture* colorCube)
- : fColorCubeSampler(colorCube, GrTextureParams::kBilerp_FilterMode) {
+ : fColorCubeSampler(colorCube, GrSamplerParams::kBilerp_FilterMode) {
this->initClassID<GrColorCubeEffect>();
this->addTextureSampler(&fColorCubeSampler);
}
diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/SkDisplacementMapEffect.cpp
index e8767ff..6a8084c 100644
--- a/src/effects/SkDisplacementMapEffect.cpp
+++ b/src/effects/SkDisplacementMapEffect.cpp
@@ -485,9 +485,9 @@
const SkMatrix& offsetMatrix,
GrTexture* color,
const SkISize& colorDimensions)
- : fDisplacementTransform(offsetMatrix, displacement, GrTextureParams::kNone_FilterMode)
+ : fDisplacementTransform(offsetMatrix, displacement, GrSamplerParams::kNone_FilterMode)
, fDisplacementSampler(displacement)
- , fColorTransform(color, GrTextureParams::kNone_FilterMode)
+ , fColorTransform(color, GrSamplerParams::kNone_FilterMode)
, fDomain(GrTextureDomain::MakeTexelDomain(color, SkIRect::MakeSize(colorDimensions)),
GrTextureDomain::kDecal_Mode)
, fColorSampler(color)
diff --git a/src/effects/SkPerlinNoiseShader.cpp b/src/effects/SkPerlinNoiseShader.cpp
index dc28e44..d0761d7 100644
--- a/src/effects/SkPerlinNoiseShader.cpp
+++ b/src/effects/SkPerlinNoiseShader.cpp
@@ -926,10 +926,10 @@
new PaintingData(fTileSize, fSeed, fBaseFrequencyX, fBaseFrequencyY, matrix);
sk_sp<GrTexture> permutationsTexture(
GrRefCachedBitmapTexture(args.fContext, paintingData->getPermutationsBitmap(),
- GrTextureParams::ClampNoFilter(), args.fColorMode));
+ GrSamplerParams::ClampNoFilter(), args.fColorMode));
sk_sp<GrTexture> noiseTexture(
GrRefCachedBitmapTexture(args.fContext, paintingData->getNoiseBitmap(),
- GrTextureParams::ClampNoFilter(), args.fColorMode));
+ GrSamplerParams::ClampNoFilter(), args.fColorMode));
SkMatrix m = *args.fViewMatrix;
m.setTranslateX(-localMatrix.getTranslateX() + SK_Scalar1);
diff --git a/src/effects/SkTableColorFilter.cpp b/src/effects/SkTableColorFilter.cpp
index 90a7856..68fd13f 100644
--- a/src/effects/SkTableColorFilter.cpp
+++ b/src/effects/SkTableColorFilter.cpp
@@ -474,7 +474,7 @@
if (-1 == row) {
atlas = nullptr;
texture.reset(
- GrRefCachedBitmapTexture(context, bitmap, GrTextureParams::ClampNoFilter(),
+ GrRefCachedBitmapTexture(context, bitmap, GrSamplerParams::ClampNoFilter(),
SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware));
} else {
texture.reset(SkRef(atlas->getTexture()));
diff --git a/src/effects/SkXfermodeImageFilter.cpp b/src/effects/SkXfermodeImageFilter.cpp
index 840f652..a396b3e 100644
--- a/src/effects/SkXfermodeImageFilter.cpp
+++ b/src/effects/SkXfermodeImageFilter.cpp
@@ -258,7 +258,7 @@
GrTextureDomain::MakeTexelDomain(backgroundTex.get(),
background->subset()),
GrTextureDomain::kDecal_Mode,
- GrTextureParams::kNone_FilterMode);
+ GrSamplerParams::kNone_FilterMode);
} else {
bgFP = GrConstColorProcessor::Make(GrColor4f::TransparentBlack(),
GrConstColorProcessor::kIgnore_InputMode);
@@ -277,7 +277,7 @@
GrTextureDomain::MakeTexelDomain(foregroundTex.get(),
foreground->subset()),
GrTextureDomain::kDecal_Mode,
- GrTextureParams::kNone_FilterMode);
+ GrSamplerParams::kNone_FilterMode);
paint.addColorFragmentProcessor(std::move(foregroundFP));
diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp
index fcd0bd3..39f5636 100644
--- a/src/effects/gradients/SkGradientShader.cpp
+++ b/src/effects/gradients/SkGradientShader.cpp
@@ -1651,8 +1651,8 @@
// We always filter the gradient table. Each table is one row of a texture, always
// y-clamp.
- GrTextureParams params;
- params.setFilterMode(GrTextureParams::kBilerp_FilterMode);
+ GrSamplerParams params;
+ params.setFilterMode(GrSamplerParams::kBilerp_FilterMode);
params.setTileModeX(args.fTileMode);
fRow = fAtlas->lockRow(bitmap);
diff --git a/src/gpu/GrCoordTransform.cpp b/src/gpu/GrCoordTransform.cpp
index 2da49c4..63d91a8 100644
--- a/src/gpu/GrCoordTransform.cpp
+++ b/src/gpu/GrCoordTransform.cpp
@@ -11,7 +11,7 @@
#include "GrGpu.h"
void GrCoordTransform::reset(const SkMatrix& m, const GrTexture* texture,
- GrTextureParams::FilterMode filter) {
+ GrSamplerParams::FilterMode filter) {
SkASSERT(texture);
SkASSERT(!fInProcessor);
@@ -23,7 +23,7 @@
// coords between 0 to 1 when bi- or tri-lerping and 1 value when nearest filtering. Note that
// this still might not be enough when drawing with repeat or mirror-repeat modes but that case
// can be arbitrarily bad.
- int subPixelThresh = filter > GrTextureParams::kNone_FilterMode ? 4 : 1;
+ int subPixelThresh = filter > GrSamplerParams::kNone_FilterMode ? 4 : 1;
fPrecision = kDefault_GrSLPrecision;
if (texture->getContext()) {
const GrShaderCaps* caps = texture->getContext()->caps()->shaderCaps();
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index b775cf0..3538b80 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -57,7 +57,7 @@
////////////////////////////////////////////////////////////////////////////////
-bool GrGpu::makeCopyForTextureParams(int width, int height, const GrTextureParams& textureParams,
+bool GrGpu::makeCopyForTextureParams(int width, int height, const GrSamplerParams& textureParams,
GrTextureProducer::CopyParams* copyParams) const {
const GrCaps& caps = *this->caps();
if (textureParams.isTiled() && !caps.npotTextureTileSupport() &&
@@ -65,13 +65,13 @@
copyParams->fWidth = GrNextPow2(width);
copyParams->fHeight = GrNextPow2(height);
switch (textureParams.filterMode()) {
- case GrTextureParams::kNone_FilterMode:
- copyParams->fFilter = GrTextureParams::kNone_FilterMode;
+ case GrSamplerParams::kNone_FilterMode:
+ copyParams->fFilter = GrSamplerParams::kNone_FilterMode;
break;
- case GrTextureParams::kBilerp_FilterMode:
- case GrTextureParams::kMipMap_FilterMode:
+ case GrSamplerParams::kBilerp_FilterMode:
+ case GrSamplerParams::kMipMap_FilterMode:
// We are only ever scaling up so no reason to ever indicate kMipMap.
- copyParams->fFilter = GrTextureParams::kBilerp_FilterMode;
+ copyParams->fFilter = GrSamplerParams::kBilerp_FilterMode;
break;
}
return true;
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
index 686820e..f88423b 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -469,16 +469,16 @@
virtual void drawDebugWireRect(GrRenderTarget*, const SkIRect&, GrColor) = 0;
// Determines whether a texture will need to be rescaled in order to be used with the
- // GrTextureParams. This variation is called when the caller will create a new texture using the
+ // GrSamplerParams. This variation is called when the caller will create a new texture using the
// texture provider from a non-texture src (cpu-backed image, ...).
- bool makeCopyForTextureParams(int width, int height, const GrTextureParams&,
+ bool makeCopyForTextureParams(int width, int height, const GrSamplerParams&,
GrTextureProducer::CopyParams*) const;
// Like the above but this variation should be called when the caller is not creating the
// original texture but rather was handed the original texture. It adds additional checks
// relevant to original textures that were created external to Skia via
// GrTextureProvider::wrap methods.
- bool makeCopyForTextureParams(GrTexture* texture, const GrTextureParams& params,
+ bool makeCopyForTextureParams(GrTexture* texture, const GrSamplerParams& params,
GrTextureProducer::CopyParams* copyParams) const {
if (this->makeCopyForTextureParams(texture->width(), texture->height(), params,
copyParams)) {
@@ -547,7 +547,7 @@
virtual gr_instanced::InstancedRendering* onCreateInstancedRendering() = 0;
- virtual bool onMakeCopyForTextureParams(GrTexture* texture, const GrTextureParams&,
+ virtual bool onMakeCopyForTextureParams(GrTexture* texture, const GrSamplerParams&,
GrTextureProducer::CopyParams*) const { return false; }
virtual bool onGetReadPixelsInfo(GrSurface* srcSurface, int readWidth, int readHeight,
diff --git a/src/gpu/GrPaint.cpp b/src/gpu/GrPaint.cpp
index c6d7f7d..d5f8d3d 100644
--- a/src/gpu/GrPaint.cpp
+++ b/src/gpu/GrPaint.cpp
@@ -38,7 +38,7 @@
void GrPaint::addColorTextureProcessor(GrTexture* texture,
sk_sp<GrColorSpaceXform> colorSpaceXform,
const SkMatrix& matrix,
- const GrTextureParams& params) {
+ const GrSamplerParams& params) {
this->addColorFragmentProcessor(GrSimpleTextureEffect::Make(texture,
std::move(colorSpaceXform),
matrix, params));
@@ -46,7 +46,7 @@
void GrPaint::addCoverageTextureProcessor(GrTexture* texture,
const SkMatrix& matrix,
- const GrTextureParams& params) {
+ const GrSamplerParams& params) {
this->addCoverageFragmentProcessor(GrSimpleTextureEffect::Make(texture, nullptr, matrix,
params));
}
diff --git a/src/gpu/GrPipelineBuilder.h b/src/gpu/GrPipelineBuilder.h
index cb69756..1bff9c6 100644
--- a/src/gpu/GrPipelineBuilder.h
+++ b/src/gpu/GrPipelineBuilder.h
@@ -86,14 +86,14 @@
void addColorTextureProcessor(GrTexture* texture,
const SkMatrix& matrix,
- const GrTextureParams& params) {
+ const GrSamplerParams& params) {
this->addColorFragmentProcessor(GrSimpleTextureEffect::Make(texture, nullptr, matrix,
params));
}
void addCoverageTextureProcessor(GrTexture* texture,
const SkMatrix& matrix,
- const GrTextureParams& params) {
+ const GrSamplerParams& params) {
this->addCoverageFragmentProcessor(GrSimpleTextureEffect::Make(texture, nullptr, matrix,
params));
}
diff --git a/src/gpu/GrProcessor.cpp b/src/gpu/GrProcessor.cpp
index 77927e4..89fc741 100644
--- a/src/gpu/GrProcessor.cpp
+++ b/src/gpu/GrProcessor.cpp
@@ -10,7 +10,7 @@
#include "GrGeometryProcessor.h"
#include "GrInvariantOutput.h"
#include "GrMemoryPool.h"
-#include "GrTextureParams.h"
+#include "GrSamplerParams.h"
#include "GrTexturePriv.h"
#include "GrXferProcessor.h"
#include "SkSpinlock.h"
@@ -155,19 +155,19 @@
GrProcessor::TextureSampler::TextureSampler() {}
-GrProcessor::TextureSampler::TextureSampler(GrTexture* texture, const GrTextureParams& params) {
+GrProcessor::TextureSampler::TextureSampler(GrTexture* texture, const GrSamplerParams& params) {
this->reset(texture, params);
}
GrProcessor::TextureSampler::TextureSampler(GrTexture* texture,
- GrTextureParams::FilterMode filterMode,
+ GrSamplerParams::FilterMode filterMode,
SkShader::TileMode tileXAndY,
GrShaderFlags visibility) {
this->reset(texture, filterMode, tileXAndY, visibility);
}
void GrProcessor::TextureSampler::reset(GrTexture* texture,
- const GrTextureParams& params,
+ const GrSamplerParams& params,
GrShaderFlags visibility) {
SkASSERT(texture);
fTexture.set(SkRef(texture), kRead_GrIOType);
@@ -177,7 +177,7 @@
}
void GrProcessor::TextureSampler::reset(GrTexture* texture,
- GrTextureParams::FilterMode filterMode,
+ GrSamplerParams::FilterMode filterMode,
SkShader::TileMode tileXAndY,
GrShaderFlags visibility) {
SkASSERT(texture);
diff --git a/src/gpu/GrSWMaskHelper.cpp b/src/gpu/GrSWMaskHelper.cpp
index 9430efb..b5dc8147 100644
--- a/src/gpu/GrSWMaskHelper.cpp
+++ b/src/gpu/GrSWMaskHelper.cpp
@@ -192,7 +192,7 @@
GrSimpleTextureEffect::Make(texture,
nullptr,
maskMatrix,
- GrTextureParams::kNone_FilterMode));
+ GrSamplerParams::kNone_FilterMode));
sk_sp<GrDrawBatch> batch(GrRectBatchFactory::CreateNonAAFill(paint.getColor(),
SkMatrix::I(),
diff --git a/src/gpu/GrTexture.cpp b/src/gpu/GrTexture.cpp
index 807fb9b..ea0ed76 100644
--- a/src/gpu/GrTexture.cpp
+++ b/src/gpu/GrTexture.cpp
@@ -70,7 +70,7 @@
//////////////////////////////////////////////////////////////////////////////
GrTexture::GrTexture(GrGpu* gpu, const GrSurfaceDesc& desc, GrSLType samplerType,
- GrTextureParams::FilterMode highestFilterMode, bool wasMipMapDataProvided)
+ GrSamplerParams::FilterMode highestFilterMode, bool wasMipMapDataProvided)
: INHERITED(gpu, desc)
, fSamplerType(samplerType)
, fHighestFilterMode(highestFilterMode)
diff --git a/src/gpu/GrTextureParamsAdjuster.cpp b/src/gpu/GrTextureParamsAdjuster.cpp
index fa1fffd..ca273a7 100644
--- a/src/gpu/GrTextureParamsAdjuster.cpp
+++ b/src/gpu/GrTextureParamsAdjuster.cpp
@@ -15,7 +15,7 @@
#include "GrGpuResourcePriv.h"
#include "GrResourceKey.h"
#include "GrTexture.h"
-#include "GrTextureParams.h"
+#include "GrSamplerParams.h"
#include "GrTextureProvider.h"
#include "SkCanvas.h"
#include "SkGr.h"
@@ -52,7 +52,7 @@
sy = 1.f / inputTexture->height();
}
- if (copyParams.fFilter != GrTextureParams::kNone_FilterMode && subset &&
+ if (copyParams.fFilter != GrSamplerParams::kNone_FilterMode && subset &&
(subset->width() != copyParams.fWidth || subset->height() != copyParams.fHeight)) {
SkRect domain;
domain.fLeft = (subset->fLeft + 0.5f) * sx;
@@ -61,13 +61,13 @@
domain.fBottom = (subset->fBottom - 0.5f) * sy;
// This would cause us to read values from outside the subset. Surely, the caller knows
// better!
- SkASSERT(copyParams.fFilter != GrTextureParams::kMipMap_FilterMode);
+ SkASSERT(copyParams.fFilter != GrSamplerParams::kMipMap_FilterMode);
paint.addColorFragmentProcessor(
GrTextureDomainEffect::Make(inputTexture, nullptr, SkMatrix::I(), domain,
GrTextureDomain::kClamp_Mode,
copyParams.fFilter));
} else {
- GrTextureParams params(SkShader::kClamp_TileMode, copyParams.fFilter);
+ GrSamplerParams params(SkShader::kClamp_TileMode, copyParams.fFilter);
paint.addColorTextureProcessor(inputTexture, nullptr, SkMatrix::I(), params);
}
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
@@ -141,7 +141,7 @@
return copy;
}
-GrTexture* GrTextureAdjuster::refTextureSafeForParams(const GrTextureParams& params,
+GrTexture* GrTextureAdjuster::refTextureSafeForParams(const GrSamplerParams& params,
SkDestinationSurfaceColorMode colorMode,
SkIPoint* outOffset) {
GrTexture* texture = this->originalTexture();
@@ -154,12 +154,12 @@
return nullptr;
}
- if (contentArea && GrTextureParams::kMipMap_FilterMode == params.filterMode()) {
+ if (contentArea && GrSamplerParams::kMipMap_FilterMode == params.filterMode()) {
// If we generate a MIP chain for texture it will read pixel values from outside the content
// area.
copyParams.fWidth = contentArea->width();
copyParams.fHeight = contentArea->height();
- copyParams.fFilter = GrTextureParams::kBilerp_FilterMode;
+ copyParams.fFilter = GrSamplerParams::kBilerp_FilterMode;
} else if (!context->getGpu()->makeCopyForTextureParams(texture, params, ©Params)) {
if (outOffset) {
if (contentArea) {
@@ -202,7 +202,7 @@
bool coordsLimitedToConstraintRect,
int texW, int texH,
const SkIRect* textureContentArea,
- const GrTextureParams::FilterMode* filterModeOrNullForBicubic,
+ const GrSamplerParams::FilterMode* filterModeOrNullForBicubic,
SkRect* domainRect) {
SkASSERT(SkRect::MakeIWH(texW, texH).contains(constraintRect));
@@ -230,17 +230,17 @@
SkScalar filterHalfWidth = 0.f;
if (filterModeOrNullForBicubic) {
switch (*filterModeOrNullForBicubic) {
- case GrTextureParams::kNone_FilterMode:
+ case GrSamplerParams::kNone_FilterMode:
if (coordsLimitedToConstraintRect) {
return kNoDomain_DomainMode;
} else {
filterHalfWidth = 0.f;
}
break;
- case GrTextureParams::kBilerp_FilterMode:
+ case GrSamplerParams::kBilerp_FilterMode:
filterHalfWidth = .5f;
break;
- case GrTextureParams::kMipMap_FilterMode:
+ case GrSamplerParams::kMipMap_FilterMode:
if (restrictFilterToRect || textureContentArea) {
// No domain can save us here.
return kTightCopy_DomainMode;
@@ -337,7 +337,7 @@
const SkMatrix& textureMatrix,
DomainMode domainMode,
const SkRect& domain,
- const GrTextureParams::FilterMode* filterOrNullForBicubic) {
+ const GrSamplerParams::FilterMode* filterOrNullForBicubic) {
SkASSERT(kTightCopy_DomainMode != domainMode);
if (filterOrNullForBicubic) {
if (kDomain_DomainMode == domainMode) {
@@ -345,7 +345,7 @@
domain, GrTextureDomain::kClamp_Mode,
*filterOrNullForBicubic);
} else {
- GrTextureParams params(SkShader::kClamp_TileMode, *filterOrNullForBicubic);
+ GrSamplerParams params(SkShader::kClamp_TileMode, *filterOrNullForBicubic);
return GrSimpleTextureEffect::Make(texture, std::move(colorSpaceXform), textureMatrix,
params);
}
@@ -367,7 +367,7 @@
const SkRect& origConstraintRect,
FilterConstraint filterConstraint,
bool coordsLimitedToConstraintRect,
- const GrTextureParams::FilterMode* filterOrNullForBicubic,
+ const GrSamplerParams::FilterMode* filterOrNullForBicubic,
SkColorSpace* dstColorSpace,
SkDestinationSurfaceColorMode colorMode) {
@@ -384,7 +384,7 @@
}
SkRect domain;
- GrTextureParams params;
+ GrSamplerParams params;
if (filterOrNullForBicubic) {
params.setFilterMode(*filterOrNullForBicubic);
}
@@ -410,8 +410,8 @@
// We only expect MIP maps to require a tight copy.
SkASSERT(filterOrNullForBicubic &&
- GrTextureParams::kMipMap_FilterMode == *filterOrNullForBicubic);
- static const GrTextureParams::FilterMode kBilerp = GrTextureParams::kBilerp_FilterMode;
+ GrSamplerParams::kMipMap_FilterMode == *filterOrNullForBicubic);
+ static const GrSamplerParams::FilterMode kBilerp = GrSamplerParams::kBilerp_FilterMode;
domainMode =
determine_domain_mode(*constraintRect, filterConstraint, coordsLimitedToConstraintRect,
texture->width(), texture->height(),
@@ -429,10 +429,10 @@
//////////////////////////////////////////////////////////////////////////////
-GrTexture* GrTextureMaker::refTextureForParams(const GrTextureParams& params,
+GrTexture* GrTextureMaker::refTextureForParams(const GrSamplerParams& params,
SkDestinationSurfaceColorMode colorMode) {
CopyParams copyParams;
- bool willBeMipped = params.filterMode() == GrTextureParams::kMipMap_FilterMode;
+ bool willBeMipped = params.filterMode() == GrSamplerParams::kMipMap_FilterMode;
if (!fContext->caps()->mipMapSupport()) {
willBeMipped = false;
@@ -468,28 +468,28 @@
const SkRect& constraintRect,
FilterConstraint filterConstraint,
bool coordsLimitedToConstraintRect,
- const GrTextureParams::FilterMode* filterOrNullForBicubic,
+ const GrSamplerParams::FilterMode* filterOrNullForBicubic,
SkColorSpace* dstColorSpace,
SkDestinationSurfaceColorMode colorMode) {
- const GrTextureParams::FilterMode* fmForDetermineDomain = filterOrNullForBicubic;
- if (filterOrNullForBicubic && GrTextureParams::kMipMap_FilterMode == *filterOrNullForBicubic &&
+ const GrSamplerParams::FilterMode* fmForDetermineDomain = filterOrNullForBicubic;
+ if (filterOrNullForBicubic && GrSamplerParams::kMipMap_FilterMode == *filterOrNullForBicubic &&
kYes_FilterConstraint == filterConstraint) {
// TODo: Here we should force a copy restricted to the constraintRect since MIP maps will
// read outside the constraint rect. However, as in the adjuster case, we aren't currently
// doing that.
// We instead we compute the domain as though were bilerping which is only correct if we
// only sample level 0.
- static const GrTextureParams::FilterMode kBilerp = GrTextureParams::kBilerp_FilterMode;
+ static const GrSamplerParams::FilterMode kBilerp = GrSamplerParams::kBilerp_FilterMode;
fmForDetermineDomain = &kBilerp;
}
- GrTextureParams params;
+ GrSamplerParams params;
if (filterOrNullForBicubic) {
params.reset(SkShader::kClamp_TileMode, *filterOrNullForBicubic);
} else {
// Bicubic doesn't use filtering for it's texture accesses.
- params.reset(SkShader::kClamp_TileMode, GrTextureParams::kNone_FilterMode);
+ params.reset(SkShader::kClamp_TileMode, GrSamplerParams::kNone_FilterMode);
}
sk_sp<GrTexture> texture(this->refTextureForParams(params, colorMode));
if (!texture) {
diff --git a/src/gpu/GrTextureParamsAdjuster.h b/src/gpu/GrTextureParamsAdjuster.h
index 1784ab6..bf3076e 100644
--- a/src/gpu/GrTextureParamsAdjuster.h
+++ b/src/gpu/GrTextureParamsAdjuster.h
@@ -8,20 +8,20 @@
#ifndef GrTextureMaker_DEFINED
#define GrTextureMaker_DEFINED
-#include "GrTextureParams.h"
+#include "GrSamplerParams.h"
#include "GrResourceKey.h"
#include "GrTexture.h"
#include "SkTLazy.h"
class GrContext;
-class GrTextureParams;
+class GrSamplerParams;
class GrUniqueKey;
class SkBitmap;
/**
* Different GPUs and API extensions have different requirements with respect to what texture
* sampling parameters may be used with textures of various types. This class facilitates making
- * texture compatible with a given GrTextureParams. There are two immediate subclasses defined
+ * texture compatible with a given GrSamplerParams. There are two immediate subclasses defined
* below. One is a base class for sources that are inherently texture-backed (e.g. a texture-backed
* SkImage). It supports subsetting the original texture. The other is for use cases where the
* source can generate a texture that represents some content (e.g. cpu pixels, SkPicture, ...).
@@ -29,7 +29,7 @@
class GrTextureProducer : public SkNoncopyable {
public:
struct CopyParams {
- GrTextureParams::FilterMode fFilter;
+ GrSamplerParams::FilterMode fFilter;
int fWidth;
int fHeight;
};
@@ -64,7 +64,7 @@
const SkRect& constraintRect,
FilterConstraint filterConstraint,
bool coordsLimitedToConstraintRect,
- const GrTextureParams::FilterMode* filterOrNullForBicubic,
+ const GrSamplerParams::FilterMode* filterOrNullForBicubic,
SkColorSpace* dstColorSpace,
SkDestinationSurfaceColorMode) = 0;
@@ -131,7 +131,7 @@
outOffset will be the top-left corner of the subset if a copy is not made. Otherwise,
the copy will be tight to the contents and outOffset will be (0, 0). If the copy's size
does not match subset's dimensions then the contents are scaled to fit the copy.*/
- GrTexture* refTextureSafeForParams(const GrTextureParams&, SkDestinationSurfaceColorMode,
+ GrTexture* refTextureSafeForParams(const GrSamplerParams&, SkDestinationSurfaceColorMode,
SkIPoint* outOffset);
sk_sp<GrFragmentProcessor> createFragmentProcessor(
@@ -139,7 +139,7 @@
const SkRect& constraintRect,
FilterConstraint,
bool coordsLimitedToConstraintRect,
- const GrTextureParams::FilterMode* filterOrNullForBicubic,
+ const GrSamplerParams::FilterMode* filterOrNullForBicubic,
SkColorSpace* dstColorSpace,
SkDestinationSurfaceColorMode) override;
@@ -180,14 +180,14 @@
/** Returns a texture that is safe for use with the params. If the size of the returned texture
does not match width()/height() then the contents of the original must be scaled to fit
the texture. */
- GrTexture* refTextureForParams(const GrTextureParams&, SkDestinationSurfaceColorMode);
+ GrTexture* refTextureForParams(const GrSamplerParams&, SkDestinationSurfaceColorMode);
sk_sp<GrFragmentProcessor> createFragmentProcessor(
const SkMatrix& textureMatrix,
const SkRect& constraintRect,
FilterConstraint filterConstraint,
bool coordsLimitedToConstraintRect,
- const GrTextureParams::FilterMode* filterOrNullForBicubic,
+ const GrSamplerParams::FilterMode* filterOrNullForBicubic,
SkColorSpace* dstColorSpace,
SkDestinationSurfaceColorMode) override;
diff --git a/src/gpu/GrTexturePriv.h b/src/gpu/GrTexturePriv.h
index 8d6057e..d68eb79 100644
--- a/src/gpu/GrTexturePriv.h
+++ b/src/gpu/GrTexturePriv.h
@@ -52,7 +52,7 @@
GrSLType samplerType() const { return fTexture->fSamplerType; }
/** The filter used is clamped to this value in GrProcessor::TextureSampler. */
- GrTextureParams::FilterMode highestFilterMode() const { return fTexture->fHighestFilterMode; }
+ GrSamplerParams::FilterMode highestFilterMode() const { return fTexture->fHighestFilterMode; }
void setMipColorMode(SkDestinationSurfaceColorMode colorMode) const {
fTexture->fMipColorMode = colorMode;
diff --git a/src/gpu/GrTextureToYUVPlanes.cpp b/src/gpu/GrTextureToYUVPlanes.cpp
index 16aa55b..ff6c707 100644
--- a/src/gpu/GrTextureToYUVPlanes.cpp
+++ b/src/gpu/GrTextureToYUVPlanes.cpp
@@ -24,11 +24,11 @@
SkScalar xScale = SkIntToScalar(src->width()) / dstW / src->width();
SkScalar yScale = SkIntToScalar(src->height()) / dstH / src->height();
- GrTextureParams::FilterMode filter;
+ GrSamplerParams::FilterMode filter;
if (dstW == src->width() && dstW == src->height()) {
- filter = GrTextureParams::kNone_FilterMode;
+ filter = GrSamplerParams::kNone_FilterMode;
} else {
- filter = GrTextureParams::kBilerp_FilterMode;
+ filter = GrSamplerParams::kBilerp_FilterMode;
}
sk_sp<GrFragmentProcessor> fp(
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 7f88790..82c7089 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -747,7 +747,7 @@
bool SkGpuDevice::shouldTileImageID(uint32_t imageID, const SkIRect& imageRect,
const SkMatrix& viewMatrix,
const SkMatrix& srcToDstRect,
- const GrTextureParams& params,
+ const GrSamplerParams& params,
const SkRect* srcRectPtr,
int maxTileSize,
int* tileSize,
@@ -804,15 +804,15 @@
return false;
}
- GrTextureParams params;
+ GrSamplerParams params;
bool doBicubic;
- GrTextureParams::FilterMode textureFilterMode =
+ GrSamplerParams::FilterMode textureFilterMode =
GrSkFilterQualityToGrFilterMode(quality, viewMatrix, srcToDstRect, &doBicubic);
int tileFilterPad;
if (doBicubic) {
tileFilterPad = GrBicubicEffect::kFilterTexelPad;
- } else if (GrTextureParams::kNone_FilterMode == textureFilterMode) {
+ } else if (GrSamplerParams::kNone_FilterMode == textureFilterMode) {
tileFilterPad = 0;
} else {
tileFilterPad = 1;
@@ -855,9 +855,9 @@
int tileSize;
SkIRect clippedSrcRect;
- GrTextureParams params;
+ GrSamplerParams params;
bool doBicubic;
- GrTextureParams::FilterMode textureFilterMode =
+ GrSamplerParams::FilterMode textureFilterMode =
GrSkFilterQualityToGrFilterMode(paint.getFilterQuality(), viewMatrix, SkMatrix::I(),
&doBicubic);
@@ -865,7 +865,7 @@
if (doBicubic) {
tileFilterPad = GrBicubicEffect::kFilterTexelPad;
- } else if (GrTextureParams::kNone_FilterMode == textureFilterMode) {
+ } else if (GrSamplerParams::kNone_FilterMode == textureFilterMode) {
tileFilterPad = 0;
} else {
tileFilterPad = 1;
@@ -927,7 +927,7 @@
const SkMatrix& dstMatrix,
const SkRect& srcRect,
const SkIRect& clippedSrcIRect,
- const GrTextureParams& params,
+ const GrSamplerParams& params,
const SkPaint& origPaint,
SkCanvas::SrcRectConstraint constraint,
int tileSize,
@@ -979,7 +979,7 @@
SkRect rectToDraw = SkRect::MakeXYWH(offset.fX, offset.fY,
tileR.width(), tileR.height());
dstMatrix.mapRect(&rectToDraw);
- if (GrTextureParams::kNone_FilterMode != params.filterMode() || bicubic) {
+ if (GrSamplerParams::kNone_FilterMode != params.filterMode() || bicubic) {
SkIRect iClampRect;
if (SkCanvas::kFast_SrcRectConstraint == constraint) {
@@ -1000,7 +1000,7 @@
if (bitmap.extractSubset(&tmpB, iTileR)) {
// now offset it to make it "local" to our tmp bitmap
tileR.offset(-offset.fX, -offset.fY);
- GrTextureParams paramsTemp = params;
+ GrSamplerParams paramsTemp = params;
// de-optimized this determination
bool needsTextureDomain = true;
this->drawBitmapTile(tmpB,
@@ -1021,7 +1021,7 @@
const SkMatrix& viewMatrix,
const SkRect& dstRect,
const SkRect& srcRect,
- const GrTextureParams& params,
+ const GrSamplerParams& params,
const SkPaint& paint,
SkCanvas::SrcRectConstraint constraint,
bool bicubic,
@@ -1077,7 +1077,7 @@
params.filterMode());
}
} else if (bicubic) {
- SkASSERT(GrTextureParams::kNone_FilterMode == params.filterMode());
+ SkASSERT(GrSamplerParams::kNone_FilterMode == params.filterMode());
SkShader::TileMode tileModes[2] = { params.getTileModeX(), params.getTileModeY() };
fp = GrBicubicEffect::Make(texture.get(), std::move(colorSpaceXform), texMatrix, tileModes);
} else {
@@ -1113,7 +1113,7 @@
// draw sprite neither filters nor tiles.
texture.reset(
- GrRefCachedBitmapTexture(fContext.get(), bitmap, GrTextureParams::ClampNoFilter(),
+ GrRefCachedBitmapTexture(fContext.get(), bitmap, GrSamplerParams::ClampNoFilter(),
SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware));
if (!texture) {
return;
@@ -1244,9 +1244,9 @@
int tileSize;
SkIRect clippedSrcRect;
- GrTextureParams params;
+ GrSamplerParams params;
bool doBicubic;
- GrTextureParams::FilterMode textureFilterMode =
+ GrSamplerParams::FilterMode textureFilterMode =
GrSkFilterQualityToGrFilterMode(paint.getFilterQuality(), *draw.fMatrix, srcToDstMatrix,
&doBicubic);
@@ -1254,7 +1254,7 @@
if (doBicubic) {
tileFilterPad = GrBicubicEffect::kFilterTexelPad;
- } else if (GrTextureParams::kNone_FilterMode == textureFilterMode) {
+ } else if (GrSamplerParams::kNone_FilterMode == textureFilterMode) {
tileFilterPad = 0;
} else {
tileFilterPad = 1;
@@ -1281,7 +1281,7 @@
}
sk_sp<GrTexture> texture =
- GrMakeCachedBitmapTexture(fContext.get(), bitmap, GrTextureParams::ClampNoFilter(),
+ GrMakeCachedBitmapTexture(fContext.get(), bitmap, GrSamplerParams::ClampNoFilter(),
SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware);
if (!texture) {
return nullptr;
@@ -1436,10 +1436,10 @@
bool useFallback = paint.getMaskFilter() || paint.isAntiAlias() ||
fRenderTargetContext->isUnifiedMultisampled();
bool doBicubic;
- GrTextureParams::FilterMode textureFilterMode =
+ GrSamplerParams::FilterMode textureFilterMode =
GrSkFilterQualityToGrFilterMode(paint.getFilterQuality(), *draw.fMatrix, SkMatrix::I(),
&doBicubic);
- if (useFallback || doBicubic || GrTextureParams::kNone_FilterMode != textureFilterMode) {
+ if (useFallback || doBicubic || GrSamplerParams::kNone_FilterMode != textureFilterMode) {
SkLatticeIter iter(producer->width(), producer->height(), center, dst);
SkRect srcR, dstR;
@@ -1450,7 +1450,7 @@
return;
}
- static const GrTextureParams::FilterMode kMode = GrTextureParams::kNone_FilterMode;
+ static const GrSamplerParams::FilterMode kMode = GrSamplerParams::kNone_FilterMode;
sk_sp<GrFragmentProcessor> fp(
producer->createFragmentProcessor(SkMatrix::I(),
SkRect::MakeIWH(producer->width(), producer->height()),
@@ -1504,7 +1504,7 @@
CHECK_SHOULD_DRAW(draw);
- static const GrTextureParams::FilterMode kMode = GrTextureParams::kNone_FilterMode;
+ static const GrSamplerParams::FilterMode kMode = GrSamplerParams::kNone_FilterMode;
sk_sp<GrFragmentProcessor> fp(
producer->createFragmentProcessor(SkMatrix::I(),
SkRect::MakeIWH(producer->width(), producer->height()),
diff --git a/src/gpu/SkGpuDevice.h b/src/gpu/SkGpuDevice.h
index b81da4e..0985050 100644
--- a/src/gpu/SkGpuDevice.h
+++ b/src/gpu/SkGpuDevice.h
@@ -169,7 +169,7 @@
bool shouldTileImageID(uint32_t imageID, const SkIRect& imageRect,
const SkMatrix& viewMatrix,
const SkMatrix& srcToDstRectMatrix,
- const GrTextureParams& params,
+ const GrSamplerParams& params,
const SkRect* srcRectPtr,
int maxTileSize,
int* tileSize,
@@ -192,7 +192,7 @@
const SkMatrix& srcToDstMatrix,
const SkRect& srcRect,
const SkIRect& clippedSrcRect,
- const GrTextureParams& params,
+ const GrSamplerParams& params,
const SkPaint& paint,
SkCanvas::SrcRectConstraint,
int tileSize,
@@ -203,7 +203,7 @@
const SkMatrix& viewMatrix,
const SkRect& dstRect,
const SkRect& srcRect,
- const GrTextureParams& params,
+ const GrSamplerParams& params,
const SkPaint& paint,
SkCanvas::SrcRectConstraint,
bool bicubic,
diff --git a/src/gpu/SkGpuDevice_drawTexture.cpp b/src/gpu/SkGpuDevice_drawTexture.cpp
index f232e19..74afca9 100644
--- a/src/gpu/SkGpuDevice_drawTexture.cpp
+++ b/src/gpu/SkGpuDevice_drawTexture.cpp
@@ -163,10 +163,10 @@
bool canUseTextureCoordsAsLocalCoords = !use_shader(producer->isAlphaOnly(), paint) && !mf;
bool doBicubic;
- GrTextureParams::FilterMode fm =
+ GrSamplerParams::FilterMode fm =
GrSkFilterQualityToGrFilterMode(paint.getFilterQuality(), viewMatrix, srcToDstMatrix,
&doBicubic);
- const GrTextureParams::FilterMode* filterMode = doBicubic ? nullptr : &fm;
+ const GrSamplerParams::FilterMode* filterMode = doBicubic ? nullptr : &fm;
GrTextureAdjuster::FilterConstraint constraintMode;
if (SkCanvas::kFast_SrcRectConstraint == constraint) {
@@ -181,7 +181,7 @@
bool coordsAllInsideSrcRect = !paint.isAntiAlias() && !mf;
// Check for optimization to drop the src rect constraint when on bilerp.
- if (filterMode && GrTextureParams::kBilerp_FilterMode == *filterMode &&
+ if (filterMode && GrSamplerParams::kBilerp_FilterMode == *filterMode &&
GrTextureAdjuster::kYes_FilterConstraint == constraintMode && coordsAllInsideSrcRect) {
SkMatrix combinedMatrix;
combinedMatrix.setConcat(viewMatrix, srcToDstMatrix);
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index d74e259..f1a3caa 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -424,13 +424,13 @@
}
GrTexture* GrRefCachedBitmapTexture(GrContext* ctx, const SkBitmap& bitmap,
- const GrTextureParams& params,
+ const GrSamplerParams& params,
SkDestinationSurfaceColorMode colorMode) {
return GrBitmapTextureMaker(ctx, bitmap).refTextureForParams(params, colorMode);
}
sk_sp<GrTexture> GrMakeCachedBitmapTexture(GrContext* ctx, const SkBitmap& bitmap,
- const GrTextureParams& params,
+ const GrSamplerParams& params,
SkDestinationSurfaceColorMode colorMode) {
GrTexture* tex = GrBitmapTextureMaker(ctx, bitmap).refTextureForParams(params, colorMode);
return sk_sp<GrTexture>(tex);
@@ -806,27 +806,27 @@
////////////////////////////////////////////////////////////////////////////////////////////////
-GrTextureParams::FilterMode GrSkFilterQualityToGrFilterMode(SkFilterQuality paintFilterQuality,
+GrSamplerParams::FilterMode GrSkFilterQualityToGrFilterMode(SkFilterQuality paintFilterQuality,
const SkMatrix& viewM,
const SkMatrix& localM,
bool* doBicubic) {
*doBicubic = false;
- GrTextureParams::FilterMode textureFilterMode;
+ GrSamplerParams::FilterMode textureFilterMode;
switch (paintFilterQuality) {
case kNone_SkFilterQuality:
- textureFilterMode = GrTextureParams::kNone_FilterMode;
+ textureFilterMode = GrSamplerParams::kNone_FilterMode;
break;
case kLow_SkFilterQuality:
- textureFilterMode = GrTextureParams::kBilerp_FilterMode;
+ textureFilterMode = GrSamplerParams::kBilerp_FilterMode;
break;
case kMedium_SkFilterQuality: {
SkMatrix matrix;
matrix.setConcat(viewM, localM);
if (matrix.getMinScale() < SK_Scalar1) {
- textureFilterMode = GrTextureParams::kMipMap_FilterMode;
+ textureFilterMode = GrSamplerParams::kMipMap_FilterMode;
} else {
// Don't trigger MIP level generation unnecessarily.
- textureFilterMode = GrTextureParams::kBilerp_FilterMode;
+ textureFilterMode = GrSamplerParams::kBilerp_FilterMode;
}
break;
}
@@ -838,7 +838,7 @@
}
default:
// Should be unreachable. If not, fall back to mipmaps.
- textureFilterMode = GrTextureParams::kMipMap_FilterMode;
+ textureFilterMode = GrSamplerParams::kMipMap_FilterMode;
break;
}
diff --git a/src/gpu/SkGrPriv.h b/src/gpu/SkGrPriv.h
index bd1d715..bb41aad 100644
--- a/src/gpu/SkGrPriv.h
+++ b/src/gpu/SkGrPriv.h
@@ -20,7 +20,6 @@
class GrFragmentProcessor;
class GrPaint;
class GrTexture;
-class GrTextureParams;
class GrUniqueKey;
class SkData;
class SkPaint;
diff --git a/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp b/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp
index bea604d..a9ef6cd 100644
--- a/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp
+++ b/src/gpu/batches/GrAADistanceFieldPathRenderer.cpp
@@ -193,7 +193,7 @@
flags |= ctm.isSimilarity() ? kSimilarity_DistanceFieldEffectFlag : 0;
flags |= fGammaCorrect ? kGammaCorrect_DistanceFieldEffectFlag : 0;
- GrTextureParams params(SkShader::kRepeat_TileMode, GrTextureParams::kBilerp_FilterMode);
+ GrSamplerParams params(SkShader::kRepeat_TileMode, GrSamplerParams::kBilerp_FilterMode);
FlushInfo flushInfo;
diff --git a/src/gpu/batches/GrAtlasTextBatch.cpp b/src/gpu/batches/GrAtlasTextBatch.cpp
index e9bb7f4..fe5c3b9 100644
--- a/src/gpu/batches/GrAtlasTextBatch.cpp
+++ b/src/gpu/batches/GrAtlasTextBatch.cpp
@@ -103,7 +103,7 @@
flushInfo.fGeometryProcessor =
this->setupDfProcessor(this->viewMatrix(), fFilteredColor, this->color(), texture);
} else {
- GrTextureParams params(SkShader::kClamp_TileMode, GrTextureParams::kNone_FilterMode);
+ GrSamplerParams params(SkShader::kClamp_TileMode, GrSamplerParams::kNone_FilterMode);
flushInfo.fGeometryProcessor = GrBitmapTextGeoProc::Make(this->color(),
texture,
params,
@@ -249,7 +249,7 @@
SkColor filteredColor,
GrColor color,
GrTexture* texture) const {
- GrTextureParams params(SkShader::kClamp_TileMode, GrTextureParams::kBilerp_FilterMode);
+ GrSamplerParams params(SkShader::kClamp_TileMode, GrSamplerParams::kBilerp_FilterMode);
bool isLCD = this->isLCD();
// set up any flags
uint32_t flags = viewMatrix.isSimilarity() ? kSimilarity_DistanceFieldEffectFlag : 0;
diff --git a/src/gpu/effects/GrBicubicEffect.cpp b/src/gpu/effects/GrBicubicEffect.cpp
index 335ef16..4ea358e 100644
--- a/src/gpu/effects/GrBicubicEffect.cpp
+++ b/src/gpu/effects/GrBicubicEffect.cpp
@@ -153,7 +153,7 @@
const SkMatrix &matrix,
const SkShader::TileMode tileModes[2])
: INHERITED(texture, nullptr, matrix,
- GrTextureParams(tileModes, GrTextureParams::kNone_FilterMode))
+ GrSamplerParams(tileModes, GrSamplerParams::kNone_FilterMode))
, fDomain(GrTextureDomain::IgnoredDomain())
, fColorSpaceXform(std::move(colorSpaceXform)) {
this->initClassID<GrBicubicEffect>();
@@ -166,7 +166,7 @@
const SkMatrix &matrix,
const SkRect& domain)
: INHERITED(texture, nullptr, matrix,
- GrTextureParams(SkShader::kClamp_TileMode, GrTextureParams::kNone_FilterMode))
+ GrSamplerParams(SkShader::kClamp_TileMode, GrSamplerParams::kNone_FilterMode))
, fDomain(domain, GrTextureDomain::kClamp_Mode)
, fColorSpaceXform(std::move(colorSpaceXform)) {
this->initClassID<GrBicubicEffect>();
@@ -212,9 +212,9 @@
//////////////////////////////////////////////////////////////////////////////
bool GrBicubicEffect::ShouldUseBicubic(const SkMatrix& matrix,
- GrTextureParams::FilterMode* filterMode) {
+ GrSamplerParams::FilterMode* filterMode) {
if (matrix.isIdentity()) {
- *filterMode = GrTextureParams::kNone_FilterMode;
+ *filterMode = GrSamplerParams::kNone_FilterMode;
return false;
}
@@ -222,22 +222,22 @@
if (!matrix.getMinMaxScales(scales) || scales[0] < SK_Scalar1) {
// Bicubic doesn't handle arbitrary minimization well, as src texels can be skipped
// entirely,
- *filterMode = GrTextureParams::kMipMap_FilterMode;
+ *filterMode = GrSamplerParams::kMipMap_FilterMode;
return false;
}
// At this point if scales[1] == SK_Scalar1 then the matrix doesn't do any scaling.
if (scales[1] == SK_Scalar1) {
if (matrix.rectStaysRect() && SkScalarIsInt(matrix.getTranslateX()) &&
SkScalarIsInt(matrix.getTranslateY())) {
- *filterMode = GrTextureParams::kNone_FilterMode;
+ *filterMode = GrSamplerParams::kNone_FilterMode;
} else {
// Use bilerp to handle rotation or fractional translation.
- *filterMode = GrTextureParams::kBilerp_FilterMode;
+ *filterMode = GrSamplerParams::kBilerp_FilterMode;
}
return false;
}
// When we use the bicubic filtering effect each sample is read from the texture using
// nearest neighbor sampling.
- *filterMode = GrTextureParams::kNone_FilterMode;
+ *filterMode = GrSamplerParams::kNone_FilterMode;
return true;
}
diff --git a/src/gpu/effects/GrBicubicEffect.h b/src/gpu/effects/GrBicubicEffect.h
index 58bb068..61ce7eb 100644
--- a/src/gpu/effects/GrBicubicEffect.h
+++ b/src/gpu/effects/GrBicubicEffect.h
@@ -93,7 +93,7 @@
* kNearest).
*/
static bool ShouldUseBicubic(const SkMatrix& localCoordsToDevice,
- GrTextureParams::FilterMode* filterMode);
+ GrSamplerParams::FilterMode* filterMode);
private:
GrBicubicEffect(GrTexture*, sk_sp<GrColorSpaceXform>, const SkScalar coefficients[16],
diff --git a/src/gpu/effects/GrBitmapTextGeoProc.cpp b/src/gpu/effects/GrBitmapTextGeoProc.cpp
index 11c7982..76dc123 100644
--- a/src/gpu/effects/GrBitmapTextGeoProc.cpp
+++ b/src/gpu/effects/GrBitmapTextGeoProc.cpp
@@ -125,7 +125,7 @@
///////////////////////////////////////////////////////////////////////////////
GrBitmapTextGeoProc::GrBitmapTextGeoProc(GrColor color, GrTexture* texture,
- const GrTextureParams& params, GrMaskFormat format,
+ const GrSamplerParams& params, GrMaskFormat format,
const SkMatrix& localMatrix, bool usesLocalCoords)
: fColor(color)
, fLocalMatrix(localMatrix)
@@ -160,8 +160,8 @@
GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrBitmapTextGeoProc);
sk_sp<GrGeometryProcessor> GrBitmapTextGeoProc::TestCreate(GrProcessorTestData* d) {
- int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
- GrProcessorUnitTest::kAlphaTextureIdx;
+ int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx
+ : GrProcessorUnitTest::kAlphaTextureIdx;
static const SkShader::TileMode kTileModes[] = {
SkShader::kClamp_TileMode,
SkShader::kRepeat_TileMode,
@@ -171,8 +171,8 @@
kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
};
- GrTextureParams params(tileModes, d->fRandom->nextBool() ? GrTextureParams::kBilerp_FilterMode :
- GrTextureParams::kNone_FilterMode);
+ GrSamplerParams params(tileModes, d->fRandom->nextBool() ? GrSamplerParams::kBilerp_FilterMode
+ : GrSamplerParams::kNone_FilterMode);
GrMaskFormat format = kARGB_GrMaskFormat; // init to avoid warning
switch (d->fRandom->nextULessThan(3)) {
diff --git a/src/gpu/effects/GrBitmapTextGeoProc.h b/src/gpu/effects/GrBitmapTextGeoProc.h
index 7e2df0a..c8fc99b 100644
--- a/src/gpu/effects/GrBitmapTextGeoProc.h
+++ b/src/gpu/effects/GrBitmapTextGeoProc.h
@@ -16,12 +16,12 @@
/**
* The output color of this effect is a modulation of the input color and a sample from a texture.
- * It allows explicit specification of the filtering and wrap modes (GrTextureParams). The input
+ * It allows explicit specification of the filtering and wrap modes (GrSamplerParams). The input
* coords are a custom attribute.
*/
class GrBitmapTextGeoProc : public GrGeometryProcessor {
public:
- static sk_sp<GrGeometryProcessor> Make(GrColor color, GrTexture* tex, const GrTextureParams& p,
+ static sk_sp<GrGeometryProcessor> Make(GrColor color, GrTexture* tex, const GrSamplerParams& p,
GrMaskFormat format, const SkMatrix& localMatrix,
bool usesLocalCoords) {
return sk_sp<GrGeometryProcessor>(
@@ -47,7 +47,7 @@
GrGLSLPrimitiveProcessor* createGLSLInstance(const GrGLSLCaps& caps) const override;
private:
- GrBitmapTextGeoProc(GrColor, GrTexture* texture, const GrTextureParams& params,
+ GrBitmapTextGeoProc(GrColor, GrTexture* texture, const GrSamplerParams& params,
GrMaskFormat format, const SkMatrix& localMatrix, bool usesLocalCoords);
GrColor fColor;
diff --git a/src/gpu/effects/GrDistanceFieldGeoProc.cpp b/src/gpu/effects/GrDistanceFieldGeoProc.cpp
index 8de6cd2..d5476d4 100644
--- a/src/gpu/effects/GrDistanceFieldGeoProc.cpp
+++ b/src/gpu/effects/GrDistanceFieldGeoProc.cpp
@@ -230,7 +230,7 @@
GrDistanceFieldA8TextGeoProc::GrDistanceFieldA8TextGeoProc(GrColor color,
const SkMatrix& viewMatrix,
GrTexture* texture,
- const GrTextureParams& params,
+ const GrSamplerParams& params,
#ifdef SK_GAMMA_APPLY_TO_A8
float distanceAdjust,
#endif
@@ -280,8 +280,8 @@
kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
};
- GrTextureParams params(tileModes, d->fRandom->nextBool() ? GrTextureParams::kBilerp_FilterMode :
- GrTextureParams::kNone_FilterMode);
+ GrSamplerParams params(tileModes, d->fRandom->nextBool() ? GrSamplerParams::kBilerp_FilterMode
+ : GrSamplerParams::kNone_FilterMode);
uint32_t flags = 0;
flags |= d->fRandom->nextBool() ? kSimilarity_DistanceFieldEffectFlag : 0;
@@ -479,7 +479,7 @@
GrColor color,
const SkMatrix& viewMatrix,
GrTexture* texture,
- const GrTextureParams& params,
+ const GrSamplerParams& params,
uint32_t flags,
bool usesLocalCoords)
: fColor(color)
@@ -522,8 +522,8 @@
kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
};
- GrTextureParams params(tileModes, d->fRandom->nextBool() ? GrTextureParams::kBilerp_FilterMode
- : GrTextureParams::kNone_FilterMode);
+ GrSamplerParams params(tileModes, d->fRandom->nextBool() ? GrSamplerParams::kBilerp_FilterMode
+ : GrSamplerParams::kNone_FilterMode);
uint32_t flags = 0;
flags |= d->fRandom->nextBool() ? kSimilarity_DistanceFieldEffectFlag : 0;
@@ -781,7 +781,7 @@
GrDistanceFieldLCDTextGeoProc::GrDistanceFieldLCDTextGeoProc(
GrColor color, const SkMatrix& viewMatrix,
- GrTexture* texture, const GrTextureParams& params,
+ GrTexture* texture, const GrSamplerParams& params,
DistanceAdjust distanceAdjust,
uint32_t flags, bool usesLocalCoords)
: fColor(color)
@@ -825,8 +825,8 @@
kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
};
- GrTextureParams params(tileModes, d->fRandom->nextBool() ? GrTextureParams::kBilerp_FilterMode :
- GrTextureParams::kNone_FilterMode);
+ GrSamplerParams params(tileModes, d->fRandom->nextBool() ? GrSamplerParams::kBilerp_FilterMode
+ : GrSamplerParams::kNone_FilterMode);
DistanceAdjust wa = { 0.0f, 0.1f, -0.1f };
uint32_t flags = kUseLCD_DistanceFieldEffectFlag;
flags |= d->fRandom->nextBool() ? kSimilarity_DistanceFieldEffectFlag : 0;
diff --git a/src/gpu/effects/GrDistanceFieldGeoProc.h b/src/gpu/effects/GrDistanceFieldGeoProc.h
index 68e0a24..880c4e1 100644
--- a/src/gpu/effects/GrDistanceFieldGeoProc.h
+++ b/src/gpu/effects/GrDistanceFieldGeoProc.h
@@ -43,14 +43,14 @@
/**
* The output color of this effect is a modulation of the input color and a sample from a
* distance field texture (using a smoothed step function near 0.5).
- * It allows explicit specification of the filtering and wrap modes (GrTextureParams). The input
+ * It allows explicit specification of the filtering and wrap modes (GrSamplerParams). The input
* coords are a custom attribute. Gamma correction is handled via a texture LUT.
*/
class GrDistanceFieldA8TextGeoProc : public GrGeometryProcessor {
public:
#ifdef SK_GAMMA_APPLY_TO_A8
static sk_sp<GrGeometryProcessor> Make(GrColor color, const SkMatrix& viewMatrix,
- GrTexture* tex, const GrTextureParams& params,
+ GrTexture* tex, const GrSamplerParams& params,
float lum, uint32_t flags, bool usesLocalCoords) {
return sk_sp<GrGeometryProcessor>(
new GrDistanceFieldA8TextGeoProc(color, viewMatrix, tex, params, lum, flags,
@@ -58,7 +58,7 @@
}
#else
static sk_sp<GrGeometryProcessor> Make(GrColor color, const SkMatrix& viewMatrix,
- GrTexture* tex, const GrTextureParams& params,
+ GrTexture* tex, const GrSamplerParams& params,
uint32_t flags, bool usesLocalCoords) {
return sk_sp<GrGeometryProcessor>(
new GrDistanceFieldA8TextGeoProc(color, viewMatrix, tex, params, flags,
@@ -88,7 +88,7 @@
private:
GrDistanceFieldA8TextGeoProc(GrColor, const SkMatrix& viewMatrix,
- GrTexture* texture, const GrTextureParams& params,
+ GrTexture* texture, const GrSamplerParams& params,
#ifdef SK_GAMMA_APPLY_TO_A8
float distanceAdjust,
#endif
@@ -115,13 +115,13 @@
/**
* The output color of this effect is a modulation of the input color and a sample from a
* distance field texture (using a smoothed step function near 0.5).
-* It allows explicit specification of the filtering and wrap modes (GrTextureParams). The input
+* It allows explicit specification of the filtering and wrap modes (GrSamplerParams). The input
* coords are a custom attribute. No gamma correct blending is applied. Used for paths only.
*/
class GrDistanceFieldPathGeoProc : public GrGeometryProcessor {
public:
static sk_sp<GrGeometryProcessor> Make(GrColor color, const SkMatrix& viewMatrix,
- GrTexture* tex, const GrTextureParams& params,
+ GrTexture* tex, const GrSamplerParams& params,
uint32_t flags, bool usesLocalCoords) {
return sk_sp<GrGeometryProcessor>(
new GrDistanceFieldPathGeoProc(color, viewMatrix, tex, params, flags, usesLocalCoords));
@@ -146,7 +146,7 @@
private:
GrDistanceFieldPathGeoProc(GrColor, const SkMatrix& viewMatrix, GrTexture* texture,
- const GrTextureParams& params, uint32_t flags,
+ const GrSamplerParams& params, uint32_t flags,
bool usesLocalCoords);
GrColor fColor;
@@ -166,7 +166,7 @@
/**
* The output color of this effect is a modulation of the input color and samples from a
* distance field texture (using a smoothed step function near 0.5), adjusted for LCD displays.
- * It allows explicit specification of the filtering and wrap modes (GrTextureParams). The input
+ * It allows explicit specification of the filtering and wrap modes (GrSamplerParams). The input
* coords are a custom attribute. Gamma correction is handled via a texture LUT.
*/
class GrDistanceFieldLCDTextGeoProc : public GrGeometryProcessor {
@@ -187,7 +187,7 @@
};
static sk_sp<GrGeometryProcessor> Make(GrColor color, const SkMatrix& viewMatrix,
- GrTexture* tex, const GrTextureParams& params,
+ GrTexture* tex, const GrSamplerParams& params,
DistanceAdjust distanceAdjust, uint32_t flags,
bool usesLocalCoords) {
return sk_sp<GrGeometryProcessor>(
@@ -215,7 +215,7 @@
private:
GrDistanceFieldLCDTextGeoProc(GrColor, const SkMatrix& viewMatrix,
- GrTexture* texture, const GrTextureParams& params,
+ GrTexture* texture, const GrSamplerParams& params,
DistanceAdjust wa, uint32_t flags,
bool usesLocalCoords);
diff --git a/src/gpu/effects/GrSimpleTextureEffect.cpp b/src/gpu/effects/GrSimpleTextureEffect.cpp
index beb64d5..1c213a7 100644
--- a/src/gpu/effects/GrSimpleTextureEffect.cpp
+++ b/src/gpu/effects/GrSimpleTextureEffect.cpp
@@ -81,8 +81,8 @@
kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
kTileModes[d->fRandom->nextULessThan(SK_ARRAY_COUNT(kTileModes))],
};
- GrTextureParams params(tileModes, d->fRandom->nextBool() ? GrTextureParams::kBilerp_FilterMode :
- GrTextureParams::kNone_FilterMode);
+ GrSamplerParams params(tileModes, d->fRandom->nextBool() ? GrSamplerParams::kBilerp_FilterMode :
+ GrSamplerParams::kNone_FilterMode);
const SkMatrix& matrix = GrTest::TestMatrix(d->fRandom);
auto colorSpaceXform = GrTest::TestColorXform(d->fRandom);
diff --git a/src/gpu/effects/GrSimpleTextureEffect.h b/src/gpu/effects/GrSimpleTextureEffect.h
index fced736..ccb590e 100644
--- a/src/gpu/effects/GrSimpleTextureEffect.h
+++ b/src/gpu/effects/GrSimpleTextureEffect.h
@@ -14,7 +14,7 @@
/**
* The output color of this effect is a modulation of the input color and a sample from a texture.
- * It allows explicit specification of the filtering and wrap modes (GrTextureParams) and accepts
+ * It allows explicit specification of the filtering and wrap modes (GrSamplerParams) and accepts
* a matrix that is used to compute texture coordinates from local coordinates.
*/
class GrSimpleTextureEffect : public GrSingleTextureEffect {
@@ -25,14 +25,14 @@
const SkMatrix& matrix) {
return sk_sp<GrFragmentProcessor>(
new GrSimpleTextureEffect(tex, std::move(colorSpaceXform), matrix,
- GrTextureParams::kNone_FilterMode));
+ GrSamplerParams::kNone_FilterMode));
}
/* clamp mode */
static sk_sp<GrFragmentProcessor> Make(GrTexture* tex,
sk_sp<GrColorSpaceXform> colorSpaceXform,
const SkMatrix& matrix,
- GrTextureParams::FilterMode filterMode) {
+ GrSamplerParams::FilterMode filterMode) {
return sk_sp<GrFragmentProcessor>(
new GrSimpleTextureEffect(tex, std::move(colorSpaceXform), matrix, filterMode));
}
@@ -40,7 +40,7 @@
static sk_sp<GrFragmentProcessor> Make(GrTexture* tex,
sk_sp<GrColorSpaceXform> colorSpaceXform,
const SkMatrix& matrix,
- const GrTextureParams& p) {
+ const GrSamplerParams& p) {
return sk_sp<GrFragmentProcessor>(new GrSimpleTextureEffect(tex, std::move(colorSpaceXform),
matrix, p));
}
@@ -53,7 +53,7 @@
GrSimpleTextureEffect(GrTexture* texture,
sk_sp<GrColorSpaceXform> colorSpaceXform,
const SkMatrix& matrix,
- GrTextureParams::FilterMode filterMode)
+ GrSamplerParams::FilterMode filterMode)
: GrSingleTextureEffect(texture, std::move(colorSpaceXform), matrix, filterMode) {
this->initClassID<GrSimpleTextureEffect>();
}
@@ -61,7 +61,7 @@
GrSimpleTextureEffect(GrTexture* texture,
sk_sp<GrColorSpaceXform> colorSpaceXform,
const SkMatrix& matrix,
- const GrTextureParams& params)
+ const GrSamplerParams& params)
: GrSingleTextureEffect(texture, std::move(colorSpaceXform), matrix, params) {
this->initClassID<GrSimpleTextureEffect>();
}
diff --git a/src/gpu/effects/GrSingleTextureEffect.cpp b/src/gpu/effects/GrSingleTextureEffect.cpp
index 929275e..425e367 100644
--- a/src/gpu/effects/GrSingleTextureEffect.cpp
+++ b/src/gpu/effects/GrSingleTextureEffect.cpp
@@ -10,7 +10,7 @@
GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture,
sk_sp<GrColorSpaceXform> colorSpaceXform,
const SkMatrix& m)
- : fCoordTransform(m, texture, GrTextureParams::kNone_FilterMode)
+ : fCoordTransform(m, texture, GrSamplerParams::kNone_FilterMode)
, fTextureSampler(texture)
, fColorSpaceXform(std::move(colorSpaceXform)) {
this->addCoordTransform(&fCoordTransform);
@@ -20,7 +20,7 @@
GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture,
sk_sp<GrColorSpaceXform> colorSpaceXform,
const SkMatrix& m,
- GrTextureParams::FilterMode filterMode)
+ GrSamplerParams::FilterMode filterMode)
: fCoordTransform(m, texture, filterMode)
, fTextureSampler(texture, filterMode)
, fColorSpaceXform(std::move(colorSpaceXform)) {
@@ -31,7 +31,7 @@
GrSingleTextureEffect::GrSingleTextureEffect(GrTexture* texture,
sk_sp<GrColorSpaceXform> colorSpaceXform,
const SkMatrix& m,
- const GrTextureParams& params)
+ const GrSamplerParams& params)
: fCoordTransform(m, texture, params.filterMode())
, fTextureSampler(texture, params)
, fColorSpaceXform(std::move(colorSpaceXform)) {
diff --git a/src/gpu/effects/GrSingleTextureEffect.h b/src/gpu/effects/GrSingleTextureEffect.h
index fd1ba98..716ad2f 100644
--- a/src/gpu/effects/GrSingleTextureEffect.h
+++ b/src/gpu/effects/GrSingleTextureEffect.h
@@ -37,11 +37,11 @@
GrSingleTextureEffect(GrTexture*, sk_sp<GrColorSpaceXform>, const SkMatrix&);
/** clamp mode */
GrSingleTextureEffect(GrTexture*, sk_sp<GrColorSpaceXform>, const SkMatrix&,
- GrTextureParams::FilterMode filterMode);
+ GrSamplerParams::FilterMode filterMode);
GrSingleTextureEffect(GrTexture*,
sk_sp<GrColorSpaceXform>,
const SkMatrix&,
- const GrTextureParams&);
+ const GrSamplerParams&);
/**
* Can be used as a helper to implement subclass onComputeInvariantOutput(). It assumes that
diff --git a/src/gpu/effects/GrTextureDomain.cpp b/src/gpu/effects/GrTextureDomain.cpp
index a05a793..51f3051 100644
--- a/src/gpu/effects/GrTextureDomain.cpp
+++ b/src/gpu/effects/GrTextureDomain.cpp
@@ -176,7 +176,7 @@
const SkMatrix& matrix,
const SkRect& domain,
GrTextureDomain::Mode mode,
- GrTextureParams::FilterMode filterMode) {
+ GrSamplerParams::FilterMode filterMode) {
static const SkRect kFullRect = {0, 0, SK_Scalar1, SK_Scalar1};
if (GrTextureDomain::kIgnore_Mode == mode ||
(GrTextureDomain::kClamp_Mode == mode && domain.contains(kFullRect))) {
@@ -193,11 +193,11 @@
const SkMatrix& matrix,
const SkRect& domain,
GrTextureDomain::Mode mode,
- GrTextureParams::FilterMode filterMode)
+ GrSamplerParams::FilterMode filterMode)
: GrSingleTextureEffect(texture, std::move(colorSpaceXform), matrix, filterMode)
, fTextureDomain(domain, mode) {
SkASSERT(mode != GrTextureDomain::kRepeat_Mode ||
- filterMode == GrTextureParams::kNone_FilterMode);
+ filterMode == GrSamplerParams::kNone_FilterMode);
this->initClassID<GrTextureDomainEffect>();
}
@@ -280,7 +280,7 @@
matrix,
domain,
mode,
- bilerp ? GrTextureParams::kBilerp_FilterMode : GrTextureParams::kNone_FilterMode);
+ bilerp ? GrSamplerParams::kBilerp_FilterMode : GrSamplerParams::kNone_FilterMode);
}
///////////////////////////////////////////////////////////////////////////////
@@ -293,7 +293,7 @@
GrDeviceSpaceTextureDecalFragmentProcessor::GrDeviceSpaceTextureDecalFragmentProcessor(
GrTexture* texture, const SkIRect& subset, const SkIPoint& deviceSpaceOffset)
- : fTextureSampler(texture, GrTextureParams::ClampNoFilter())
+ : fTextureSampler(texture, GrSamplerParams::ClampNoFilter())
, fTextureDomain(GrTextureDomain::MakeTexelDomain(texture, subset),
GrTextureDomain::kDecal_Mode) {
this->addTextureSampler(&fTextureSampler);
diff --git a/src/gpu/effects/GrTextureDomain.h b/src/gpu/effects/GrTextureDomain.h
index d557d17..4c3cf22 100644
--- a/src/gpu/effects/GrTextureDomain.h
+++ b/src/gpu/effects/GrTextureDomain.h
@@ -171,7 +171,7 @@
const SkMatrix&,
const SkRect& domain,
GrTextureDomain::Mode,
- GrTextureParams::FilterMode filterMode);
+ GrSamplerParams::FilterMode filterMode);
const char* name() const override { return "TextureDomain"; }
@@ -192,7 +192,7 @@
const SkMatrix&,
const SkRect& domain,
GrTextureDomain::Mode,
- GrTextureParams::FilterMode);
+ GrSamplerParams::FilterMode);
GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
diff --git a/src/gpu/effects/GrYUVEffect.cpp b/src/gpu/effects/GrYUVEffect.cpp
index 2fd3513..2978357 100644
--- a/src/gpu/effects/GrYUVEffect.cpp
+++ b/src/gpu/effects/GrYUVEffect.cpp
@@ -78,13 +78,13 @@
yuvMatrix[1].preScale(w[1] / w[0], h[1] / h[0]);
yuvMatrix[2] = yuvMatrix[0];
yuvMatrix[2].preScale(w[2] / w[0], h[2] / h[0]);
- GrTextureParams::FilterMode uvFilterMode =
+ GrSamplerParams::FilterMode uvFilterMode =
((sizes[1].fWidth != sizes[0].fWidth) ||
(sizes[1].fHeight != sizes[0].fHeight) ||
(sizes[2].fWidth != sizes[0].fWidth) ||
(sizes[2].fHeight != sizes[0].fHeight)) ?
- GrTextureParams::kBilerp_FilterMode :
- GrTextureParams::kNone_FilterMode;
+ GrSamplerParams::kBilerp_FilterMode :
+ GrSamplerParams::kNone_FilterMode;
return sk_sp<GrFragmentProcessor>(new YUVtoRGBEffect(
yTexture, uTexture, vTexture, yuvMatrix, uvFilterMode, colorSpace, nv12));
}
@@ -152,9 +152,9 @@
private:
YUVtoRGBEffect(GrTexture* yTexture, GrTexture* uTexture, GrTexture* vTexture,
- const SkMatrix yuvMatrix[3], GrTextureParams::FilterMode uvFilterMode,
+ const SkMatrix yuvMatrix[3], GrSamplerParams::FilterMode uvFilterMode,
SkYUVColorSpace colorSpace, bool nv12)
- : fYTransform(yuvMatrix[0], yTexture, GrTextureParams::kNone_FilterMode)
+ : fYTransform(yuvMatrix[0], yTexture, GrSamplerParams::kNone_FilterMode)
, fYSampler(yTexture)
, fUTransform(yuvMatrix[1], uTexture, uvFilterMode)
, fUSampler(uTexture, uvFilterMode)
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index ad5fcf7..57376d7 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -3175,7 +3175,7 @@
}
}
-void GrGLGpu::bindTexture(int unitIdx, const GrTextureParams& params, bool allowSRGBInputs,
+void GrGLGpu::bindTexture(int unitIdx, const GrSamplerParams& params, bool allowSRGBInputs,
GrGLTexture* texture) {
SkASSERT(texture);
@@ -3222,11 +3222,11 @@
GR_GL_LINEAR,
GR_GL_LINEAR
};
- GrTextureParams::FilterMode filterMode = params.filterMode();
+ GrSamplerParams::FilterMode filterMode = params.filterMode();
- if (GrTextureParams::kMipMap_FilterMode == filterMode) {
+ if (GrSamplerParams::kMipMap_FilterMode == filterMode) {
if (!this->caps()->mipMapSupport() || GrPixelConfigIsCompressed(texture->config())) {
- filterMode = GrTextureParams::kBilerp_FilterMode;
+ filterMode = GrSamplerParams::kBilerp_FilterMode;
}
}
@@ -3243,7 +3243,7 @@
#ifdef SK_DEBUG
// We were supposed to ensure MipMaps were up-to-date and built correctly before getting here.
- if (GrTextureParams::kMipMap_FilterMode == filterMode) {
+ if (GrSamplerParams::kMipMap_FilterMode == filterMode) {
SkASSERT(!texture->texturePriv().mipMapsAreDirty());
if (GrPixelConfigIsSRGB(texture->config())) {
SkDestinationSurfaceColorMode colorMode = allowSRGBInputs
@@ -3342,20 +3342,20 @@
}
}
-void GrGLGpu::generateMipmaps(const GrTextureParams& params, bool allowSRGBInputs,
+void GrGLGpu::generateMipmaps(const GrSamplerParams& params, bool allowSRGBInputs,
GrGLTexture* texture) {
SkASSERT(texture);
// First, figure out if we need mips for this texture at all:
- GrTextureParams::FilterMode filterMode = params.filterMode();
+ GrSamplerParams::FilterMode filterMode = params.filterMode();
- if (GrTextureParams::kMipMap_FilterMode == filterMode) {
+ if (GrSamplerParams::kMipMap_FilterMode == filterMode) {
if (!this->caps()->mipMapSupport() || GrPixelConfigIsCompressed(texture->config())) {
- filterMode = GrTextureParams::kBilerp_FilterMode;
+ filterMode = GrSamplerParams::kBilerp_FilterMode;
}
}
- if (GrTextureParams::kMipMap_FilterMode != filterMode) {
+ if (GrSamplerParams::kMipMap_FilterMode != filterMode) {
return;
}
@@ -4177,7 +4177,7 @@
int w = srcRect.width();
int h = srcRect.height();
- GrTextureParams params(SkShader::kClamp_TileMode, GrTextureParams::kNone_FilterMode);
+ GrSamplerParams params(SkShader::kClamp_TileMode, GrSamplerParams::kNone_FilterMode);
this->bindTexture(0, params, true, srcTex);
GrGLIRect dstVP;
@@ -4415,7 +4415,7 @@
// Bind the texture, to get things configured for filtering.
// We'll be changing our base level further below:
this->setTextureUnit(0);
- GrTextureParams params(SkShader::kClamp_TileMode, GrTextureParams::kBilerp_FilterMode);
+ GrSamplerParams params(SkShader::kClamp_TileMode, GrSamplerParams::kBilerp_FilterMode);
this->bindTexture(0, params, gammaCorrect, texture);
// Vertex data:
@@ -4643,14 +4643,14 @@
return attribState;
}
-bool GrGLGpu::onMakeCopyForTextureParams(GrTexture* texture, const GrTextureParams& textureParams,
+bool GrGLGpu::onMakeCopyForTextureParams(GrTexture* texture, const GrSamplerParams& textureParams,
GrTextureProducer::CopyParams* copyParams) const {
if (textureParams.isTiled() ||
- GrTextureParams::kMipMap_FilterMode == textureParams.filterMode()) {
+ GrSamplerParams::kMipMap_FilterMode == textureParams.filterMode()) {
GrGLTexture* glTexture = static_cast<GrGLTexture*>(texture);
if (GR_GL_TEXTURE_EXTERNAL == glTexture->target() ||
GR_GL_TEXTURE_RECTANGLE == glTexture->target()) {
- copyParams->fFilter = GrTextureParams::kNone_FilterMode;
+ copyParams->fFilter = GrSamplerParams::kNone_FilterMode;
copyParams->fWidth = texture->width();
copyParams->fHeight = texture->height();
return true;
diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h
index da0eae0..dff342d 100644
--- a/src/gpu/gl/GrGLGpu.h
+++ b/src/gpu/gl/GrGLGpu.h
@@ -57,12 +57,12 @@
}
// Used by GrGLProgram to configure OpenGL state.
- void bindTexture(int unitIdx, const GrTextureParams& params, bool allowSRGBInputs,
+ void bindTexture(int unitIdx, const GrSamplerParams& params, bool allowSRGBInputs,
GrGLTexture* texture);
void bindTexelBuffer(int unitIdx, GrPixelConfig, GrGLBuffer*);
- void generateMipmaps(const GrTextureParams& params, bool allowSRGBInputs, GrGLTexture* texture);
+ void generateMipmaps(const GrSamplerParams& params, bool allowSRGBInputs, GrGLTexture* texture);
bool onGetReadPixelsInfo(GrSurface* srcSurface, int readWidth, int readHeight, size_t rowBytes,
GrPixelConfig readConfig, DrawPreference*,
@@ -184,7 +184,7 @@
bool renderTarget, GrGLTexture::TexParams* initialTexParams,
const SkTArray<GrMipLevel>& texels);
- bool onMakeCopyForTextureParams(GrTexture*, const GrTextureParams&,
+ bool onMakeCopyForTextureParams(GrTexture*, const GrSamplerParams&,
GrTextureProducer::CopyParams*) const override;
// Checks whether glReadPixels can be called to get pixel values in readConfig from the
diff --git a/src/gpu/gl/GrGLTexture.cpp b/src/gpu/gl/GrGLTexture.cpp
index 0174452..eb28e23 100644
--- a/src/gpu/gl/GrGLTexture.cpp
+++ b/src/gpu/gl/GrGLTexture.cpp
@@ -30,18 +30,18 @@
}
}
-static inline GrTextureParams::FilterMode highest_filter_mode(const GrGLTexture::IDDesc& idDesc,
+static inline GrSamplerParams::FilterMode highest_filter_mode(const GrGLTexture::IDDesc& idDesc,
GrPixelConfig config) {
if (GrPixelConfigIsSint(config)) {
// Integer textures in GL can use GL_NEAREST_MIPMAP_NEAREST. This is a mode we don't support
// and don't currently have a use for.
- return GrTextureParams::kNone_FilterMode;
+ return GrSamplerParams::kNone_FilterMode;
}
if (idDesc.fInfo.fTarget == GR_GL_TEXTURE_RECTANGLE ||
idDesc.fInfo.fTarget == GR_GL_TEXTURE_EXTERNAL) {
- return GrTextureParams::kBilerp_FilterMode;
+ return GrSamplerParams::kBilerp_FilterMode;
}
- return GrTextureParams::kMipMap_FilterMode;
+ return GrSamplerParams::kMipMap_FilterMode;
}
// Because this class is virtually derived from GrSurface we must explicitly call its constructor.
diff --git a/src/gpu/vk/GrVkCopyManager.cpp b/src/gpu/vk/GrVkCopyManager.cpp
index 636b650..6e96822 100644
--- a/src/gpu/vk/GrVkCopyManager.cpp
+++ b/src/gpu/vk/GrVkCopyManager.cpp
@@ -8,7 +8,7 @@
#include "GrVkCopyManager.h"
#include "GrSurface.h"
-#include "GrTextureParams.h"
+#include "GrSamplerParams.h"
#include "GrTexturePriv.h"
#include "GrVkCommandBuffer.h"
#include "GrVkCopyPipeline.h"
@@ -234,7 +234,7 @@
const GrVkDescriptorSet* samplerDS =
gpu->resourceProvider().getSamplerDescriptorSet(fSamplerDSHandle);
- GrTextureParams params(SkShader::kClamp_TileMode, GrTextureParams::kNone_FilterMode);
+ GrSamplerParams params(SkShader::kClamp_TileMode, GrSamplerParams::kNone_FilterMode);
GrVkSampler* sampler =
resourceProv.findOrCreateCompatibleSampler(params, srcTex->texturePriv().maxMipMapLevel());
diff --git a/src/gpu/vk/GrVkGpuCommandBuffer.cpp b/src/gpu/vk/GrVkGpuCommandBuffer.cpp
index e94585f..9b70c0b 100644
--- a/src/gpu/vk/GrVkGpuCommandBuffer.cpp
+++ b/src/gpu/vk/GrVkGpuCommandBuffer.cpp
@@ -437,9 +437,9 @@
gpu->onResolveRenderTarget(texRT);
}
- const GrTextureParams& params = sampler.params();
+ const GrSamplerParams& params = sampler.params();
// Check if we need to regenerate any mip maps
- if (GrTextureParams::kMipMap_FilterMode == params.filterMode()) {
+ if (GrSamplerParams::kMipMap_FilterMode == params.filterMode()) {
if (vkTexture->texturePriv().mipMapsAreDirty()) {
gpu->generateMipmap(vkTexture);
vkTexture->texturePriv().dirtyMipMaps(false);
diff --git a/src/gpu/vk/GrVkPipelineState.cpp b/src/gpu/vk/GrVkPipelineState.cpp
index 48228e0..2d53cd8 100644
--- a/src/gpu/vk/GrVkPipelineState.cpp
+++ b/src/gpu/vk/GrVkPipelineState.cpp
@@ -310,7 +310,7 @@
SkASSERT(fNumSamplers == textureBindings.count());
for (int i = 0; i < textureBindings.count(); ++i) {
- const GrTextureParams& params = textureBindings[i]->params();
+ const GrSamplerParams& params = textureBindings[i]->params();
GrVkTexture* texture = static_cast<GrVkTexture*>(textureBindings[i]->texture());
diff --git a/src/gpu/vk/GrVkResourceProvider.cpp b/src/gpu/vk/GrVkResourceProvider.cpp
index 5cde9bc..81e1738 100644
--- a/src/gpu/vk/GrVkResourceProvider.cpp
+++ b/src/gpu/vk/GrVkResourceProvider.cpp
@@ -7,7 +7,7 @@
#include "GrVkResourceProvider.h"
-#include "GrTextureParams.h"
+#include "GrSamplerParams.h"
#include "GrVkCommandBuffer.h"
#include "GrVkCopyPipeline.h"
#include "GrVkGLSLSampler.h"
@@ -164,7 +164,7 @@
return new GrVkDescriptorPool(fGpu, type, count);
}
-GrVkSampler* GrVkResourceProvider::findOrCreateCompatibleSampler(const GrTextureParams& params,
+GrVkSampler* GrVkResourceProvider::findOrCreateCompatibleSampler(const GrSamplerParams& params,
uint32_t mipLevels) {
GrVkSampler* sampler = fSamplers.find(GrVkSampler::GenerateKey(params, mipLevels));
if (!sampler) {
diff --git a/src/gpu/vk/GrVkResourceProvider.h b/src/gpu/vk/GrVkResourceProvider.h
index 99724a6..024488a 100644
--- a/src/gpu/vk/GrVkResourceProvider.h
+++ b/src/gpu/vk/GrVkResourceProvider.h
@@ -25,7 +25,7 @@
class GrPipeline;
class GrPrimitiveProcessor;
-class GrTextureParams;
+class GrSamplerParams;
class GrVkCopyPipeline;
class GrVkGpu;
class GrVkPipeline;
@@ -97,9 +97,9 @@
// of our cache of GrVkDescriptorPools.
GrVkDescriptorPool* findOrCreateCompatibleDescriptorPool(VkDescriptorType type, uint32_t count);
- // Finds or creates a compatible GrVkSampler based on the GrTextureParams.
+ // Finds or creates a compatible GrVkSampler based on the GrSamplerParams.
// The refcount is incremented and a pointer returned.
- GrVkSampler* findOrCreateCompatibleSampler(const GrTextureParams&, uint32_t mipLevels);
+ GrVkSampler* findOrCreateCompatibleSampler(const GrSamplerParams&, uint32_t mipLevels);
sk_sp<GrVkPipelineState> findOrCreateCompatiblePipelineState(const GrPipeline&,
const GrPrimitiveProcessor&,
diff --git a/src/gpu/vk/GrVkSampler.cpp b/src/gpu/vk/GrVkSampler.cpp
index 799adc9..3901634 100644
--- a/src/gpu/vk/GrVkSampler.cpp
+++ b/src/gpu/vk/GrVkSampler.cpp
@@ -22,7 +22,7 @@
return gWrapModes[tm];
}
-GrVkSampler* GrVkSampler::Create(const GrVkGpu* gpu, const GrTextureParams& params,
+GrVkSampler* GrVkSampler::Create(const GrVkGpu* gpu, const GrSamplerParams& params,
uint32_t mipLevels) {
static VkFilter vkMinFilterModes[] = {
VK_FILTER_NEAREST,
@@ -57,7 +57,7 @@
// level mip). If the filters weren't the same we could set min = 0 and max = 0.25 to force
// the minFilter on mip level 0.
createInfo.minLod = 0.0f;
- bool useMipMaps = GrTextureParams::kMipMap_FilterMode == params.filterMode() && mipLevels > 1;
+ bool useMipMaps = GrSamplerParams::kMipMap_FilterMode == params.filterMode() && mipLevels > 1;
createInfo.maxLod = !useMipMaps ? 0.0f : (float)(mipLevels);
createInfo.borderColor = VK_BORDER_COLOR_FLOAT_TRANSPARENT_BLACK;
createInfo.unnormalizedCoordinates = VK_FALSE;
@@ -76,7 +76,7 @@
GR_VK_CALL(gpu->vkInterface(), DestroySampler(gpu->device(), fSampler, nullptr));
}
-uint16_t GrVkSampler::GenerateKey(const GrTextureParams& params, uint32_t mipLevels) {
+uint16_t GrVkSampler::GenerateKey(const GrSamplerParams& params, uint32_t mipLevels) {
const int kTileModeXShift = 2;
const int kTileModeYShift = 4;
const int kMipLevelShift = 6;
diff --git a/src/gpu/vk/GrVkSampler.h b/src/gpu/vk/GrVkSampler.h
index 369b162..9630602 100644
--- a/src/gpu/vk/GrVkSampler.h
+++ b/src/gpu/vk/GrVkSampler.h
@@ -12,18 +12,18 @@
#include "vk/GrVkDefines.h"
-class GrTextureParams;
+class GrSamplerParams;
class GrVkGpu;
class GrVkSampler : public GrVkResource {
public:
- static GrVkSampler* Create(const GrVkGpu* gpu, const GrTextureParams&, uint32_t mipLevels);
+ static GrVkSampler* Create(const GrVkGpu* gpu, const GrSamplerParams&, uint32_t mipLevels);
VkSampler sampler() const { return fSampler; }
// Helpers for hashing GrVkSampler
- static uint16_t GenerateKey(const GrTextureParams&, uint32_t mipLevels);
+ static uint16_t GenerateKey(const GrSamplerParams&, uint32_t mipLevels);
static const uint16_t& GetKey(const GrVkSampler& sampler) { return sampler.fKey; }
static uint32_t Hash(const uint16_t& key) { return key; }
diff --git a/src/gpu/vk/GrVkTexture.cpp b/src/gpu/vk/GrVkTexture.cpp
index 3b6108c..7f0cf8d 100644
--- a/src/gpu/vk/GrVkTexture.cpp
+++ b/src/gpu/vk/GrVkTexture.cpp
@@ -24,7 +24,7 @@
const GrVkImageView* view)
: GrSurface(gpu, desc)
, GrVkImage(info, GrVkImage::kNot_Wrapped)
- , INHERITED(gpu, desc, kTexture2DSampler_GrSLType, GrTextureParams::kMipMap_FilterMode,
+ , INHERITED(gpu, desc, kTexture2DSampler_GrSLType, GrSamplerParams::kMipMap_FilterMode,
desc.fIsMipMapped)
, fTextureView(view)
, fLinearTextureView(nullptr) {
@@ -39,7 +39,7 @@
GrVkImage::Wrapped wrapped)
: GrSurface(gpu, desc)
, GrVkImage(info, wrapped)
- , INHERITED(gpu, desc, kTexture2DSampler_GrSLType, GrTextureParams::kMipMap_FilterMode,
+ , INHERITED(gpu, desc, kTexture2DSampler_GrSLType, GrSamplerParams::kMipMap_FilterMode,
desc.fIsMipMapped)
, fTextureView(view)
, fLinearTextureView(nullptr) {
@@ -54,7 +54,7 @@
GrVkImage::Wrapped wrapped)
: GrSurface(gpu, desc)
, GrVkImage(info, wrapped)
- , INHERITED(gpu, desc, kTexture2DSampler_GrSLType, GrTextureParams::kMipMap_FilterMode,
+ , INHERITED(gpu, desc, kTexture2DSampler_GrSLType, GrSamplerParams::kMipMap_FilterMode,
desc.fIsMipMapped)
, fTextureView(view)
, fLinearTextureView(nullptr) {
diff --git a/src/image/SkImageShader.cpp b/src/image/SkImageShader.cpp
index da7bb2f..a41b200 100644
--- a/src/image/SkImageShader.cpp
+++ b/src/image/SkImageShader.cpp
@@ -207,10 +207,10 @@
// This completely ignores the complexity of the drawVertices case where explicit local coords
// are provided by the caller.
bool doBicubic;
- GrTextureParams::FilterMode textureFilterMode =
+ GrSamplerParams::FilterMode textureFilterMode =
GrSkFilterQualityToGrFilterMode(args.fFilterQuality, *args.fViewMatrix, this->getLocalMatrix(),
&doBicubic);
- GrTextureParams params(tm, textureFilterMode);
+ GrSamplerParams params(tm, textureFilterMode);
sk_sp<GrTexture> texture(as_IB(fImage)->asTextureRef(args.fContext, params, args.fColorMode));
if (!texture) {
return nullptr;
diff --git a/src/image/SkImage_Base.h b/src/image/SkImage_Base.h
index 7fbe97d..09ceb57 100644
--- a/src/image/SkImage_Base.h
+++ b/src/image/SkImage_Base.h
@@ -18,7 +18,7 @@
#include <new>
-class GrTextureParams;
+class GrSamplerParams;
class SkImageCacherator;
enum {
@@ -55,7 +55,7 @@
virtual bool getROPixels(SkBitmap*, CachingHint = kAllow_CachingHint) const = 0;
// Caller must call unref when they are done.
- virtual GrTexture* asTextureRef(GrContext*, const GrTextureParams&,
+ virtual GrTexture* asTextureRef(GrContext*, const GrSamplerParams&,
SkDestinationSurfaceColorMode) const = 0;
virtual sk_sp<SkImage> onMakeSubset(const SkIRect&) const = 0;
diff --git a/src/image/SkImage_Generator.cpp b/src/image/SkImage_Generator.cpp
index 03dda91..82f395f 100644
--- a/src/image/SkImage_Generator.cpp
+++ b/src/image/SkImage_Generator.cpp
@@ -31,7 +31,7 @@
SkData* onRefEncoded(GrContext*) const override;
sk_sp<SkImage> onMakeSubset(const SkIRect&) const override;
bool getROPixels(SkBitmap*, CachingHint) const override;
- GrTexture* asTextureRef(GrContext*, const GrTextureParams&,
+ GrTexture* asTextureRef(GrContext*, const GrSamplerParams&,
SkDestinationSurfaceColorMode) const override;
bool onIsLazyGenerated() const override { return true; }
@@ -74,7 +74,7 @@
return fCache.lockAsBitmap(bitmap, this, chint);
}
-GrTexture* SkImage_Generator::asTextureRef(GrContext* ctx, const GrTextureParams& params,
+GrTexture* SkImage_Generator::asTextureRef(GrContext* ctx, const GrSamplerParams& params,
SkDestinationSurfaceColorMode colorMode) const {
return fCache.lockAsTexture(ctx, params, colorMode, this);
}
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp
index c75e36b..84c7b10 100644
--- a/src/image/SkImage_Gpu.cpp
+++ b/src/image/SkImage_Gpu.cpp
@@ -85,7 +85,7 @@
return true;
}
-GrTexture* SkImage_Gpu::asTextureRef(GrContext* ctx, const GrTextureParams& params,
+GrTexture* SkImage_Gpu::asTextureRef(GrContext* ctx, const GrSamplerParams& params,
SkDestinationSurfaceColorMode colorMode) const {
GrTextureAdjuster adjuster(this->peekTexture(), this->alphaType(), this->bounds(), this->uniqueID(),
this->onImageInfo().colorSpace());
@@ -299,7 +299,7 @@
static sk_sp<SkImage> create_image_from_maker(GrTextureMaker* maker, SkAlphaType at, uint32_t id) {
sk_sp<GrTexture> texture(
- maker->refTextureForParams(GrTextureParams::ClampNoFilter(),
+ maker->refTextureForParams(GrSamplerParams::ClampNoFilter(),
SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware));
if (!texture) {
return nullptr;
diff --git a/src/image/SkImage_Gpu.h b/src/image/SkImage_Gpu.h
index 13c1e30..19e2944 100644
--- a/src/image/SkImage_Gpu.h
+++ b/src/image/SkImage_Gpu.h
@@ -39,7 +39,7 @@
}
bool getROPixels(SkBitmap*, CachingHint) const override;
- GrTexture* asTextureRef(GrContext* ctx, const GrTextureParams& params,
+ GrTexture* asTextureRef(GrContext* ctx, const GrSamplerParams& params,
SkDestinationSurfaceColorMode) const override;
sk_sp<SkImage> onMakeSubset(const SkIRect&) const override;
diff --git a/src/image/SkImage_Raster.cpp b/src/image/SkImage_Raster.cpp
index be86a2a..a2b12e4 100644
--- a/src/image/SkImage_Raster.cpp
+++ b/src/image/SkImage_Raster.cpp
@@ -89,7 +89,7 @@
SkData* onRefEncoded(GrContext*) const override;
bool getROPixels(SkBitmap*, CachingHint) const override;
- GrTexture* asTextureRef(GrContext*, const GrTextureParams&,
+ GrTexture* asTextureRef(GrContext*, const GrSamplerParams&,
SkDestinationSurfaceColorMode) const override;
sk_sp<SkImage> onMakeSubset(const SkIRect&) const override;
@@ -197,7 +197,7 @@
return true;
}
-GrTexture* SkImage_Raster::asTextureRef(GrContext* ctx, const GrTextureParams& params,
+GrTexture* SkImage_Raster::asTextureRef(GrContext* ctx, const GrSamplerParams& params,
SkDestinationSurfaceColorMode colorMode) const {
#if SK_SUPPORT_GPU
if (!ctx) {
@@ -239,7 +239,7 @@
SkASSERT(fPinnedCount == 0);
SkASSERT(fPinnedUniqueID == 0);
fPinnedTexture.reset(
- GrRefCachedBitmapTexture(ctx, fBitmap, GrTextureParams::ClampNoFilter(),
+ GrRefCachedBitmapTexture(ctx, fBitmap, GrSamplerParams::ClampNoFilter(),
SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware));
if (!fPinnedTexture) {
return false;
diff --git a/tests/IntTextureTest.cpp b/tests/IntTextureTest.cpp
index 15494fe..a6eaf98 100644
--- a/tests/IntTextureTest.cpp
+++ b/tests/IntTextureTest.cpp
@@ -188,9 +188,9 @@
sk_sp<GrRenderTargetContext> rtContext = context->makeRenderTargetContext(
SkBackingFit::kExact, kS, kS, kRGBA_8888_GrPixelConfig, nullptr);
- for (auto filter : {GrTextureParams::kNone_FilterMode,
- GrTextureParams::kBilerp_FilterMode,
- GrTextureParams::kMipMap_FilterMode}) {
+ for (auto filter : {GrSamplerParams::kNone_FilterMode,
+ GrSamplerParams::kBilerp_FilterMode,
+ GrSamplerParams::kMipMap_FilterMode}) {
SkMatrix m;
m.setIDiv(kS, kS);
sk_sp<GrFragmentProcessor> fp(GrSimpleTextureEffect::Make(texture.get(), nullptr, m,
diff --git a/tests/RectangleTextureTest.cpp b/tests/RectangleTextureTest.cpp
index 21540d9..cc0c4d1 100644
--- a/tests/RectangleTextureTest.cpp
+++ b/tests/RectangleTextureTest.cpp
@@ -98,9 +98,9 @@
nullptr));
SkMatrix m;
m.setIDiv(rectangleTexture->width(), rectangleTexture->height());
- for (auto filter : {GrTextureParams::kNone_FilterMode,
- GrTextureParams::kBilerp_FilterMode,
- GrTextureParams::kMipMap_FilterMode}) {
+ for (auto filter : {GrSamplerParams::kNone_FilterMode,
+ GrSamplerParams::kBilerp_FilterMode,
+ GrSamplerParams::kMipMap_FilterMode}) {
rtContext->clear(nullptr, 0xDDCCBBAA, true);
sk_sp<GrFragmentProcessor> fp(GrSimpleTextureEffect::Make(rectangleTexture,
nullptr, m, filter));
diff --git a/tests/SRGBMipMapTest.cpp b/tests/SRGBMipMapTest.cpp
index 4261796..a875c5c 100644
--- a/tests/SRGBMipMapTest.cpp
+++ b/tests/SRGBMipMapTest.cpp
@@ -130,7 +130,7 @@
GrNoClip noClip;
GrPaint paint;
paint.setPorterDuffXPFactory(SkBlendMode::kSrc);
- GrTextureParams mipMapParams(SkShader::kRepeat_TileMode, GrTextureParams::kMipMap_FilterMode);
+ GrSamplerParams mipMapParams(SkShader::kRepeat_TileMode, GrSamplerParams::kMipMap_FilterMode);
paint.addColorTextureProcessor(texture.get(), nullptr, SkMatrix::MakeScale(0.5f), mipMapParams);
// 1) Draw texture to S32 surface (should generate/use sRGB mips)