rename makeCopyForTextureParams to isACopyNeededForTextureParams
authorRobert Phillips <robertphillips@google.com>
Tue, 21 Mar 2017 13:14:35 +0000 (09:14 -0400)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Tue, 21 Mar 2017 13:50:17 +0000 (13:50 +0000)
I thought the old name was misleading

split out of: https://skia-review.googlesource.com/c/8823/ (Remove GrFragmentProcessor-derived class' GrTexture-based ctors)

Change-Id: I8c5fc6de487b50c9ec37843ff7501b52140dde00
Reviewed-on: https://skia-review.googlesource.com/9961
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>

src/gpu/GrGpu.cpp
src/gpu/GrGpu.h
src/gpu/GrTextureAdjuster.cpp
src/gpu/GrTextureMaker.cpp
src/gpu/gl/GrGLGpu.cpp
src/gpu/gl/GrGLGpu.h

index 298e002..40988c3 100644 (file)
@@ -57,9 +57,10 @@ void GrGpu::disconnect(DisconnectType) {}
 
 ////////////////////////////////////////////////////////////////////////////////
 
-bool GrGpu::makeCopyForTextureParams(int width, int height, const GrSamplerParams& textureParams,
-                                     GrTextureProducer::CopyParams* copyParams,
-                                     SkScalar scaleAdjust[2]) const {
+bool GrGpu::isACopyNeededForTextureParams(int width, int height,
+                                          const GrSamplerParams& textureParams,
+                                          GrTextureProducer::CopyParams* copyParams,
+                                          SkScalar scaleAdjust[2]) const {
     const GrCaps& caps = *this->caps();
     if (textureParams.isTiled() && !caps.npotTextureTileSupport() &&
         (!SkIsPow2(width) || !SkIsPow2(height))) {
index 128b139..1e28345 100644 (file)
@@ -473,21 +473,22 @@ public:
     // Determines whether a texture will need to be rescaled in order to be used with the
     // GrSamplerParams. This variation is called when the caller will create a new texture using the
     // resource provider from a non-texture src (cpu-backed image, ...).
-    bool makeCopyForTextureParams(int width, int height, const GrSamplerParams&,
-                                 GrTextureProducer::CopyParams*, SkScalar scaleAdjust[2]) const;
+    bool isACopyNeededForTextureParams(int width, int height, const GrSamplerParams&,
+                                       GrTextureProducer::CopyParams*,
+                                       SkScalar scaleAdjust[2]) 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
     // GrResourceProvider::wrap methods.
-    bool makeCopyForTextureParams(GrTexture* texture, const GrSamplerParams& params,
-                                  GrTextureProducer::CopyParams* copyParams,
-                                  SkScalar scaleAdjust[2]) const {
-        if (this->makeCopyForTextureParams(texture->width(), texture->height(), params,
-                                           copyParams, scaleAdjust)) {
+    bool isACopyNeededForTextureParams(GrTexture* texture, const GrSamplerParams& params,
+                                       GrTextureProducer::CopyParams* copyParams,
+                                       SkScalar scaleAdjust[2]) const {
+        if (this->isACopyNeededForTextureParams(texture->width(), texture->height(), params,
+                                                copyParams, scaleAdjust)) {
             return true;
         }
-        return this->onMakeCopyForTextureParams(texture, params, copyParams, scaleAdjust);
+        return this->onIsACopyNeededForTextureParams(texture, params, copyParams, scaleAdjust);
     }
 
     // This is only to be used in GL-specific tests.
@@ -549,9 +550,11 @@ private:
 
     virtual gr_instanced::InstancedRendering* onCreateInstancedRendering() = 0;
 
-    virtual bool onMakeCopyForTextureParams(GrTexture* texture, const GrSamplerParams&,
-                                            GrTextureProducer::CopyParams*,
-                                            SkScalar scaleAdjust[2]) const { return false; }
+    virtual bool onIsACopyNeededForTextureParams(GrTexture* texture, const GrSamplerParams&,
+                                                 GrTextureProducer::CopyParams*,
+                                                 SkScalar scaleAdjust[2]) const {
+        return false;
+    }
 
     virtual bool onGetReadPixelsInfo(GrSurface* srcSurface, int readWidth, int readHeight,
                                      size_t rowBytes, GrPixelConfig readConfig, DrawPreference*,
index a85100a..5dc7148 100644 (file)
@@ -110,8 +110,8 @@ GrTexture* GrTextureAdjuster::refTextureSafeForParams(const GrSamplerParams& par
         copyParams.fWidth = contentArea->width();
         copyParams.fHeight = contentArea->height();
         copyParams.fFilter = GrSamplerParams::kBilerp_FilterMode;
-    } else if (!fContext->getGpu()->makeCopyForTextureParams(texture, params, &copyParams,
-                                                             scaleAdjust)) {
+    } else if (!fContext->getGpu()->isACopyNeededForTextureParams(texture, params, &copyParams,
+                                                                  scaleAdjust)) {
         if (outOffset) {
             if (contentArea) {
                 outOffset->set(contentArea->fLeft, contentArea->fRight);
index bd0840b..06a8f27 100644 (file)
@@ -26,8 +26,8 @@ GrTexture* GrTextureMaker::refTextureForParams(const GrSamplerParams& params,
         *texColorSpace = this->getColorSpace(dstColorSpace);
     }
 
-    if (!fContext->getGpu()->makeCopyForTextureParams(this->width(), this->height(), params,
-                                                      &copyParams, scaleAdjust)) {
+    if (!fContext->getGpu()->isACopyNeededForTextureParams(this->width(), this->height(), params,
+                                                           &copyParams, scaleAdjust)) {
         return this->refOriginalTexture(willBeMipped, dstColorSpace);
     }
     GrUniqueKey copyKey;
index b24f197..f7b32c2 100644 (file)
@@ -4421,9 +4421,10 @@ GrGLAttribArrayState* GrGLGpu::HWVertexArrayState::bindInternalVertexArray(GrGLG
     return attribState;
 }
 
-bool GrGLGpu::onMakeCopyForTextureParams(GrTexture* texture, const GrSamplerParams& textureParams,
-                                         GrTextureProducer::CopyParams* copyParams,
-                                         SkScalar scaleAdjust[2]) const {
+bool GrGLGpu::onIsACopyNeededForTextureParams(GrTexture* texture,
+                                              const GrSamplerParams& textureParams,
+                                              GrTextureProducer::CopyParams* copyParams,
+                                              SkScalar scaleAdjust[2]) const {
     if (textureParams.isTiled() ||
         GrSamplerParams::kMipMap_FilterMode == textureParams.filterMode()) {
         GrGLTexture* glTexture = static_cast<GrGLTexture*>(texture);
index fa42533..6e0d900 100644 (file)
@@ -189,9 +189,9 @@ private:
                            bool renderTarget, GrGLTexture::TexParams* initialTexParams,
                            const SkTArray<GrMipLevel>& texels);
 
-    bool onMakeCopyForTextureParams(GrTexture*, const GrSamplerParams&,
-                                    GrTextureProducer::CopyParams*,
-                                    SkScalar scaleAdjust[2]) const override;
+    bool onIsACopyNeededForTextureParams(GrTexture*, const GrSamplerParams&,
+                                         GrTextureProducer::CopyParams*,
+                                         SkScalar scaleAdjust[2]) const override;
 
     // Checks whether glReadPixels can be called to get pixel values in readConfig from the
     // render target.