Bug 1325468 - An unspecified fb attachment should have a COLOR_ENCODING of LINEAR. - r=daoshengmu a=lizzard
authorJeff Gilbert <jgilbert@mozilla.com>
Thu, 22 Dec 2016 13:19:03 -0800
changeset 359219 27000f758c72ba9de987bd392f035480e14c4ac0
parent 359218 a0d4562b3a8358dfd03db9b22a4fdc1ae4fd57fd
child 359220 4361476b9ca0d8e17f808d87bfbee3c996dfa28c
push id1324
push usermtabara@mozilla.com
push dateMon, 16 Jan 2017 13:07:44 +0000
treeherdermozilla-release@a01c49833940 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdaoshengmu, lizzard
bugs1325468
milestone51.0
Bug 1325468 - An unspecified fb attachment should have a COLOR_ENCODING of LINEAR. - r=daoshengmu a=lizzard MozReview-Commit-ID: BhrlgFln2sZ
dom/canvas/WebGLFramebuffer.cpp
--- a/dom/canvas/WebGLFramebuffer.cpp
+++ b/dom/canvas/WebGLFramebuffer.cpp
@@ -496,18 +496,22 @@ WebGLFBAttachPoint::GetParameter(const c
     }
 
     if (!isPNameValid) {
         webgl->ErrorInvalidEnum("%s: Invalid pname: 0x%04x", funcName, pname);
         return JS::NullValue();
     }
 
     const auto usage = Format();
-    if (!usage)
+    if (!usage) {
+        if (pname == LOCAL_GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING)
+            return JS::NumberValue(LOCAL_GL_LINEAR);
+
         return JS::NullValue();
+    }
 
     auto format = usage->format;
 
     GLint ret = 0;
     switch (pname) {
     case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE:
         ret = format->r;
         break;