Bug 978407 - Mark as cleared after glClearing. - r=kamidphish
authorJeff Gilbert <jgilbert@mozilla.com>
Wed, 30 Apr 2014 14:30:28 -0700
changeset 181100 fd28060279e7dd40af6fa3cd4296a3254941e6c5
parent 181099 af970f26f6cecec2d4267984c888e1309c95fb2c
child 181101 7a4f15c7cec5428c2b491c5c91740b3a8e1b276c
push id42936
push userjgilbert@mozilla.com
push dateWed, 30 Apr 2014 21:30:54 +0000
treeherdermozilla-inbound@fd28060279e7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskamidphish
bugs978407
milestone32.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 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)