Fix for bug 1234772 - Adjust GL ALPHA/R8 format
This CL fixes bug 1234772 where the ResourceFormat promised by skia in MakePromiseSkImage* is ALPHA8 whereas that expected in AdjustTexStorageFormat() is R8/16F. This is dues to changes in GLES2/3 version formats. It adjusts the promised format to R8/16F accordingly. Bug: 1234772 Change-Id: I9c40661f102f249d6125998f0549113eb0afda0d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3063901 Commit-Queue: Saifuddin Hitawala <hitawala@chromium.org> Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org> Cr-Commit-Position: refs/heads/master@{#908112}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
22e786e27e
commit
b355d995f3
@ -108,13 +108,15 @@ GLuint GetGrGLBackendTextureFormat(const gles2::FeatureInfo* feature_info,
|
||||
use_version_es2 = base::FeatureList::IsEnabled(features::kUseGles2ForOopR);
|
||||
#endif
|
||||
|
||||
// Use R8 and R16F when using later GLs where LUMINANCE8 and LUMINANCE18F are
|
||||
// deprecated
|
||||
// Use R8 and R16F when using later GLs where ALPHA8, LUMINANCE8, ALPHA16F and
|
||||
// LUMINANCE16F are deprecated
|
||||
if (feature_info->gl_version_info().NeedsLuminanceAlphaEmulation()) {
|
||||
switch (internal_format) {
|
||||
case GL_ALPHA8_EXT:
|
||||
case GL_LUMINANCE8:
|
||||
internal_format = GL_R8_EXT;
|
||||
break;
|
||||
case GL_ALPHA16F_EXT:
|
||||
case GL_LUMINANCE16F_EXT:
|
||||
internal_format = GL_R16F_EXT;
|
||||
break;
|
||||
|
Reference in New Issue
Block a user