mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 1243418 - Fix up incorrect 'aOverwrite' usage and impl in GLUploadHelpers r=jgilbert
This commit is contained in:
parent
6ce8f1df22
commit
7a195bd71f
@ -173,6 +173,7 @@ BasicTextureImage::EndUpdate()
|
||||
RefPtr<gfx::DataSourceSurface> updateData = updateSnapshot->GetDataSurface();
|
||||
|
||||
bool relative = FinishedSurfaceUpdate();
|
||||
bool needInit = mTextureState == Created;
|
||||
size_t uploadSize;
|
||||
mTextureFormat =
|
||||
UploadSurfaceToTexture(mGLContext,
|
||||
@ -180,7 +181,7 @@ BasicTextureImage::EndUpdate()
|
||||
mUpdateRegion,
|
||||
mTexture,
|
||||
&uploadSize,
|
||||
mTextureState == Created,
|
||||
needInit,
|
||||
mUpdateOffset,
|
||||
relative);
|
||||
FinishedSurfaceUpload();
|
||||
@ -230,13 +231,14 @@ BasicTextureImage::DirectUpdate(gfx::DataSourceSurface* aSurf, const nsIntRegion
|
||||
}
|
||||
|
||||
size_t uploadSize;
|
||||
bool needInit = mTextureState == Created;
|
||||
mTextureFormat =
|
||||
UploadSurfaceToTexture(mGLContext,
|
||||
aSurf,
|
||||
region,
|
||||
mTexture,
|
||||
&uploadSize,
|
||||
mTextureState == Created,
|
||||
needInit,
|
||||
bounds.TopLeft() + IntPoint(aFrom.x, aFrom.y),
|
||||
false);
|
||||
if (uploadSize > 0) {
|
||||
|
@ -432,12 +432,12 @@ UploadImageDataToTexture(GLContext* gl,
|
||||
const nsIntRegion& aDstRegion,
|
||||
GLuint& aTexture,
|
||||
size_t* aOutUploadSize,
|
||||
bool aOverwrite,
|
||||
bool aNeedInit,
|
||||
bool aPixelBuffer,
|
||||
GLenum aTextureUnit,
|
||||
GLenum aTextureTarget)
|
||||
{
|
||||
bool textureInited = aOverwrite ? false : true;
|
||||
bool textureInited = aNeedInit ? false : true;
|
||||
gl->MakeCurrent();
|
||||
gl->fActiveTexture(aTextureUnit);
|
||||
|
||||
@ -610,7 +610,7 @@ UploadSurfaceToTexture(GLContext* gl,
|
||||
const nsIntRegion& aDstRegion,
|
||||
GLuint& aTexture,
|
||||
size_t* aOutUploadSize,
|
||||
bool aOverwrite,
|
||||
bool aNeedInit,
|
||||
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,
|
||||
aOverwrite, aPixelBuffer, aTextureUnit,
|
||||
aNeedInit, aPixelBuffer, aTextureUnit,
|
||||
aTextureTarget);
|
||||
}
|
||||
|
||||
|
@ -61,7 +61,7 @@ UploadImageDataToTexture(GLContext* gl,
|
||||
const nsIntRegion& aDstRegion,
|
||||
GLuint& aTexture,
|
||||
size_t* aOutUploadSize = nullptr,
|
||||
bool aOverwrite = false,
|
||||
bool aNeedInit = 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 aOverwrite = false,
|
||||
bool aNeedInit = false,
|
||||
const gfx::IntPoint& aSrcPoint = gfx::IntPoint(0, 0),
|
||||
bool aPixelBuffer = false,
|
||||
GLenum aTextureUnit = LOCAL_GL_TEXTURE0,
|
||||
|
@ -207,6 +207,7 @@ TextureImageEGL::DirectUpdate(gfx::DataSourceSurface* aSurf, const nsIntRegion&
|
||||
region = aRegion;
|
||||
}
|
||||
|
||||
bool needInit = mTextureState == Created;
|
||||
size_t uploadSize = 0;
|
||||
mTextureFormat =
|
||||
UploadSurfaceToTexture(mGLContext,
|
||||
@ -214,7 +215,7 @@ TextureImageEGL::DirectUpdate(gfx::DataSourceSurface* aSurf, const nsIntRegion&
|
||||
region,
|
||||
mTexture,
|
||||
&uploadSize,
|
||||
mTextureState == Created,
|
||||
needInit,
|
||||
bounds.TopLeft() + gfx::IntPoint(aFrom.x, aFrom.y),
|
||||
false);
|
||||
if (uploadSize > 0) {
|
||||
|
Loading…
Reference in New Issue
Block a user