aboutsummaryrefslogtreecommitdiffhomepage
path: root/dm/DMSrcSink.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2018-03-15 11:15:19 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-03-15 16:51:36 +0000
commit7f4419696b8ef299a321561336c0353a5a7d8e61 (patch)
treecc3a3ece311892099a8730b7e65b4e283442d598 /dm/DMSrcSink.cpp
parent4f4a53f94852f801d89d8e22c4511d34fa6907e2 (diff)
Make CreateBackendFormatFromTexture shared code
TBR=bsalomon@google.com Change-Id: I19e6e6c8dc32ba584738545d443de092e4987a5a Reviewed-on: https://skia-review.googlesource.com/114374 Reviewed-by: Robert Phillips <robertphillips@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'dm/DMSrcSink.cpp')
-rw-r--r--dm/DMSrcSink.cpp27
1 files changed, 1 insertions, 26 deletions
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index 7256348632..9b68dc99cf 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -1254,31 +1254,6 @@ public:
SkDeferredDisplayListRecorder* fRecorder;
};
-// duplicate of method in GrTest.cpp
-GrBackendFormat CreateBackendFormatFromTexture(const GrBackendTexture& tex) {
- switch (tex.backend()) {
-#ifdef SK_VULKAN
- case kVulkan_GrBackend: {
- const GrVkImageInfo* vkInfo = tex.getVkImageInfo();
- SkASSERT(vkInfo);
- return GrBackendFormat::MakeVk(vkInfo->fFormat);
- }
-#endif
- case kOpenGL_GrBackend: {
- const GrGLTextureInfo* glInfo = tex.getGLTextureInfo();
- SkASSERT(glInfo);
- return GrBackendFormat::MakeGL(glInfo->fFormat, glInfo->fTarget);
- }
- case kMock_GrBackend: {
- const GrMockTextureInfo* mockInfo = tex.getMockTextureInfo();
- SkASSERT(mockInfo);
- return GrBackendFormat::MakeMock(mockInfo->fConfig);
- }
- default:
- return GrBackendFormat();
- }
-}
-
// This generates promise images to replace the indices in the compressed picture. This
// reconstitution is performed separately in each thread so we end of with multiple
// promise image referring to the same GrBackendTexture.
@@ -1295,7 +1270,7 @@ static sk_sp<SkImage> promise_image_creator(const void* rawData, size_t length,
const PromiseImageInfo& curImage = (*imageInfo)[*indexPtr];
SkASSERT(curImage.fIndex == *indexPtr);
- GrBackendFormat backendFormat = CreateBackendFormatFromTexture(curImage.fBackendTexture);
+ GrBackendFormat backendFormat = curImage.fBackendTexture.format();
// DDL TODO: sort out mipmapping
sk_sp<SkImage> image = recorder->makePromiseTexture(backendFormat,