diff --git a/src/core/SkDeferredDisplayListRecorder.cpp b/src/core/SkDeferredDisplayListRecorder.cpp index a3f32214e8..bf8e1f8f03 100644 --- a/src/core/SkDeferredDisplayListRecorder.cpp +++ b/src/core/SkDeferredDisplayListRecorder.cpp @@ -179,7 +179,6 @@ bool SkDeferredDisplayListRecorder::init() { GrSwizzle outputSwizzle = caps->getOutputSwizzle(fCharacterization.backendFormat(), grColorType); - SkASSERT(readSwizzle == proxy->textureSwizzle()); GrSurfaceProxyView readView(proxy, fCharacterization.origin(), readSwizzle); GrSurfaceProxyView outputView(std::move(proxy), fCharacterization.origin(), outputSwizzle); diff --git a/src/gpu/GrFragmentProcessor.cpp b/src/gpu/GrFragmentProcessor.cpp index 57c4aecd4c..907cbf7a47 100644 --- a/src/gpu/GrFragmentProcessor.cpp +++ b/src/gpu/GrFragmentProcessor.cpp @@ -431,20 +431,6 @@ GrFragmentProcessor::TextureSampler::TextureSampler(GrSurfaceProxyView view, GrTextureProxy::HighestFilterMode(proxy->backendFormat().textureType()))); } -GrFragmentProcessor::TextureSampler::TextureSampler(sk_sp<GrSurfaceProxy> proxy, - GrSamplerState samplerState) { - SkASSERT(proxy->asTextureProxy()); - GrSurfaceOrigin origin = proxy->origin(); - GrSwizzle swizzle = proxy->textureSwizzle(); - fView = GrSurfaceProxyView(std::move(proxy), origin, swizzle); - - fSamplerState = samplerState; - GrSurfaceProxy* surfProxy = this->proxy(); - fSamplerState.setFilterMode( - std::min(samplerState.filter(), - GrTextureProxy::HighestFilterMode(surfProxy->backendFormat().textureType()))); -} - #if GR_TEST_UTILS void GrFragmentProcessor::TextureSampler::set(GrSurfaceProxyView view, GrSamplerState samplerState) { diff --git a/src/gpu/GrFragmentProcessor.h b/src/gpu/GrFragmentProcessor.h index 8d8afbbf17..0b927f840e 100644 --- a/src/gpu/GrFragmentProcessor.h +++ b/src/gpu/GrFragmentProcessor.h @@ -485,8 +485,6 @@ public: explicit TextureSampler(const TextureSampler&) = default; TextureSampler(GrSurfaceProxyView, GrSamplerState = {}); - // TODO: Remove this ctor once all uses have been updated to pass in a GrSurfaceProxyView - TextureSampler(sk_sp<GrSurfaceProxy>, GrSamplerState = {}); TextureSampler& operator=(const TextureSampler&) = delete; diff --git a/src/gpu/GrProxyProvider.cpp b/src/gpu/GrProxyProvider.cpp index e6bf834968..ee301f95ae 100644 --- a/src/gpu/GrProxyProvider.cpp +++ b/src/gpu/GrProxyProvider.cpp @@ -242,7 +242,7 @@ sk_sp<GrTextureProxy> GrProxyProvider::findOrCreateProxyByUniqueKey(const GrUniq SkASSERT(result->getUniqueKey() == key); // createWrapped should've added this for us SkASSERT(fUniquelyKeyedProxies.find(key)); - SkASSERT(result->textureSwizzle() == + SkASSERT(result->textureSwizzleDoNotUse() == this->caps()->getReadSwizzle(result->backendFormat(), colorType)); return result; } diff --git a/src/gpu/GrSurfaceContext.cpp b/src/gpu/GrSurfaceContext.cpp index bfb03449e3..5c4e04a21a 100644 --- a/src/gpu/GrSurfaceContext.cpp +++ b/src/gpu/GrSurfaceContext.cpp @@ -385,7 +385,6 @@ bool GrSurfaceContext::writePixels(const GrImageInfo& origSrcInfo, const void* s if (!tempProxy) { return false; } - SkASSERT(tempProxy->textureSwizzle() == tempReadSwizzle); GrSurfaceProxyView tempView(tempProxy, tempOrigin, tempReadSwizzle); GrSurfaceContext tempCtx(direct, tempView, colorType, alphaType, this->colorInfo().refColorSpace()); diff --git a/src/gpu/GrSurfaceProxy.h b/src/gpu/GrSurfaceProxy.h index 99cc1811e5..5ee5ba8c11 100644 --- a/src/gpu/GrSurfaceProxy.h +++ b/src/gpu/GrSurfaceProxy.h @@ -138,7 +138,9 @@ public: return fOrigin; } - const GrSwizzle& textureSwizzle() const { return fTextureSwizzle; } + // Do not call this. It will shortly be removed and is just needed for a couple cases where we + // are getting a proxy from the cache and cannot be certain what the GrColorType of the proxy. + const GrSwizzle& textureSwizzleDoNotUse() const { return fTextureSwizzle; } const GrBackendFormat& backendFormat() const { return fFormat; } diff --git a/src/gpu/GrTextureAdjuster.cpp b/src/gpu/GrTextureAdjuster.cpp index 6d667ba133..d6bead78c6 100644 --- a/src/gpu/GrTextureAdjuster.cpp +++ b/src/gpu/GrTextureAdjuster.cpp @@ -47,7 +47,7 @@ GrSurfaceProxyView GrTextureAdjuster::copy(const CopyParams& copyParams, bool wi if (cachedCopy && (!willBeMipped || GrMipMapped::kYes == cachedCopy->mipMapped())) { // TODO: Once we no longer use CopyOnGpu which can fallback to arbitrary formats and // colorTypes, we can use the swizzle of the originalView. - GrSwizzle swizzle = cachedCopy->textureSwizzle(); + GrSwizzle swizzle = cachedCopy->textureSwizzleDoNotUse(); return GrSurfaceProxyView(std::move(cachedCopy), originalView.origin(), swizzle); } } diff --git a/src/gpu/GrTextureMaker.cpp b/src/gpu/GrTextureMaker.cpp index b51ef56fb6..22751792d4 100644 --- a/src/gpu/GrTextureMaker.cpp +++ b/src/gpu/GrTextureMaker.cpp @@ -62,7 +62,7 @@ GrSurfaceProxyView GrTextureMaker::onRefTextureProxyViewForParams(GrSamplerState GrMipMapped mipped = cachedProxy->mipMapped(); // TODO: Once we no longer use CopyOnGpu which can fallback to arbitrary formats and // colorTypes, we can use the swizzle of the originalView. - GrSwizzle swizzle = cachedProxy->textureSwizzle(); + GrSwizzle swizzle = cachedProxy->textureSwizzleDoNotUse(); cachedView = GrSurfaceProxyView(std::move(cachedProxy), origOrigin, swizzle); if (!willBeMipped || GrMipMapped::kYes == mipped) { return cachedView; diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp index 078ae3488e..18728a449c 100644 --- a/src/image/SkImage_Gpu.cpp +++ b/src/image/SkImage_Gpu.cpp @@ -250,7 +250,6 @@ sk_sp<SkImage> SkImage::MakeTextureFromCompressed(GrContext* context, sk_sp<SkDa } // TODO: remove asserts when proxy doesn't hold origin or swizzle SkASSERT(proxy->origin() == kTopLeft_GrSurfaceOrigin); - SkASSERT(proxy->textureSwizzle() == GrSwizzle()); GrSurfaceProxyView view(std::move(proxy)); SkColorType colorType = GrCompressionTypeToSkColorType(type); diff --git a/src/image/SkSurface_GpuMtl.mm b/src/image/SkSurface_GpuMtl.mm index 53786fa7df..d42fa5464b 100644 --- a/src/image/SkSurface_GpuMtl.mm +++ b/src/image/SkSurface_GpuMtl.mm @@ -92,8 +92,6 @@ sk_sp<SkSurface> SkSurface::MakeFromCAMetalLayer(GrContext* context, GrSwizzle outputSwizzle = caps->getOutputSwizzle(backendFormat, grColorType); - SkASSERT(readSwizzle == proxy->textureSwizzle()); - GrSurfaceProxyView readView(proxy, origin, readSwizzle); GrSurfaceProxyView outputView(std::move(proxy), origin, outputSwizzle); @@ -167,8 +165,6 @@ sk_sp<SkSurface> SkSurface::MakeFromMTKView(GrContext* context, GrSwizzle outputSwizzle = caps->getOutputSwizzle(backendFormat, grColorType); - SkASSERT(readSwizzle == proxy->textureSwizzle()); - GrSurfaceProxyView readView(proxy, origin, readSwizzle); GrSurfaceProxyView outputView(std::move(proxy), origin, outputSwizzle);