diff options
author | Mathias Agopian <mathias@google.com> | 2009-07-30 12:19:10 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2009-07-30 12:19:10 -0700 |
commit | f293b2ff78ce4adac28962d020a0313fdb509cd2 (patch) | |
tree | 7015ecaa60d63957ca56e340d982de6301f47023 /libs/ui | |
parent | bad80e0dccdeaeea97991f7d092678ff0df1bc84 (diff) | |
download | frameworks_base-f293b2ff78ce4adac28962d020a0313fdb509cd2.zip frameworks_base-f293b2ff78ce4adac28962d020a0313fdb509cd2.tar.gz frameworks_base-f293b2ff78ce4adac28962d020a0313fdb509cd2.tar.bz2 |
NPOT EGLimage without GL_ARB_texture_non_power_of_two would be improperly scalled
The current gralloc allocates buffer memory for render targets that will typically have NPOT dimensions. Assuming that the vendor driver supports converting the resulting NPOT android_native_buffer_t to a NPOT EGLImage, SurfaceFlinger calls glEGLImageTargetTexture2DOES(), and uses glGetError() to test whether the GL can support creating an EGL target texture with the specified NPOT EGLImage. If it is supported, the DIRECT_TEXTURE flag remains set, otherwise it is cleared.
Tangentially, if the driver advertises the GL_ARB_texture_non_power_of_two extension, the NPOT_EXTENSION flag is set, otherwise it is cleared.
If the driver supported creating an EGL target texture from a NPOT source EGLImage, it implicitly creates a NPOT texture. This does not need any glScalef() texture coordinate correction in LayerBase::drawWithOpenGL(). However, the same driver may not advertise the GL_ARB_texture_non_power_of_two extension nor generally support NPOT textures that were not derived from EGLImages. So SurfaceFlinger may flag only DIRECT_TEXTURE, not NPOT_EXTENSION.
Therefore, the test in LayerBase::drawWithOpenGL() should only perform the glScalef() if neither NPOT_EXTENSION or DIRECT_TEXTURE are flagged. Otherwise scaling is applied to NPOT EGL target textures when none is required.
Diffstat (limited to 'libs/ui')
0 files changed, 0 insertions, 0 deletions