Disable unpack-row-length support on iOS

This is a workaround for a suspected driver bug, where the driver appears to
blindly copy rowBytes * height bytes, which leads to running off the end of
the source buffer.

Should fix https://github.com/flutter/flutter/issues/16718

Change-Id: I8ee41429ae97b669e2990752a82f806c4469a8ad
Reviewed-on: https://skia-review.googlesource.com/125729
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
This commit is contained in:
Brian Osman 2018-05-03 15:05:12 -04:00 committed by Skia Commit-Bot
parent c6683137e1
commit 2fa5374a53

View File

@ -2661,6 +2661,15 @@ void GrGLCaps::applyDriverCorrectnessWorkarounds(const GrGLContextInfo& ctxInfo,
shaderCaps->fExternalTextureExtensionString = "GL_OES_EGL_image_external";
shaderCaps->fSecondExternalTextureExtensionString = "GL_OES_EGL_image_external_essl3";
}
#ifdef SK_BUILD_FOR_IOS
// iOS drivers appear to implement TexSubImage by creating a staging buffer, and copying
// UNPACK_ROW_LENGTH * height bytes. That's unsafe in several scenarios, and the simplest fix
// is to just blacklist the feature.
// https://github.com/flutter/flutter/issues/16718
// https://bugreport.apple.com/web/?problemID=39948888
fUnpackRowLengthSupport = false;
#endif
}
void GrGLCaps::onApplyOptionsOverrides(const GrContextOptions& options) {