diff --git a/gfx/gl/GLTextureImage.cpp b/gfx/gl/GLTextureImage.cpp index b3dd425974c0..5663fb3dcdbd 100644 --- a/gfx/gl/GLTextureImage.cpp +++ b/gfx/gl/GLTextureImage.cpp @@ -173,7 +173,6 @@ BasicTextureImage::EndUpdate() RefPtr updateData = updateSnapshot->GetDataSurface(); bool relative = FinishedSurfaceUpdate(); - bool needInit = mTextureState == Created; size_t uploadSize; mTextureFormat = UploadSurfaceToTexture(mGLContext, @@ -181,7 +180,7 @@ BasicTextureImage::EndUpdate() mUpdateRegion, mTexture, &uploadSize, - needInit, + mTextureState == Created, mUpdateOffset, relative); FinishedSurfaceUpload(); @@ -231,14 +230,13 @@ BasicTextureImage::DirectUpdate(gfx::DataSourceSurface* aSurf, const nsIntRegion } size_t uploadSize; - bool needInit = mTextureState == Created; mTextureFormat = UploadSurfaceToTexture(mGLContext, aSurf, region, mTexture, &uploadSize, - needInit, + mTextureState == Created, bounds.TopLeft() + IntPoint(aFrom.x, aFrom.y), false); if (uploadSize > 0) { diff --git a/gfx/gl/GLUploadHelpers.cpp b/gfx/gl/GLUploadHelpers.cpp index cf673ba497e5..fa37dd0b8d66 100644 --- a/gfx/gl/GLUploadHelpers.cpp +++ b/gfx/gl/GLUploadHelpers.cpp @@ -432,12 +432,12 @@ UploadImageDataToTexture(GLContext* gl, const nsIntRegion& aDstRegion, GLuint& aTexture, size_t* aOutUploadSize, - bool aNeedInit, + bool aOverwrite, bool aPixelBuffer, GLenum aTextureUnit, GLenum aTextureTarget) { - bool textureInited = aNeedInit ? false : true; + bool textureInited = aOverwrite ? false : true; gl->MakeCurrent(); gl->fActiveTexture(aTextureUnit); @@ -610,7 +610,7 @@ UploadSurfaceToTexture(GLContext* gl, const nsIntRegion& aDstRegion, GLuint& aTexture, size_t* aOutUploadSize, - bool aNeedInit, + bool aOverwrite, const gfx::IntPoint& aSrcPoint, bool aPixelBuffer, GLenum aTextureUnit, @@ -622,7 +622,7 @@ UploadSurfaceToTexture(GLContext* gl, data += DataOffset(aSrcPoint, stride, format); return UploadImageDataToTexture(gl, data, stride, format, aDstRegion, aTexture, aOutUploadSize, - aNeedInit, aPixelBuffer, aTextureUnit, + aOverwrite, aPixelBuffer, aTextureUnit, aTextureTarget); } diff --git a/gfx/gl/GLUploadHelpers.h b/gfx/gl/GLUploadHelpers.h index a641b453722e..25a3348855a7 100644 --- a/gfx/gl/GLUploadHelpers.h +++ b/gfx/gl/GLUploadHelpers.h @@ -61,7 +61,7 @@ UploadImageDataToTexture(GLContext* gl, const nsIntRegion& aDstRegion, GLuint& aTexture, size_t* aOutUploadSize = nullptr, - bool aNeedInit = false, + bool aOverwrite = false, bool aPixelBuffer = false, GLenum aTextureUnit = LOCAL_GL_TEXTURE0, GLenum aTextureTarget = LOCAL_GL_TEXTURE_2D); @@ -75,7 +75,7 @@ UploadSurfaceToTexture(GLContext* gl, const nsIntRegion& aDstRegion, GLuint& aTexture, size_t* aOutUploadSize = nullptr, - bool aNeedInit = false, + bool aOverwrite = false, const gfx::IntPoint& aSrcPoint = gfx::IntPoint(0, 0), bool aPixelBuffer = false, GLenum aTextureUnit = LOCAL_GL_TEXTURE0, diff --git a/gfx/gl/TextureImageEGL.cpp b/gfx/gl/TextureImageEGL.cpp index 9e3da7765eae..31150f08b7e8 100644 --- a/gfx/gl/TextureImageEGL.cpp +++ b/gfx/gl/TextureImageEGL.cpp @@ -207,7 +207,6 @@ TextureImageEGL::DirectUpdate(gfx::DataSourceSurface* aSurf, const nsIntRegion& region = aRegion; } - bool needInit = mTextureState == Created; size_t uploadSize = 0; mTextureFormat = UploadSurfaceToTexture(mGLContext, @@ -215,7 +214,7 @@ TextureImageEGL::DirectUpdate(gfx::DataSourceSurface* aSurf, const nsIntRegion& region, mTexture, &uploadSize, - needInit, + mTextureState == Created, bounds.TopLeft() + gfx::IntPoint(aFrom.x, aFrom.y), false); if (uploadSize > 0) {