Revise GrDataUtils to be more self-contained (take 3)
This makes the GL and Vk backends share more code and sets up for the Metal implementation.
Change-Id: I781d5b6188fb2d46ae4ec48204fda74fe28b18c0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/218964
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/gl/GrGLUtil.cpp b/src/gpu/gl/GrGLUtil.cpp
index 8f67be7..f50932e 100644
--- a/src/gpu/gl/GrGLUtil.cpp
+++ b/src/gpu/gl/GrGLUtil.cpp
@@ -573,6 +573,18 @@
return false;
}
+GrCompression GrGLFormat2Compression(GrGLenum glFormat) {
+ switch (glFormat) {
+ case GR_GL_COMPRESSED_RGB8_ETC2: // fall through
+ case GR_GL_COMPRESSED_ETC1_RGB8:
+ return GrCompression::kETC1;
+ default:
+ return GrCompression::kNone;
+ }
+ SK_ABORT("Invalid format");
+ return GrCompression::kNone;
+}
+
size_t GrGLFormatCompressedDataSize(GrGLenum glFormat, int width, int height) {
SkASSERT(GrGLFormatIsCompressed(glFormat));