Make compressedBackendFormat accessible from GrContextThreadSafeProxy
Not having this available on GrContextThreadSafeProxy was an oversight.
This will allow Chrome to correctly prepare the correct type of compressed promise image.
Change-Id: I3002609fef00a130fe409f318ae0f442ef7591d6
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/437016
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrContextThreadSafeProxy.cpp b/src/gpu/GrContextThreadSafeProxy.cpp
index 2c3a221..cbdcaa0 100644
--- a/src/gpu/GrContextThreadSafeProxy.cpp
+++ b/src/gpu/GrContextThreadSafeProxy.cpp
@@ -153,6 +153,15 @@
return format;
}
+GrBackendFormat GrContextThreadSafeProxy::compressedBackendFormat(SkImage::CompressionType c) const {
+ SkASSERT(fCaps);
+
+ GrBackendFormat format = fCaps->getBackendFormatFromCompressionType(c);
+
+ SkASSERT(!format.isValid() || fCaps->isFormatTexturable(format));
+ return format;
+}
+
void GrContextThreadSafeProxy::abandonContext() {
if (!fAbandoned.exchange(true)) {
fTextBlobCache->freeAll();
diff --git a/src/gpu/GrContext_Base.cpp b/src/gpu/GrContext_Base.cpp
index fd99704..50144c7 100644
--- a/src/gpu/GrContext_Base.cpp
+++ b/src/gpu/GrContext_Base.cpp
@@ -41,12 +41,7 @@
}
GrBackendFormat GrContext_Base::compressedBackendFormat(SkImage::CompressionType c) const {
- const GrCaps* caps = this->caps();
-
- GrBackendFormat format = caps->getBackendFormatFromCompressionType(c);
-
- SkASSERT(!format.isValid() || caps->isFormatTexturable(format));
- return format;
+ return fThreadSafeProxy->compressedBackendFormat(c);
}
sk_sp<GrContextThreadSafeProxy> GrContext_Base::threadSafeProxy() { return fThreadSafeProxy; }