Work around broken EGLImage sampling via access to private HAL data

On Adreno 330, sampling in GLSL from a native Android window buffer,
bound to an EGLImage and external GL texture, will lead to artifacts.
Some rows in the image data will occasionally be null. The same happens
when copying such a texture or reading it back to CPU memory.

To work around this issue, copy the underlying buffer data into a
regular GL texture and sample from there. For this to work, access to
internal HAL data structures is required; therefore this patch is
highly platform-specific.

This issue affects all CtsUiRenderingTestCases that use
Bitmap.Config.HARDWARE, testBitmapConfigFromHardwareToHardware being the
minimal example amongst them.

Issue: FP2P-425
Test: adb shell setprop skia.force_gl_texture 1
Test: run cts -m CtsUiRenderingTestCases
  -t android.uirendering.cts.testclasses.HardwareBitmapTests#testBitmapConfigFromHardwareToHardware
Change-Id: I7192b6e2c38f3294de682ee1e46c3da34af2cc70
1 file changed