Bug 1250710 - Remove packAlign save/restore from ScopedGLDrawState. - r=jrmuizel
authorJeff Gilbert <jgilbert@mozilla.com>
Tue, 14 Jun 2016 10:08:59 -0700
changeset 305271 627980e477d31c42bee6bda0b1b4289a515616c6
parent 305270 4423ce67bfb77ef8085afbb1f5159e4e0732d566
child 305272 ef99639a073ce3a042dcc3f61b15194a5e6bc33b
push id79535
push userjgilbert@mozilla.com
push dateMon, 18 Jul 2016 04:46:14 +0000
treeherdermozilla-inbound@b658098634b8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1250710
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1250710 - Remove packAlign save/restore from ScopedGLDrawState. - r=jrmuizel MozReview-Commit-ID: CESZzSfHbFj
gfx/gl/ScopedGLHelpers.cpp
gfx/gl/ScopedGLHelpers.h
--- a/gfx/gl/ScopedGLHelpers.cpp
+++ b/gfx/gl/ScopedGLHelpers.cpp
@@ -429,25 +429,23 @@ ScopedGLDrawState::ScopedGLDrawState(GLC
     , depthTest   (aGL, LOCAL_GL_DEPTH_TEST, false)
     , dither      (aGL, LOCAL_GL_DITHER,     false)
     , polyOffsFill(aGL, LOCAL_GL_POLYGON_OFFSET_FILL,      false)
     , sampleAToC  (aGL, LOCAL_GL_SAMPLE_ALPHA_TO_COVERAGE, false)
     , sampleCover (aGL, LOCAL_GL_SAMPLE_COVERAGE, false)
     , scissor     (aGL, LOCAL_GL_SCISSOR_TEST,    false)
     , stencil     (aGL, LOCAL_GL_STENCIL_TEST,    false)
     , mGL(aGL)
-    , packAlign(4)
 {
-    mGL->GetUIntegerv(LOCAL_GL_UNPACK_ALIGNMENT, &packAlign);
     mGL->GetUIntegerv(LOCAL_GL_CURRENT_PROGRAM, &boundProgram);
     mGL->GetUIntegerv(LOCAL_GL_ARRAY_BUFFER_BINDING, &boundBuffer);
     mGL->GetUIntegerv(LOCAL_GL_MAX_VERTEX_ATTRIBS, &maxAttrib);
     attrib_enabled = MakeUnique<GLint[]>(maxAttrib);
 
-    for (unsigned int i = 0; i < maxAttrib; i++) {
+    for (GLuint i = 0; i < maxAttrib; i++) {
         mGL->fGetVertexAttribiv(i, LOCAL_GL_VERTEX_ATTRIB_ARRAY_ENABLED, &attrib_enabled[i]);
         mGL->fDisableVertexAttribArray(i);
     }
     // Only Attrib0's client side state affected
     mGL->fGetVertexAttribiv(0, LOCAL_GL_VERTEX_ATTRIB_ARRAY_SIZE, &attrib0_size);
     mGL->fGetVertexAttribiv(0, LOCAL_GL_VERTEX_ATTRIB_ARRAY_STRIDE, &attrib0_stride);
     mGL->fGetVertexAttribiv(0, LOCAL_GL_VERTEX_ATTRIB_ARRAY_TYPE, &attrib0_type);
     mGL->fGetVertexAttribiv(0, LOCAL_GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, &attrib0_normalized);
@@ -468,18 +466,16 @@ ScopedGLDrawState::~ScopedGLDrawState()
     mGL->fViewport(viewport[0], viewport[1],
                    viewport[2], viewport[3]);
 
     mGL->fColorMask(colorMask[0],
                     colorMask[1],
                     colorMask[2],
                     colorMask[3]);
 
-    mGL->fPixelStorei(LOCAL_GL_UNPACK_ALIGNMENT, packAlign);
-
     for (unsigned int i = 0; i < maxAttrib; i++) {
         if (attrib_enabled[i])
             mGL->fEnableVertexAttribArray(i);
         else
             mGL->fDisableVertexAttribArray(i);
     }
 
 
--- a/gfx/gl/ScopedGLHelpers.h
+++ b/gfx/gl/ScopedGLHelpers.h
@@ -304,17 +304,18 @@ public:
                               GLsizei stride, GLuint buffer, const GLvoid* pointer);
     explicit ScopedVertexAttribPointer(GLContext* aGL, GLuint index);
 
 protected:
     void WrapImpl(GLuint index);
     void UnwrapImpl();
 };
 
-struct ScopedGLDrawState {
+struct ScopedGLDrawState
+{
     explicit ScopedGLDrawState(GLContext* gl);
     ~ScopedGLDrawState();
 
     GLuint boundProgram;
     GLuint boundBuffer;
 
     ScopedGLState blend;
     ScopedGLState cullFace;
@@ -334,17 +335,16 @@ struct ScopedGLDrawState {
     GLint attrib0_normalized;
     GLint attrib0_bufferBinding;
     void* attrib0_pointer;
 
     realGLboolean colorMask[4];
     GLint viewport[4];
     GLint scissorBox[4];
     GLContext* const mGL;
-    GLuint packAlign;
 };
 
 struct ScopedPackState
     : public ScopedGLWrapper<ScopedPackState>
 {
     friend struct ScopedGLWrapper<ScopedPackState>;
 
 protected: