Narrow fix for creating BGRA backend texture from pixmaps on desktop GL.

GrTestingBackendTextureUploadTest creates backend textures from BGRA
pixmaps. There is a bug on desktop GL. We choose a RGBA format for the
texture. We then infer the color type of the data from the format (via
a hop through GrPixelConfig) as RGBA and upload it as such.

Currently we don't fail the test because the test fails to read the data
back (because we don't support direct reading of BGRA data from textures
in GL).

Fixing the read back causes the test to fail.

This change removes the inference of color type from the format and
instead uses the pixmaps' color type.

This doesn't fix several larger issues, including:

1) The intended color type is not specified when creating a texture of a
solid color so we still infer it from the format in that case.

2) We may not support direct uploading of data in the pixmaps' color type
to the chosen texture format but must first convert it to some other
color type on the CPU.


Change-Id: I3b1022c40201fc107cb39bbb5cca775795c828e8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/250336
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
1 file changed