Fix ETC1 support on iOS.
iOS doesn't support the ETC1 GL format, but does support ETC2 which has ETC1 support as well. We should probably default to ETC2 in any case. Change-Id: Ifd34fc602a1227f76316a8e27cf5555605c66840 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/241045 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
This commit is contained in:
parent
f19510e320
commit
c13030169f
@ -4078,6 +4078,10 @@ GrBackendFormat GrGLCaps::getBackendFormatFromCompressionType(
|
|||||||
SkImage::CompressionType compressionType) const {
|
SkImage::CompressionType compressionType) const {
|
||||||
switch (compressionType) {
|
switch (compressionType) {
|
||||||
case SkImage::kETC1_CompressionType:
|
case SkImage::kETC1_CompressionType:
|
||||||
|
// if ETC2 is available default to that format
|
||||||
|
if (this->isFormatTexturable(GrGLFormat::kCOMPRESSED_RGB8_ETC2)) {
|
||||||
|
return GrBackendFormat::MakeGL(GR_GL_COMPRESSED_RGB8_ETC2, GR_GL_TEXTURE_2D);
|
||||||
|
}
|
||||||
return GrBackendFormat::MakeGL(GR_GL_COMPRESSED_ETC1_RGB8, GR_GL_TEXTURE_2D);
|
return GrBackendFormat::MakeGL(GR_GL_COMPRESSED_ETC1_RGB8, GR_GL_TEXTURE_2D);
|
||||||
}
|
}
|
||||||
SK_ABORT("Invalid compression type");
|
SK_ABORT("Invalid compression type");
|
||||||
|
Loading…
Reference in New Issue
Block a user