piglit: add piglit_rgbw_image() helper

Create an image buffer with red, green, blue, white quadrants.
This code was extracted out of the piglit_rgbw_texture() function.
The piglit_rgbw_texture() function is then rewritten to use the new
piglit_rgbw_image() function.
s3tc-errors: test GL error checking with s3tc textures

Check for expected OpenGL errors related to texture compression.  For
example, glCompresedTexSubImage2D() offset/size values must be multiples
of four.

This test could be expanded to cover other compression formats in the future.

Also, this test contains some texture compression helper functions that could
be made into piglit utility functions.

Verified with NVIDIA's driver.  One error found in Mesa, to be fixed soon.
util: add a comment to explain piglit_depth_texture()
teximage-errors: use piglit_check_gl_error() helper
teximage-errors: fix a couple mistakes, add two new test cases

Fix incorrect texture height (16, not 15).
Fix incorrect width, height for glCopyTexSubImage2D() test.
Add two new SubImage tests for non-existant mipmap levels.
piglit gl: convert gl extension checking to use an array of strings

This better matches the interface of glGetStringi, which should be used
for GL >= 3.0.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
piglit gl: use glGetStringi for GL >= 3.0

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
egl-util: Adds probe_front_pixel_rgb function

This adds an egl_probe_front_pixel_rgb function that is analogous to
piglit_probe_pixel_rgba except it probes the front buffer instead of
probing the back buffer.

Reviewed-by: Brian Paul <brianp@vmware.com>
egl-nok-swap-region: probe front not back buffer

The egl-nok-swap-buffer was mistakenly reading the back buffer to test
the correctness of eglSwapRegionNOK but once the second glClear() to red
has been issued the whole back buffer is red and so the test would
always passed since it only probed points it expected to be red anyway.

This patch now uses egl_probe_front_pixel_rgb to read the front buffer
instead and in addition to checking that certain pixels should be red,
it also checks that other pixels are still green.

Reviewed-by: Brian Paul <brianp@vmware.com>
framebuffer-blit-levels: Make a function for uploading test data to texture.

This will facilitate expanding the test to cover depthstencil
textures, since the stencil data can't be uploaded into the texture
directly using glTexImage2D--it will need to be converted into a
combined depth/stencil format first.
framebuffer-blit-levels: Test stencil buffers.

This patch modifies framebuffer-blit-levels to test that blitting
between miplevels of the stencil portion of a depth/stencil texture
works properly.  This is an important corner case for Mesa's i965
driver.

Note that stencil data can't be uploaded to a texture directly using
glTexImage2D().  It must be converted into a combined depth/stencil
format first.
Test that sRGB-related blits are allowed and do not do encoding/decoding.

The behaviour specified by OpenGL for blits involving sRGB is
self-contradictory--it is unclear whether blits should perform sRGB
encoding/decoding, and if so, whether this encoding/decoding should be
dependent upon the setting of the GL_FRAMEBUFFER_SRGB enable flag.
Experiments with nVidia and ATI drivers indicate that they never do
any sRGB encoding or decoding during a blit, regardless of the buffer
formats and regardless of the setting of GL_FRAMEBUFFER_SRGB.

Furthermore, OpenGL specifies that multisampled blits between formats
that are not "identical" should fail, however nVidia and ATI drivers
allow these blits.

Existing games, such as Valve's "Left For Dead 2", appear to rely on
the behaviour exhibited by the the nVidia and ATI drivers, so it seems
sensible for Piglit to test for this behaviour too.