@@ -428,24 +428,6 @@ sk_sp<GrTextureProxy> GrProxyProvider::createProxyFromBitmap(const SkBitmap& bit
428428 return proxy;
429429}
430430
431- #ifdef SK_DEBUG
432- static bool validate_backend_format_and_config (const GrCaps* caps,
433- const GrBackendFormat& format,
434- GrPixelConfig config) {
435- if (kUnknown_GrPixelConfig == config) {
436- return false ;
437- }
438- if (GrPixelConfigIsCompressed (config)) {
439- // We have no way to verify these at the moment.
440- return true ;
441- }
442-
443- GrColorType grCT = GrPixelConfigToColorType (config);
444-
445- return caps->areColorTypeAndFormatCompatible (grCT, format);
446- }
447- #endif
448-
449431sk_sp<GrTextureProxy> GrProxyProvider::createProxy (const GrBackendFormat& format,
450432 const GrSurfaceDesc& desc,
451433 GrRenderable renderable,
@@ -468,11 +450,6 @@ sk_sp<GrTextureProxy> GrProxyProvider::createProxy(const GrBackendFormat& format
468450
469451 SkASSERT (GrCaps::AreConfigsCompatible (desc.fConfig ,
470452 caps->getConfigFromBackendFormat (format, colorType)));
471- // TODO: This check should be removed once we get the swizzle outside of GrProxyProvider and
472- // either pass them to the proxy or store the on some view object.
473- if (!caps->areColorTypeAndFormatCompatible (colorType, format)) {
474- return nullptr ;
475- }
476453
477454 if (GrMipMapped::kYes == mipMapped) {
478455 // SkMipMap doesn't include the base level in the level count so we have to add 1
@@ -570,8 +547,6 @@ sk_sp<GrTextureProxy> GrProxyProvider::wrapBackendTexture(const GrBackendTexture
570547
571548 const GrCaps* caps = this ->caps ();
572549
573- SkASSERT (caps->areColorTypeAndFormatCompatible (grColorType, backendTex.getBackendFormat ()));
574-
575550 GrResourceProvider* resourceProvider = direct->priv ().resourceProvider ();
576551
577552 sk_sp<GrTexture> tex =
@@ -611,8 +586,6 @@ sk_sp<GrTextureProxy> GrProxyProvider::wrapRenderableBackendTexture(
611586
612587 const GrCaps* caps = this ->caps ();
613588
614- SkASSERT (caps->areColorTypeAndFormatCompatible (colorType, backendTex.getBackendFormat ()));
615-
616589 GrResourceProvider* resourceProvider = direct->priv ().resourceProvider ();
617590
618591 // TODO: This should have been checked and validated before getting into GrProxyProvider.
@@ -660,8 +633,6 @@ sk_sp<GrSurfaceProxy> GrProxyProvider::wrapBackendRenderTarget(
660633
661634 const GrCaps* caps = this ->caps ();
662635
663- SkASSERT (caps->areColorTypeAndFormatCompatible (grColorType, backendRT.getBackendFormat ()));
664-
665636 GrResourceProvider* resourceProvider = direct->priv ().resourceProvider ();
666637
667638 sk_sp<GrRenderTarget> rt = resourceProvider->wrapBackendRenderTarget (backendRT, grColorType);
@@ -700,8 +671,6 @@ sk_sp<GrSurfaceProxy> GrProxyProvider::wrapBackendTextureAsRenderTarget(
700671
701672 const GrCaps* caps = this ->caps ();
702673
703- SkASSERT (caps->areColorTypeAndFormatCompatible (grColorType, backendTex.getBackendFormat ()));
704-
705674 GrResourceProvider* resourceProvider = direct->priv ().resourceProvider ();
706675
707676 sk_sp<GrRenderTarget> rt =
@@ -786,8 +755,6 @@ sk_sp<GrTextureProxy> GrProxyProvider::createLazyProxy(LazyInstantiateCallback&&
786755 return nullptr ;
787756 }
788757
789- SkASSERT (validate_backend_format_and_config (this ->caps (), format, desc.fConfig ));
790-
791758 GrColorType colorType = GrPixelConfigToColorType (desc.fConfig );
792759 GrSwizzle texSwizzle = this ->caps ()->getTextureSwizzle (format, colorType);
793760 GrSwizzle outSwizzle = this ->caps ()->getOutputSwizzle (format, colorType);
@@ -846,8 +813,6 @@ sk_sp<GrRenderTargetProxy> GrProxyProvider::createLazyRenderTargetProxy(
846813 return nullptr ;
847814 }
848815
849- SkASSERT (validate_backend_format_and_config (this ->caps (), format, desc.fConfig ));
850-
851816 GrColorType colorType = GrPixelConfigToColorType (desc.fConfig );
852817 GrSwizzle texSwizzle = this ->caps ()->getTextureSwizzle (format, colorType);
853818 GrSwizzle outSwizzle = this ->caps ()->getOutputSwizzle (format, colorType);
@@ -885,7 +850,6 @@ sk_sp<GrTextureProxy> GrProxyProvider::MakeFullyLazyProxy(LazyInstantiateCallbac
885850 }
886851
887852 SkASSERT (renderTargetSampleCnt == 1 || renderable == GrRenderable::kYes );
888- SkASSERT (validate_backend_format_and_config (&caps, format, config));
889853 GrSurfaceDesc desc;
890854 GrInternalSurfaceFlags surfaceFlags = GrInternalSurfaceFlags::kNone ;
891855 desc.fWidth = -1 ;
0 commit comments