未验证 提交 5ab81fda 编写于 作者: B Brian Osman 提交者: GitHub

Set fPreferExternalImagesOverES3 option in Skia (#5331)

This causes Skia to fall back to the ES2 shading language when the GL
driver doesn't clearly communicate that it supports the ES3 external
image extension. Doing so ensures that video playback (which relies on
external images) works on many more devices.
上级 eb4d8235
......@@ -23,6 +23,10 @@ sk_sp<GrContext> IOManager::CreateCompatibleResourceLoadingContext(
// that feature, which will cause texture uploads to do CPU YUV conversion.
options.fDisableGpuYUVConversion = true;
// To get video playback on the widest range of devices, we limit Skia to
// ES2 shading language when the ES3 external image extension is missing.
options.fPreferExternalImagesOverES3 = true;
if (auto context = GrContext::MakeGL(GrGLMakeNativeInterface(), options)) {
// Do not cache textures created by the image decoder. These textures
// should be deleted when they are no longer referenced by an SkImage.
......
......@@ -45,6 +45,10 @@ GPUSurfaceGL::GPUSurfaceGL(GPUSurfaceGLDelegate* delegate)
GrContextOptions options;
options.fAvoidStencilBuffers = true;
// To get video playback on the widest range of devices, we limit Skia to
// ES2 shading language when the ES3 external image extension is missing.
options.fPreferExternalImagesOverES3 = true;
auto context = GrContext::MakeGL(GrGLMakeNativeInterface(), options);
if (context == nullptr) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册