Bug 978407 - Mark as cleared after glClearing. - r=kamidphish
authorJeff Gilbert <jgilbert@mozilla.com>
Wed, 30 Apr 2014 14:30:28 -0700
changeset 181506 fd28060279e7dd40af6fa3cd4296a3254941e6c5
parent 181505 af970f26f6cecec2d4267984c888e1309c95fb2c
child 181507 7a4f15c7cec5428c2b491c5c91740b3a8e1b276c
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewerskamidphish
bugs978407
milestone32.0a1
Bug 978407 - Mark as cleared after glClearing. - r=kamidphish
content/canvas/src/WebGLTexture.cpp
--- a/content/canvas/src/WebGLTexture.cpp
+++ b/content/canvas/src/WebGLTexture.cpp
@@ -544,18 +544,20 @@ WebGLTexture::DoDeferredImageInitializat
 
     // Try to clear with glCLear.
     WebGLTexelFormat texelformat = GetWebGLTexelFormat(imageInfo.mInternalFormat, imageInfo.mType);
     GLenum format = WebGLTexelConversions::GLFormatForTexelFormat(texelformat);
 
     bool cleared = ClearWithTempFB(mContext, GLName(),
                                    imageTarget, level,
                                    format, imageInfo.mHeight, imageInfo.mWidth);
-    if (cleared)
+    if (cleared) {
+        SetImageDataStatus(imageTarget, level, WebGLImageDataStatus::InitializedImageData);
         return;
+    }
 
     // That didn't work. Try uploading zeros then.
     gl::ScopedBindTexture autoBindTex(mContext->gl, GLName(), mTarget);
 
     uint32_t texelsize = WebGLTexelConversions::TexelBytesForFormat(texelformat);
     CheckedUint32 checked_byteLength
         = WebGLContext::GetImageSize(
                         imageInfo.mHeight,
@@ -579,16 +581,16 @@ WebGLTexture::DoDeferredImageInitializat
     }
 
     SetImageDataStatus(imageTarget, level, WebGLImageDataStatus::InitializedImageData);
 }
 
 void
 WebGLTexture::SetFakeBlackStatus(WebGLTextureFakeBlackStatus x)
 {
-	mFakeBlackStatus = x;
-	mContext->SetFakeBlackStatus(WebGLContextFakeBlackStatus::Unknown);
+    mFakeBlackStatus = x;
+    mContext->SetFakeBlackStatus(WebGLContextFakeBlackStatus::Unknown);
 }
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(WebGLTexture)
 
 NS_IMPL_CYCLE_COLLECTION_ROOT_NATIVE(WebGLTexture, AddRef)
 NS_IMPL_CYCLE_COLLECTION_UNROOT_NATIVE(WebGLTexture, Release)