Fixes #543.

Only the last layer was being used to determine whether the fragment
shader should apply gamma correction, hue adjustment, etc.  In reality, if
any layer needs it, the fragment shader must do it.
Merge pull request #545 from AnalyticalGraphicsInc/issue543

Fixes #543.