Bug 1250710 - Remove ScopedUnpackState due to unused. - r=ethlin
authorJeff Gilbert <jgilbert@mozilla.com>
Tue, 14 Jun 2016 10:09:51 -0700
changeset 388857 c8b9fe689adab82469aff1e1d0e0f4b9a3998288
parent 388856 ef99639a073ce3a042dcc3f61b15194a5e6bc33b
child 388858 2fee18feb6231e4e5453e98ed05b42a71ab0de98
push id23247
push userbmo:jgilbert@mozilla.com
push dateMon, 18 Jul 2016 06:13:58 +0000
reviewersethlin
bugs1250710
milestone50.0a1
Bug 1250710 - Remove ScopedUnpackState due to unused. - r=ethlin MozReview-Commit-ID: CO2ojolD6Lg
gfx/gl/ScopedGLHelpers.cpp
gfx/gl/ScopedGLHelpers.h
--- a/gfx/gl/ScopedGLHelpers.cpp
+++ b/gfx/gl/ScopedGLHelpers.cpp
@@ -531,54 +531,10 @@ ScopedPackState::UnwrapImpl()
         return;
 
     mGL->fBindBuffer(LOCAL_GL_PIXEL_PACK_BUFFER, mPixelBuffer);
     mGL->fPixelStorei(LOCAL_GL_PACK_ROW_LENGTH, mRowLength);
     mGL->fPixelStorei(LOCAL_GL_PACK_SKIP_PIXELS, mSkipPixels);
     mGL->fPixelStorei(LOCAL_GL_PACK_SKIP_ROWS, mSkipRows);
 }
 
-////////////////////////////////////////////////////////////////////////
-// ScopedUnpackState
-
-ScopedUnpackState::ScopedUnpackState(GLContext* gl)
-    : ScopedGLWrapper<ScopedUnpackState>(gl)
-{
-    mGL->fGetIntegerv(LOCAL_GL_UNPACK_ALIGNMENT, &mAlignment);
-
-    if (mAlignment != 4) mGL->fPixelStorei(LOCAL_GL_UNPACK_ALIGNMENT, 4);
-
-    if (!HasPBOState(mGL))
-        return;
-
-    mGL->fGetIntegerv(LOCAL_GL_PIXEL_UNPACK_BUFFER_BINDING, (GLint*)&mPixelBuffer);
-    mGL->fGetIntegerv(LOCAL_GL_UNPACK_IMAGE_HEIGHT, &mImageHeight);
-    mGL->fGetIntegerv(LOCAL_GL_UNPACK_ROW_LENGTH, &mRowLength);
-    mGL->fGetIntegerv(LOCAL_GL_UNPACK_SKIP_IMAGES, &mSkipImages);
-    mGL->fGetIntegerv(LOCAL_GL_UNPACK_SKIP_PIXELS, &mSkipPixels);
-    mGL->fGetIntegerv(LOCAL_GL_UNPACK_SKIP_ROWS, &mSkipRows);
-
-    if (mPixelBuffer != 0) mGL->fBindBuffer(LOCAL_GL_PIXEL_UNPACK_BUFFER, 0);
-    if (mImageHeight != 0) mGL->fPixelStorei(LOCAL_GL_UNPACK_IMAGE_HEIGHT, 0);
-    if (mRowLength != 0)   mGL->fPixelStorei(LOCAL_GL_UNPACK_ROW_LENGTH, 0);
-    if (mSkipImages != 0)  mGL->fPixelStorei(LOCAL_GL_UNPACK_SKIP_IMAGES, 0);
-    if (mSkipPixels != 0)  mGL->fPixelStorei(LOCAL_GL_UNPACK_SKIP_PIXELS, 0);
-    if (mSkipRows != 0)    mGL->fPixelStorei(LOCAL_GL_UNPACK_SKIP_ROWS, 0);
-}
-
-void
-ScopedUnpackState::UnwrapImpl()
-{
-    mGL->fPixelStorei(LOCAL_GL_UNPACK_ALIGNMENT, mAlignment);
-
-    if (!HasPBOState(mGL))
-        return;
-
-    mGL->fBindBuffer(LOCAL_GL_PIXEL_UNPACK_BUFFER, mPixelBuffer);
-    mGL->fPixelStorei(LOCAL_GL_UNPACK_IMAGE_HEIGHT, mImageHeight);
-    mGL->fPixelStorei(LOCAL_GL_UNPACK_ROW_LENGTH, mRowLength);
-    mGL->fPixelStorei(LOCAL_GL_UNPACK_SKIP_IMAGES, mSkipImages);
-    mGL->fPixelStorei(LOCAL_GL_UNPACK_SKIP_PIXELS, mSkipPixels);
-    mGL->fPixelStorei(LOCAL_GL_UNPACK_SKIP_ROWS, mSkipRows);
-}
-
 } /* namespace gl */
 } /* namespace mozilla */
--- a/gfx/gl/ScopedGLHelpers.h
+++ b/gfx/gl/ScopedGLHelpers.h
@@ -357,35 +357,12 @@ protected:
 
 public:
     explicit ScopedPackState(GLContext* gl);
 
 protected:
     void UnwrapImpl();
 };
 
-
-struct ScopedUnpackState
-    : public ScopedGLWrapper<ScopedUnpackState>
-{
-    friend struct ScopedGLWrapper<ScopedUnpackState>;
-
-protected:
-    GLint mAlignment;
-
-    GLuint mPixelBuffer;
-    GLint mImageHeight;
-    GLint mRowLength;
-    GLint mSkipImages;
-    GLint mSkipPixels;
-    GLint mSkipRows;
-
-public:
-    explicit ScopedUnpackState(GLContext* gl);
-
-protected:
-    void UnwrapImpl();
-};
-
 } /* namespace gl */
 } /* namespace mozilla */
 
 #endif /* SCOPEDGLHELPERS_H_ */