Rename GrTextureParams to GrSamplerParams
authorBrian Salomon <bsalomon@google.com>
Thu, 17 Nov 2016 20:17:07 +0000 (15:17 -0500)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Thu, 17 Nov 2016 21:13:18 +0000 (21:13 +0000)
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>

79 files changed:
experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp
gm/image_pict.cpp
gm/texturedomaineffect.cpp
gm/yuvtorgbeffect.cpp
gn/gpu.gni
include/core/SkImageGenerator.h
include/gpu/GrContext.h
include/gpu/GrCoordTransform.h
include/gpu/GrPaint.h
include/gpu/GrProcessor.h
include/gpu/GrSamplerParams.h [moved from include/gpu/GrTextureParams.h with 78% similarity]
include/gpu/GrTexture.h
include/gpu/SkGr.h
src/core/SkGpuBlurUtils.cpp
src/core/SkImageCacherator.cpp
src/core/SkImageCacherator.h
src/core/SkNormalMapSource.cpp
src/core/SkShadowShader.cpp
src/core/SkSpecialImage.cpp
src/effects/GrAlphaThresholdFragmentProcessor.cpp
src/effects/GrCircleBlurFragmentProcessor.cpp
src/effects/SkColorCubeFilter.cpp
src/effects/SkDisplacementMapEffect.cpp
src/effects/SkPerlinNoiseShader.cpp
src/effects/SkTableColorFilter.cpp
src/effects/SkXfermodeImageFilter.cpp
src/effects/gradients/SkGradientShader.cpp
src/gpu/GrCoordTransform.cpp
src/gpu/GrGpu.cpp
src/gpu/GrGpu.h
src/gpu/GrPaint.cpp
src/gpu/GrPipelineBuilder.h
src/gpu/GrProcessor.cpp
src/gpu/GrSWMaskHelper.cpp
src/gpu/GrTexture.cpp
src/gpu/GrTextureParamsAdjuster.cpp
src/gpu/GrTextureParamsAdjuster.h
src/gpu/GrTexturePriv.h
src/gpu/GrTextureToYUVPlanes.cpp
src/gpu/SkGpuDevice.cpp
src/gpu/SkGpuDevice.h
src/gpu/SkGpuDevice_drawTexture.cpp
src/gpu/SkGr.cpp
src/gpu/SkGrPriv.h
src/gpu/batches/GrAADistanceFieldPathRenderer.cpp
src/gpu/batches/GrAtlasTextBatch.cpp
src/gpu/effects/GrBicubicEffect.cpp
src/gpu/effects/GrBicubicEffect.h
src/gpu/effects/GrBitmapTextGeoProc.cpp
src/gpu/effects/GrBitmapTextGeoProc.h
src/gpu/effects/GrDistanceFieldGeoProc.cpp
src/gpu/effects/GrDistanceFieldGeoProc.h
src/gpu/effects/GrSimpleTextureEffect.cpp
src/gpu/effects/GrSimpleTextureEffect.h
src/gpu/effects/GrSingleTextureEffect.cpp
src/gpu/effects/GrSingleTextureEffect.h
src/gpu/effects/GrTextureDomain.cpp
src/gpu/effects/GrTextureDomain.h
src/gpu/effects/GrYUVEffect.cpp
src/gpu/gl/GrGLGpu.cpp
src/gpu/gl/GrGLGpu.h
src/gpu/gl/GrGLTexture.cpp
src/gpu/vk/GrVkCopyManager.cpp
src/gpu/vk/GrVkGpuCommandBuffer.cpp
src/gpu/vk/GrVkPipelineState.cpp
src/gpu/vk/GrVkResourceProvider.cpp
src/gpu/vk/GrVkResourceProvider.h
src/gpu/vk/GrVkSampler.cpp
src/gpu/vk/GrVkSampler.h
src/gpu/vk/GrVkTexture.cpp
src/image/SkImageShader.cpp
src/image/SkImage_Base.h
src/image/SkImage_Generator.cpp
src/image/SkImage_Gpu.cpp
src/image/SkImage_Gpu.h
src/image/SkImage_Raster.cpp
tests/IntTextureTest.cpp
tests/RectangleTextureTest.cpp
tests/SRGBMipMapTest.cpp

index 3acb74d..da13732 100644 (file)
@@ -1319,8 +1319,8 @@ sk_sp<GrFragmentProcessor> SkPerlinNoiseShader2::asFragmentProcessor(const AsFPA
     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<GrFragmentProcessor> SkPerlinNoiseShader2::asFragmentProcessor(const AsFPA
 
     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(
index 903024b..148426d 100644 (file)
@@ -315,7 +315,7 @@ protected:
     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
index b76c70e..ad192d6 100644 (file)
@@ -83,7 +83,7 @@ protected:
         }
 
         sk_sp<GrTexture> texture(
-            GrRefCachedBitmapTexture(context, fBmp, GrTextureParams::ClampNoFilter(),
+            GrRefCachedBitmapTexture(context, fBmp, GrSamplerParams::ClampNoFilter(),
                                      SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware));
         if (!texture) {
             return;
@@ -119,7 +119,7 @@ protected:
                         GrTextureDomainEffect::Make(texture.get(), nullptr, textureMatrices[tm],
                                                 GrTextureDomain::MakeTexelDomain(texture.get(),
                                                                                  texelDomains[d]),
-                                                mode, GrTextureParams::kNone_FilterMode));
+                                                mode, GrSamplerParams::kNone_FilterMode));
 
                     if (!fp) {
                         continue;
index 307ea7c..dcc8b15 100644 (file)
@@ -82,13 +82,13 @@ protected:
 
         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 @@ protected:
 
         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]) {
index 6a52384..5a7e75c 100644 (file)
@@ -33,7 +33,7 @@ skia_gpu_sources = [
   "$_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",
index 2e34bfe..6d97f40 100644 (file)
@@ -16,7 +16,7 @@
 class GrContext;
 class GrContextThreadSafeProxy;
 class GrTexture;
-class GrTextureParams;
+class GrSamplerParams;
 class SkBitmap;
 class SkData;
 class SkImage;
@@ -146,13 +146,6 @@ public:
      *  - 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);
 
index 6b2c27a..9965ee8 100644 (file)
@@ -40,7 +40,7 @@ class GrResourceProvider;
 class GrTestTarget;
 class GrTextBlobCache;
 class GrTextContext;
-class GrTextureParams;
+class GrSamplerParams;
 class GrVertexBuffer;
 class GrSwizzle;
 class SkTraceMemoryDump;
index 3080523..1f1cac7 100644 (file)
@@ -27,7 +27,7 @@ public:
      * 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 @@ public:
      * 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 @@ public:
         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) {
index ade2319..9390d02 100644 (file)
@@ -126,8 +126,8 @@ public:
     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(); }
index e600f90..f5f3842 100644 (file)
@@ -179,7 +179,7 @@ GR_MAKE_BITFIELD_OPS(GrProcessor::RequiredFeatures);
 
 /**
  * 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 @@ public:
      */
     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 @@ public:
 
     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 @@ private:
     typedef GrTGpuResourceRef<GrTexture> ProgramTexture;
 
     ProgramTexture                  fTexture;
-    GrTextureParams                 fParams;
+    GrSamplerParams                 fParams;
     GrShaderFlags                   fVisibility;
 
     typedef SkNoncopyable INHERITED;
similarity index 78%
rename from include/gpu/GrTextureParams.h
rename to include/gpu/GrSamplerParams.h
index 3186b1b..512340e 100644 (file)
@@ -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"
 /**
  * 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 @@ public:
         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 @@ public:
 
     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];
index 7381a90..c032cbe 100644 (file)
@@ -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 @@ public:
 
 protected:
     GrTexture(GrGpu*, const GrSurfaceDesc&, GrSLType samplerType,
-              GrTextureParams::FilterMode highestFilterMode, bool wasMipMapDataProvided);
+              GrSamplerParams::FilterMode highestFilterMode, bool wasMipMapDataProvided);
 
     void validateDesc() const;
 
@@ -62,7 +62,7 @@ private:
     };
 
     GrSLType                      fSamplerType;
-    GrTextureParams::FilterMode   fHighestFilterMode;
+    GrSamplerParams::FilterMode   fHighestFilterMode;
     MipMapsStatus                 fMipMapsStatus;
     int                           fMaxMipMapLevel;
     SkDestinationSurfaceColorMode fMipColorMode;
index ffad5cf..0e58e72 100644 (file)
@@ -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 @@ static inline GrColor SkPMColorToGrColor(SkPMColor c) {
 }
 
 ////////////////////////////////////////////////////////////////////////////////
-/** 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 @@ static inline GrPixelConfig SkImageInfo2GrPixelConfig(const SkImageInfo& info, c
     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);
index 8107642..84cc8d8 100644 (file)
@@ -275,12 +275,12 @@ sk_sp<GrRenderTargetContext> GaussianBlur(GrContext* context,
                                                         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 @@ sk_sp<GrRenderTargetContext> GaussianBlur(GrContext* context,
         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);
index 471dbd6..e291242 100644 (file)
@@ -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::lockTexture(GrContext* ctx, const GrUniqueKey& key
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-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 @@ GrTexture* SkImageCacherator::lockAsTexture(GrContext* ctx, const GrTextureParam
 
 #else
 
-GrTexture* SkImageCacherator::lockAsTexture(GrContext* ctx, const GrTextureParams&,
+GrTexture* SkImageCacherator::lockAsTexture(GrContext* ctx, const GrSamplerParams&,
                                             SkDestinationSurfaceColorMode colorMode,
                                             const SkImage* client, SkImage::CachingHint) {
     return nullptr;
index 0e8a953..3500206 100644 (file)
@@ -13,7 +13,7 @@
 #include "SkTemplates.h"
 
 class GrContext;
-class GrTextureParams;
+class GrSamplerParams;
 class GrUniqueKey;
 class SkBitmap;
 class SkImage;
@@ -50,7 +50,7 @@ public:
      *
      *  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);
 
index 25c533c..70d6c43 100644 (file)
@@ -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"
index 9757298..db04638 100644 (file)
@@ -138,7 +138,7 @@ public:
 
                 // 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]);
index c97eb01..c25079e 100644 (file)
@@ -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<SkSpecialImage> SkSpecialImage::makeTextureImage(GrContext* context) {
     }
 
     sk_sp<GrTexture> resultTex(
-        GrRefCachedBitmapTexture(context, bmp, GrTextureParams::ClampNoFilter(),
+        GrRefCachedBitmapTexture(context, bmp, GrSamplerParams::ClampNoFilter(),
                                  SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware));
     if (!resultTex) {
         return nullptr;
@@ -241,7 +241,7 @@ public:
     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 @@ public:
             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());
index 4e4dbbe..99ce113 100644 (file)
@@ -47,12 +47,12 @@ GrAlphaThresholdFragmentProcessor::GrAlphaThresholdFragmentProcessor(
     : 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);
index b8b2660..8afd009 100644 (file)
@@ -92,7 +92,7 @@ GrCircleBlurFragmentProcessor::GrCircleBlurFragmentProcessor(const SkRect& circl
     : fCircle(circle)
     , fSolidRadius(solidRadius)
     , fTextureRadius(textureRadius)
-    , fBlurProfileSampler(blurProfile, GrTextureParams::kBilerp_FilterMode) {
+    , fBlurProfileSampler(blurProfile, GrSamplerParams::kBilerp_FilterMode) {
     this->initClassID<GrCircleBlurFragmentProcessor>();
     this->addTextureSampler(&fBlurProfileSampler);
     this->setWillReadFragmentPosition();
index ad35fda..6a15c55 100644 (file)
@@ -209,7 +209,7 @@ private:
 ///////////////////////////////////////////////////////////////////////////////
 
 GrColorCubeEffect::GrColorCubeEffect(GrTexture* colorCube)
-    : fColorCubeSampler(colorCube, GrTextureParams::kBilerp_FilterMode) {
+    : fColorCubeSampler(colorCube, GrSamplerParams::kBilerp_FilterMode) {
     this->initClassID<GrColorCubeEffect>();
     this->addTextureSampler(&fColorCubeSampler);
 }
index e8767ff..6a8084c 100644 (file)
@@ -485,9 +485,9 @@ GrDisplacementMapEffect::GrDisplacementMapEffect(
                              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)
index dc28e44..d0761d7 100644 (file)
@@ -926,10 +926,10 @@ sk_sp<GrFragmentProcessor> SkPerlinNoiseShader::asFragmentProcessor(const AsFPAr
             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);
index 90a7856..68fd13f 100644 (file)
@@ -474,7 +474,7 @@ sk_sp<GrFragmentProcessor> ColorTableEffect::Make(GrContext* context, SkBitmap b
     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()));
index 840f652..a396b3e 100644 (file)
@@ -258,7 +258,7 @@ sk_sp<SkSpecialImage> SkXfermodeImageFilter_Base::filterImageGPU(
                             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 @@ sk_sp<SkSpecialImage> SkXfermodeImageFilter_Base::filterImageGPU(
                             GrTextureDomain::MakeTexelDomain(foregroundTex.get(), 
                                                              foreground->subset()),
                             GrTextureDomain::kDecal_Mode,
-                            GrTextureParams::kNone_FilterMode);
+                            GrSamplerParams::kNone_FilterMode);
 
         paint.addColorFragmentProcessor(std::move(foregroundFP));
 
index fcd0bd3..39f5636 100644 (file)
@@ -1651,8 +1651,8 @@ GrGradientEffect::GrGradientEffect(const CreateArgs& args) {
 
             // 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);
index 2da49c4..63d91a8 100644 (file)
@@ -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 @@ void GrCoordTransform::reset(const SkMatrix& m, const GrTexture* texture,
     // 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();
index b775cf0..3538b80 100644 (file)
@@ -57,7 +57,7 @@ void GrGpu::disconnect(DisconnectType) {}
 
 ////////////////////////////////////////////////////////////////////////////////
 
-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 @@ bool GrGpu::makeCopyForTextureParams(int width, int height, const GrTextureParam
         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;
index 686820e..f88423b 100644 (file)
@@ -469,16 +469,16 @@ public:
     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 @@ private:
 
     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,
index c6d7f7d..d5f8d3d 100644 (file)
@@ -38,7 +38,7 @@ void GrPaint::addCoverageTextureProcessor(GrTexture* texture, const SkMatrix& ma
 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::addColorTextureProcessor(GrTexture* texture,
 
 void GrPaint::addCoverageTextureProcessor(GrTexture* texture,
                                           const SkMatrix& matrix,
-                                          const GrTextureParams& params) {
+                                          const GrSamplerParams& params) {
     this->addCoverageFragmentProcessor(GrSimpleTextureEffect::Make(texture, nullptr, matrix,
                                                                    params));
 }
index cb69756..1bff9c6 100644 (file)
@@ -86,14 +86,14 @@ public:
 
     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));
     }
index 77927e4..89fc741 100644 (file)
@@ -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 @@ bool GrProcessor::hasSameSamplers(const GrProcessor& that) const {
 
 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,
 }
 
 void GrProcessor::TextureSampler::reset(GrTexture* texture,
-                                        GrTextureParams::FilterMode filterMode,
+                                        GrSamplerParams::FilterMode filterMode,
                                         SkShader::TileMode tileXAndY,
                                         GrShaderFlags visibility) {
     SkASSERT(texture);
index 9430efb..b5dc814 100644 (file)
@@ -192,7 +192,7 @@ void GrSWMaskHelper::DrawToTargetWithShapeMask(GrTexture* texture,
                          GrSimpleTextureEffect::Make(texture,
                                                      nullptr,
                                                      maskMatrix,
-                                                     GrTextureParams::kNone_FilterMode));
+                                                     GrSamplerParams::kNone_FilterMode));
 
     sk_sp<GrDrawBatch> batch(GrRectBatchFactory::CreateNonAAFill(paint.getColor(),
                                                                  SkMatrix::I(),
index 807fb9b..ea0ed76 100644 (file)
@@ -70,7 +70,7 @@ GrSurfaceOrigin resolve_origin(const GrSurfaceDesc& desc) {
 
 //////////////////////////////////////////////////////////////////////////////
 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)
index fa1fffd..ca273a7 100644 (file)
@@ -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 @@ static GrTexture* copy_on_gpu(GrTexture* inputTexture, const SkIRect* subset,
         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 @@ static GrTexture* copy_on_gpu(GrTexture* inputTexture, const SkIRect* subset,
         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 @@ GrTexture* GrTextureAdjuster::refCopy(const CopyParams& copyParams) {
     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 @@ GrTexture* GrTextureAdjuster::refTextureSafeForParams(const GrTextureParams& par
         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, &copyParams)) {
         if (outOffset) {
             if (contentArea) {
@@ -202,7 +202,7 @@ static DomainMode determine_domain_mode(
                                     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 @@ static DomainMode determine_domain_mode(
     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 @@ static sk_sp<GrFragmentProcessor> create_fp_for_domain_and_filter(
                                         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 @@ static sk_sp<GrFragmentProcessor> create_fp_for_domain_and_filter(
                                                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 @@ sk_sp<GrFragmentProcessor> GrTextureAdjuster::createFragmentProcessor(
                                         const SkRect& origConstraintRect,
                                         FilterConstraint filterConstraint,
                                         bool coordsLimitedToConstraintRect,
-                                        const GrTextureParams::FilterMode* filterOrNullForBicubic,
+                                        const GrSamplerParams::FilterMode* filterOrNullForBicubic,
                                         SkColorSpace* dstColorSpace,
                                         SkDestinationSurfaceColorMode colorMode) {
 
@@ -384,7 +384,7 @@ sk_sp<GrFragmentProcessor> GrTextureAdjuster::createFragmentProcessor(
     }
 
     SkRect domain;
-    GrTextureParams params;
+    GrSamplerParams params;
     if (filterOrNullForBicubic) {
         params.setFilterMode(*filterOrNullForBicubic);
     }
@@ -410,8 +410,8 @@ sk_sp<GrFragmentProcessor> GrTextureAdjuster::createFragmentProcessor(
 
         // 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 @@ sk_sp<GrFragmentProcessor> GrTextureAdjuster::createFragmentProcessor(
 
 //////////////////////////////////////////////////////////////////////////////
 
-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 @@ sk_sp<GrFragmentProcessor> GrTextureMaker::createFragmentProcessor(
                                         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) {
index 1784ab6..bf3076e 100644 (file)
@@ -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 SkBitmap;
 class GrTextureProducer : public SkNoncopyable {
 public:
     struct CopyParams {
-        GrTextureParams::FilterMode fFilter;
+        GrSamplerParams::FilterMode fFilter;
         int                         fWidth;
         int                         fHeight;
     };
@@ -64,7 +64,7 @@ public:
                                     const SkRect& constraintRect,
                                     FilterConstraint filterConstraint,
                                     bool coordsLimitedToConstraintRect,
-                                    const GrTextureParams::FilterMode* filterOrNullForBicubic,
+                                    const GrSamplerParams::FilterMode* filterOrNullForBicubic,
                                     SkColorSpace* dstColorSpace,
                                     SkDestinationSurfaceColorMode) = 0;
 
@@ -131,7 +131,7 @@ public:
         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 @@ public:
                                 const SkRect& constraintRect,
                                 FilterConstraint,
                                 bool coordsLimitedToConstraintRect,
-                                const GrTextureParams::FilterMode* filterOrNullForBicubic,
+                                const GrSamplerParams::FilterMode* filterOrNullForBicubic,
                                 SkColorSpace* dstColorSpace,
                                 SkDestinationSurfaceColorMode) override;
 
@@ -180,14 +180,14 @@ public:
     /** 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;
 
index 8d6057e..d68eb79 100644 (file)
@@ -52,7 +52,7 @@ public:
     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;
index 16aa55b..ff6c707 100644 (file)
@@ -24,11 +24,11 @@ static bool convert_texture(GrTexture* src, GrRenderTargetContext* dst, int dstW
 
     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(
index 7f88790..82c7089 100644 (file)
@@ -747,7 +747,7 @@ static void determine_clipped_src_rect(int width, int height,
 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 @@ bool SkGpuDevice::shouldTileImage(const SkImage* image, const SkRect* srcRectPtr
         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 @@ void SkGpuDevice::drawBitmap(const SkDraw& origDraw,
         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 @@ void SkGpuDevice::drawBitmap(const SkDraw& origDraw,
 
         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 @@ void SkGpuDevice::drawTiledBitmap(const SkBitmap& bitmap,
                                   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 @@ void SkGpuDevice::drawTiledBitmap(const SkBitmap& bitmap,
             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 @@ void SkGpuDevice::drawTiledBitmap(const SkBitmap& bitmap,
             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 @@ void SkGpuDevice::drawBitmapTile(const SkBitmap& bitmap,
                                  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 @@ void SkGpuDevice::drawBitmapTile(const SkBitmap& bitmap,
                                              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 @@ void SkGpuDevice::drawSprite(const SkDraw& draw, const SkBitmap& bitmap,
 
         // 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 @@ void SkGpuDevice::drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap,
         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 @@ void SkGpuDevice::drawBitmapRect(const SkDraw& draw, const SkBitmap& bitmap,
 
         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<SkSpecialImage> SkGpuDevice::makeSpecial(const SkBitmap& bitmap) {
     }
 
     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 @@ void SkGpuDevice::drawProducerNine(const SkDraw& draw, GrTextureProducer* produc
     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 @@ void SkGpuDevice::drawProducerNine(const SkDraw& draw, GrTextureProducer* produc
         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 @@ void SkGpuDevice::drawProducerLattice(const SkDraw& draw, GrTextureProducer* pro
 
     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()),
index b81da4e..0985050 100644 (file)
@@ -169,7 +169,7 @@ private:
     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 @@ private:
                          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 @@ private:
                         const SkMatrix& viewMatrix,
                         const SkRect& dstRect,
                         const SkRect& srcRect,
-                        const GrTextureParams& params,
+                        const GrSamplerParams& params,
                         const SkPaint& paint,
                         SkCanvas::SrcRectConstraint,
                         bool bicubic,
index f232e19..74afca9 100644 (file)
@@ -163,10 +163,10 @@ void SkGpuDevice::drawTextureProducerImpl(GrTextureProducer* producer,
     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 @@ void SkGpuDevice::drawTextureProducerImpl(GrTextureProducer* producer,
     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);
index d74e259..f1a3caa 100644 (file)
@@ -424,13 +424,13 @@ GrTexture* GrUploadMipMapToTexture(GrContext* ctx, const SkImageInfo& info,
 }
 
 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 @@ bool SkPaintToGrPaintWithTexture(GrContext* context,
 
 ////////////////////////////////////////////////////////////////////////////////////////////////
 
-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 @@ GrTextureParams::FilterMode GrSkFilterQualityToGrFilterMode(SkFilterQuality pain
         }
         default:
             // Should be unreachable.  If not, fall back to mipmaps.
-            textureFilterMode = GrTextureParams::kMipMap_FilterMode;
+            textureFilterMode = GrSamplerParams::kMipMap_FilterMode;
             break;
 
     }
index bd1d715..bb41aad 100644 (file)
@@ -20,7 +20,6 @@ class GrRenderTargetContext;
 class GrFragmentProcessor;
 class GrPaint;
 class GrTexture;
-class GrTextureParams;
 class GrUniqueKey;
 class SkData;
 class SkPaint;
index bea604d..a9ef6cd 100644 (file)
@@ -193,7 +193,7 @@ private:
         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;
 
index e9bb7f4..fe5c3b9 100644 (file)
@@ -103,7 +103,7 @@ void GrAtlasTextBatch::onPrepareDraws(Target* target) const {
         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 @@ sk_sp<GrGeometryProcessor> GrAtlasTextBatch::setupDfProcessor(const SkMatrix& vi
                                                               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;
index 335ef16..4ea358e 100644 (file)
@@ -153,7 +153,7 @@ GrBicubicEffect::GrBicubicEffect(GrTexture* texture,
                                  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 @@ GrBicubicEffect::GrBicubicEffect(GrTexture* texture,
                                  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 @@ sk_sp<GrFragmentProcessor> GrBicubicEffect::TestCreate(GrProcessorTestData* d) {
 //////////////////////////////////////////////////////////////////////////////
 
 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 @@ bool GrBicubicEffect::ShouldUseBicubic(const SkMatrix& matrix,
     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;
 }
index 58bb068..61ce7eb 100644 (file)
@@ -93,7 +93,7 @@ public:
      * kNearest).
      */
     static bool ShouldUseBicubic(const SkMatrix& localCoordsToDevice,
-                                 GrTextureParams::FilterMode* filterMode);
+                                 GrSamplerParams::FilterMode* filterMode);
 
 private:
     GrBicubicEffect(GrTexture*, sk_sp<GrColorSpaceXform>, const SkScalar coefficients[16],
index 11c7982..76dc123 100644 (file)
@@ -125,7 +125,7 @@ private:
 ///////////////////////////////////////////////////////////////////////////////
 
 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 @@ GrGLSLPrimitiveProcessor* GrBitmapTextGeoProc::createGLSLInstance(const GrGLSLCa
 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 @@ sk_sp<GrGeometryProcessor> GrBitmapTextGeoProc::TestCreate(GrProcessorTestData*
         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)) {
index 7e2df0a..c8fc99b 100644 (file)
@@ -16,12 +16,12 @@ class GrInvariantOutput;
 
 /**
  * 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 @@ public:
     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;
index 8de6cd2..d5476d4 100644 (file)
@@ -230,7 +230,7 @@ private:
 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 @@ sk_sp<GrGeometryProcessor> GrDistanceFieldA8TextGeoProc::TestCreate(GrProcessorT
         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 @@ GrDistanceFieldPathGeoProc::GrDistanceFieldPathGeoProc(
         GrColor color,
         const SkMatrix& viewMatrix,
         GrTexture* texture,
-        const GrTextureParams& params,
+        const GrSamplerParams& params,
         uint32_t flags,
         bool usesLocalCoords)
     : fColor(color)
@@ -522,8 +522,8 @@ sk_sp<GrGeometryProcessor> GrDistanceFieldPathGeoProc::TestCreate(GrProcessorTes
         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 @@ private:
 
 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 @@ sk_sp<GrGeometryProcessor> GrDistanceFieldLCDTextGeoProc::TestCreate(GrProcessor
         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;
index 68e0a24..880c4e1 100644 (file)
@@ -43,14 +43,14 @@ enum GrDistanceFieldEffectFlags {
 /**
  * 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 @@ public:
     }
 #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 @@ public:
 
 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 @@ private:
 /**
 * 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 @@ public:
 
 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 @@ private:
 /**
  * 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 @@ public:
     };
 
     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 @@ public:
 
 private:
     GrDistanceFieldLCDTextGeoProc(GrColor, const SkMatrix& viewMatrix,
-                                  GrTexture* texture, const GrTextureParams& params,
+                                  GrTexture* texture, const GrSamplerParams& params,
                                   DistanceAdjust wa, uint32_t flags,
                                   bool usesLocalCoords);
 
index beb64d5..1c213a7 100644 (file)
@@ -81,8 +81,8 @@ sk_sp<GrFragmentProcessor> GrSimpleTextureEffect::TestCreate(GrProcessorTestData
         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);
index fced736..ccb590e 100644 (file)
@@ -14,7 +14,7 @@ class GrInvariantOutput;
 
 /**
  * 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 @@ public:
                                            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 @@ public:
     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 @@ private:
     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 @@ private:
     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>();
     }
index 929275e..425e367 100644 (file)
@@ -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,
 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,
 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)) {
index fd1ba98..716ad2f 100644 (file)
@@ -37,11 +37,11 @@ protected:
     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
index a05a793..51f3051 100644 (file)
@@ -176,7 +176,7 @@ sk_sp<GrFragmentProcessor> GrTextureDomainEffect::Make(GrTexture* texture,
                                                        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 @@ GrTextureDomainEffect::GrTextureDomainEffect(GrTexture* texture,
                                              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 @@ sk_sp<GrFragmentProcessor> GrTextureDomainEffect::TestCreate(GrProcessorTestData
         matrix,
         domain,
         mode,
-        bilerp ? GrTextureParams::kBilerp_FilterMode : GrTextureParams::kNone_FilterMode);
+        bilerp ? GrSamplerParams::kBilerp_FilterMode : GrSamplerParams::kNone_FilterMode);
 }
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -293,7 +293,7 @@ sk_sp<GrFragmentProcessor> GrDeviceSpaceTextureDecalFragmentProcessor::Make(GrTe
 
 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);
index d557d17..4c3cf22 100644 (file)
@@ -171,7 +171,7 @@ public:
                                            const SkMatrix&,
                                            const SkRect& domain,
                                            GrTextureDomain::Mode,
-                                           GrTextureParams::FilterMode filterMode);
+                                           GrSamplerParams::FilterMode filterMode);
 
     const char* name() const override { return "TextureDomain"; }
 
@@ -192,7 +192,7 @@ private:
                           const SkMatrix&,
                           const SkRect& domain,
                           GrTextureDomain::Mode,
-                          GrTextureParams::FilterMode);
+                          GrSamplerParams::FilterMode);
 
     GrGLSLFragmentProcessor* onCreateGLSLInstance() const override;
 
index 2fd3513..2978357 100644 (file)
@@ -78,13 +78,13 @@ public:
         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 @@ public:
 
 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)
index ad5fcf7..57376d7 100644 (file)
@@ -3175,7 +3175,7 @@ static void get_tex_param_swizzle(GrPixelConfig config,
     }
 }
 
-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 @@ void GrGLGpu::bindTexture(int unitIdx, const GrTextureParams& params, bool allow
         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 @@ void GrGLGpu::bindTexture(int unitIdx, const GrTextureParams& params, bool allow
 
 #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::bindTexelBuffer(int unitIdx, GrPixelConfig texelConfig, GrGLBuffer
     }
 }
 
-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 @@ bool GrGLGpu::copySurfaceAsDraw(GrSurface* dst,
     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 @@ bool GrGLGpu::generateMipmap(GrGLTexture* texture, bool gammaCorrect) {
     // 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 @@ GrGLAttribArrayState* GrGLGpu::HWVertexArrayState::bindInternalVertexArray(GrGLG
     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;
index da0eae0..dff342d 100644 (file)
@@ -57,12 +57,12 @@ public:
     }
 
     // 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 @@ private:
                            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
index 0174452..eb28e23 100644 (file)
@@ -30,18 +30,18 @@ static inline GrSLType sampler_type(const GrGLTexture::IDDesc& idDesc, GrPixelCo
     }
 }
 
-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.
index 636b650..6e96822 100644 (file)
@@ -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 @@ bool GrVkCopyManager::copySurfaceAsDraw(GrVkGpu* gpu,
     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());
index e94585f..9b70c0b 100644 (file)
@@ -437,9 +437,9 @@ static void prepare_sampled_images(const GrProcessor& processor, GrVkGpu* gpu) {
             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);
index 48228e0..2d53cd8 100644 (file)
@@ -310,7 +310,7 @@ void GrVkPipelineState::writeSamplers(
     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());
 
index 5cde9bc..81e1738 100644 (file)
@@ -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 @@ GrVkDescriptorPool* GrVkResourceProvider::findOrCreateCompatibleDescriptorPool(
     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) {
index 99724a6..024488a 100644 (file)
@@ -25,7 +25,7 @@
 
 class GrPipeline;
 class GrPrimitiveProcessor;
-class GrTextureParams;
+class GrSamplerParams;
 class GrVkCopyPipeline;
 class GrVkGpu;
 class GrVkPipeline;
@@ -97,9 +97,9 @@ public:
     //       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&,
index 799adc9..3901634 100644 (file)
@@ -22,7 +22,7 @@ static inline VkSamplerAddressMode tile_to_vk_sampler_address(SkShader::TileMode
     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 @@ GrVkSampler* GrVkSampler::Create(const GrVkGpu* gpu, const GrTextureParams& para
     // 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 @@ void GrVkSampler::freeGPUData(const GrVkGpu* gpu) const {
     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;
index 369b162..9630602 100644 (file)
 
 #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; }
index 3b6108c..7f0cf8d 100644 (file)
@@ -24,7 +24,7 @@ GrVkTexture::GrVkTexture(GrVkGpu* gpu,
                          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 @@ GrVkTexture::GrVkTexture(GrVkGpu* gpu,
                          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 @@ GrVkTexture::GrVkTexture(GrVkGpu* gpu,
                          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) {
index da7bb2f..a41b200 100644 (file)
@@ -207,10 +207,10 @@ sk_sp<GrFragmentProcessor> SkImageShader::asFragmentProcessor(const AsFPArgs& ar
     // 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;
index 7fbe97d..09ceb57 100644 (file)
@@ -18,7 +18,7 @@
 
 #include <new>
 
-class GrTextureParams;
+class GrSamplerParams;
 class SkImageCacherator;
 
 enum {
@@ -55,7 +55,7 @@ public:
     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;
index 03dda91..82f395f 100644 (file)
@@ -31,7 +31,7 @@ public:
     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 @@ bool SkImage_Generator::getROPixels(SkBitmap* bitmap, CachingHint chint) const {
     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);
 }
index c75e36b..84c7b10 100644 (file)
@@ -85,7 +85,7 @@ bool SkImage_Gpu::getROPixels(SkBitmap* dst, CachingHint chint) const {
     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 @@ sk_sp<SkImage> SkImage::MakeFromNV12TexturesCopy(GrContext* ctx, SkYUVColorSpace
 
 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;
index 13c1e30..19e2944 100644 (file)
@@ -39,7 +39,7 @@ public:
     }
 
     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;
 
index be86a2a..a2b12e4 100644 (file)
@@ -89,7 +89,7 @@ public:
 
     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 @@ bool SkImage_Raster::getROPixels(SkBitmap* dst, CachingHint) const {
     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 @@ bool SkImage_Raster::onPinAsTexture(GrContext* ctx) const {
         SkASSERT(fPinnedCount == 0);
         SkASSERT(fPinnedUniqueID == 0);
         fPinnedTexture.reset(
-            GrRefCachedBitmapTexture(ctx, fBitmap, GrTextureParams::ClampNoFilter(),
+            GrRefCachedBitmapTexture(ctx, fBitmap, GrSamplerParams::ClampNoFilter(),
                                      SkDestinationSurfaceColorMode::kGammaAndColorSpaceAware));
         if (!fPinnedTexture) {
             return false;
index 15494fe..a6eaf98 100644 (file)
@@ -188,9 +188,9 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(IntTexture, reporter, ctxInfo) {
     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,
index 21540d9..cc0c4d1 100644 (file)
@@ -98,9 +98,9 @@ static void test_basic_draw(skiatest::Reporter* reporter, GrContext* context,
                                              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));
index 4261796..a875c5c 100644 (file)
@@ -130,7 +130,7 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SRGBMipMaps, reporter, ctxInfo) {
     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)