adhoc-bobcat/regal — pull request #2 by adhoc-bobcat (2013-01-16 00:59:14+00:00)
Title: Implement RegalPpca

Add Push/PopClientAttribute emulation for Regal.

[Note - this depends on a separate pull request to add Google Mock]

This is needed when running on top of a backend which does not support it
(GLES2), when the caller is an more general OpenGL client.

I saw that there is a RegalPPc.h which "says" it does this, but it does
much more than I expected (containing functionality not at all related
to client state, implementing more functionality). Looking back at the
Github history, this module never appears to have been enabled (or it it
was, it was disabled soon after the initial commit when RegalContext.cpp
was introduced -- I didn't look closely)

I suspect that the RegalPpc code is old, and was used to create some of the
other emulation modules, and has just not yet been deleted.

I therefore did not trust it, and did not base this change on it at all.

I implemented this version with the following in mind:

1) I decided that it made most sense to not define what is actually in
the supported client state for the backend. This code should just be
about supporting the superset of all possible client state, and would
also only try and set state in the backend that was actually changed
by the client. For example, the client could very well know that it us
using GLES, and could never set GL_UNPACK_SWAP_BYTES for example, but
could still set GL_UNPACK_ALIGNMENT
2) Primarily this emulation layer was about implementing the push/pop
client attribute calls. Everything else it does is just to track state
changes passively.

As a side note, I recognize I do need to revisit TexC to properly handle
the narrowing of supported client side pixel state from the full set to
just GL_UNPACK_ALIGNMENT.