Simplify view getters on GrTextureProducer.
The only thing that affects the view returned is whether it ought to
be MIP mapped or not. So don't take a whole GrSamplerState.
The view() function won't ever change the colortype so just query
GrTextureProducer rather than having view() return a tuple.
The rest is transitively reaching through callers and callees of
GrTextureProducer::view() to only pass filter or GrMipMapped instead of
GrSamplerState. Also, some params that indicate whether MIPs are
requested are changed from bool to GrMipMapped. And some minor style
stuff (mainly de-yoda-ifying GrMipMapped checks, using
GrSurfaceProxyView operator bool()).
Change-Id: Ia184aa793cf51d42642ea3bb0521ce06da2efb10
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/274205
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrTextureMaker.h b/src/gpu/GrTextureMaker.h
index 20352f6..872a5d4 100644
--- a/src/gpu/GrTextureMaker.h
+++ b/src/gpu/GrTextureMaker.h
@@ -31,13 +31,10 @@
/**
* Return the maker's "original" texture. It is the responsibility of the maker to handle any
* caching of the original if desired.
- * If "genType" argument equals AllowedTexGenType::kCheap and the texture is not trivial to
- * construct then refOriginalTextureProxy should return nullptr (for example if texture is made
- * by drawing into a render target).
*/
- virtual GrSurfaceProxyView refOriginalTextureProxyView(bool willBeMipped) = 0;
+ virtual GrSurfaceProxyView refOriginalTextureProxyView(GrMipMapped) = 0;
- GrSurfaceProxyView onRefTextureProxyViewForParams(GrSamplerState, bool willBeMipped) final;
+ GrSurfaceProxyView onView(GrMipMapped) final;
typedef GrTextureProducer INHERITED;
};