p3/regal — pull request #80 by adhoc-bobcat (2013-05-07 19:22:14+00:00)
Title: Fix some glErrors under Pepper GLES

Eliminate some errors being reported when running under the Pepper
implementation of GLES.

1) With 8 vertex attributes allowed, RegalIff.cpp was passing in 99
(RFF2A_Invalid) for the index of the SecondaryColor attribute,
presumably from RFF2AMap8. Added a check for Invalid before
binding the attribute.

2) Pepper GLES does not allow client side array data to be passed in via
glVertexAttribPointer without an ARRAY_BUFFER being bound, and will
generate an error if it is done. There were two places in the code where
this could happen.

* In Iff::Cleanup() the code was calling glVertexAttribPointer directly to
reset state to default values with no ARRAY_BUFFER bound.

* In RegalPpca when popping the client vertex array state, the code makes
calls to the fixed function glVertexPointer, glNormalPointer, etc, which
are then translated to calls to glVertexAttribPointer

For both cases, I added some checks to detect PepperGLES, and avoid calls
to reset the client vertex array state when no ARRAY_BUFFER is bound.

Tested by building and running the unit tests under osx/darwin x86_64,
and under nacl_x86-64 and nacl_i686 (on Linux). Tested more fully with
an integration test framework on nacl_i686 for our application which
will is set to fail for any detected GL errors.