aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/DDLPromiseImageHelper.cpp8
-rw-r--r--tools/DDLPromiseImageHelper.h2
2 files changed, 9 insertions, 1 deletions
diff --git a/tools/DDLPromiseImageHelper.cpp b/tools/DDLPromiseImageHelper.cpp
index 586c2339a6..cc543f9d40 100644
--- a/tools/DDLPromiseImageHelper.cpp
+++ b/tools/DDLPromiseImageHelper.cpp
@@ -20,6 +20,10 @@ DDLPromiseImageHelper::PromiseImageCallbackContext::~PromiseImageCallbackContext
}
}
+const GrCaps* DDLPromiseImageHelper::PromiseImageCallbackContext::caps() const {
+ return fContext->contextPriv().caps();
+}
+
///////////////////////////////////////////////////////////////////////////////////////////////////
sk_sp<SkData> DDLPromiseImageHelper::deflateSKP(const SkPicture* inputPicture) {
@@ -104,7 +108,9 @@ sk_sp<SkImage> DDLPromiseImageHelper::PromiseImageCreator(const void* rawData,
}
SkASSERT(curImage.fIndex == *indexPtr);
- GrBackendFormat backendFormat = curImage.fCallbackContext->backendTexture().format();
+ const GrCaps* caps = curImage.fCallbackContext->caps();
+ const GrBackendTexture& backendTex = curImage.fCallbackContext->backendTexture();
+ GrBackendFormat backendFormat = caps->createFormatFromBackendTexture(backendTex);
// Each DDL recorder gets its own ref on the promise callback context for the
// promise images it creates.
diff --git a/tools/DDLPromiseImageHelper.h b/tools/DDLPromiseImageHelper.h
index 5bc97afc34..e9520b2d48 100644
--- a/tools/DDLPromiseImageHelper.h
+++ b/tools/DDLPromiseImageHelper.h
@@ -77,6 +77,8 @@ private:
const GrBackendTexture& backendTexture() const { return fBackendTexture; }
+ const GrCaps* caps() const;
+
private:
GrContext* fContext;
GrBackendTexture fBackendTexture;