Bug 1089981 - Reftest both initial and steady-state frame. - r=kamidphish
authorJeff Gilbert <jgilbert@mozilla.com>
Wed, 14 Jan 2015 18:04:50 -0800
changeset 223930 7f7a164973c340e932d90650f41864430b320be7
parent 223929 74abc1cf01936a7b860960e43a2b25d463f36ed8
child 223931 876b339851300c0c7a8c5e0fc034930cc83db42e
push id28112
push usercbook@mozilla.com
push dateThu, 15 Jan 2015 13:19:02 +0000
treeherdermozilla-central@206bf1a98cd7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskamidphish
bugs1089981
milestone38.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 1089981 - Reftest both initial and steady-state frame. - r=kamidphish
dom/canvas/test/reftest/colors-half-alpha.png
dom/canvas/test/reftest/colors-no-alpha.png
dom/canvas/test/reftest/colors-non-premult.png
dom/canvas/test/reftest/colors-premult.png
dom/canvas/test/reftest/colors.png
dom/canvas/test/reftest/half-colors-half-alpha.png
dom/canvas/test/reftest/half-colors.png
dom/canvas/test/reftest/reftest.list
dom/canvas/test/reftest/webgl-clear-test.html
dom/canvas/test/reftest/webgl-color-alpha-test.html
dom/canvas/test/reftest/webgl-color-test.html
dom/canvas/test/reftest/webgl-orientation-test.html
dom/canvas/test/reftest/webgl-utils.js
dom/canvas/test/reftest/white-top-left.png
gfx/gl/GLScreenBuffer.cpp
gfx/gl/SharedSurface.cpp
gfx/gl/SharedSurface.h
deleted file mode 100644
index e64729dedf2bb2f539fcc572541fbf4f7229d394..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..5c6f48a40a279334ba99dd7cd65ec1ed134e456f
GIT binary patch
literal 439
zc%17D@N?(olHy`uVBq!ia0vp^CqS5k2}mkgS)OEIV65|WaSW-r_4dj^P6h)W=8a3b
z+jH)T{?T!jIw<pQm1a<O(*;AuLrxJK+%2se1jIPF6BTs?#DD?{IzRyjpm<^<Q2Y=R
zP`rhejta5p+_UyL+eXuA$Eo88MIB*U`*Ht{zf)NFW`!HR0Y(Uer>mdKI;Vst05Q&k
AP5=M^
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..727fe15a8cb5e73072a4cbb42b0e6f9a917c1050
GIT binary patch
literal 444
zc%17D@N?(olHy`uVBq!ia0vp^CqS5k2}mkgS)OEIU~KkuaSW-r_4dj^P6h=Y7Dv(F
zUfC~wF3r?^qG=R-XyctTHqGmd94{L&9&(D{;BIN%ARxxUov5fIAO;jr&;bfK0L2p<
zf#QdlfZ{EzbX15%=bqf-8rmkIHx4Az%nIuI;;6cwxjUQC_wJrdV5~5By85}Sb4q9e
E0N1R8$N&HU
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..98d5e0feca3bc82f0bbd72dc055ef347c66a385a
GIT binary patch
literal 441
zc%17D@N?(olHy`uVBq!ia0vp^CqS5k2}mkgS)OEIU~KSoaSW-r_4dj^P6h=Y7Dv(F
zenC68O;~=yhx2%m@n@c0r&xSXvv6=HD(VP`9de3L&}nJi;1B^6Xxso4U;>J_umZ(7
zxPjsVVsuo9Md!zDvWwST2uWn_r<oO0_Qm`iP3>$#>pv*y0;7b%)78&qol`;+0PC)W
A-v9sr
deleted file mode 100644
index 02764182e5850fbc2648d8d03fcc19f003c83456..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 5eedbdfb1c5227d31b6039752f3d21ace0004b62..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
deleted file mode 100644
index 838b9566119961ac8cb51095733428734d1e93fb..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
--- a/dom/canvas/test/reftest/reftest.list
+++ b/dom/canvas/test/reftest/reftest.list
@@ -1,189 +1,149 @@
 # WebGL Reftests!
 default-preferences pref(webgl.force-enabled,true)
 
 # Check that disabling works:
-                           == webgl-disable-test.html?nogl  wrapper.html?green.png
-pref(webgl.disabled,true)  == webgl-disable-test.html       wrapper.html?green.png
+                           == webgl-disable-test.html?nogl wrapper.html?green.png
+pref(webgl.disabled,true)  == webgl-disable-test.html      wrapper.html?green.png
 
 # Basic WebGL tests:
 # Do we get pixels to the screen at all?
-# Try to just hit the different rendering paths here.
-
-# Android 2.2 ARMv6 slaves can't seem to use WebGL, but we can't seem to
-# disable the ARMv6 runs without disabling ARMv7, which works fine.
-# For now, just mark versions <15 (<4.0) as random, so we still get
-# assert coverage.
+# Neither of these should ever break.
+                                        == webgl-clear-test.html wrapper.html?green.png
+pref(webgl.force-layers-readback,true)  == webgl-clear-test.html?readback wrapper.html?green.png
 
-# Test: {aa, alpha, preserve, readback} = 16
-                     random-if(Android&&AndroidVersion<15)  == webgl-clear-test.html?__&_____&________  wrapper.html?green.png
-                     random-if(Android&&AndroidVersion<15)  == webgl-clear-test.html?aa&_____&________  wrapper.html?green.png
-random-if(gtk2Widget) fuzzy-if(B2G,256,91) random-if(Android&&AndroidVersion<15)  == webgl-clear-test.html?__&alpha&________  wrapper.html?green.png
-random-if(gtk2Widget) fuzzy-if(B2G,256,91) random-if(Android&&AndroidVersion<15)  == webgl-clear-test.html?aa&alpha&________  wrapper.html?green.png
-                     random-if(Android&&AndroidVersion<15)  == webgl-clear-test.html?__&_____&preserve  wrapper.html?green.png
-                     random-if(Android&&AndroidVersion<15)  == webgl-clear-test.html?aa&_____&preserve  wrapper.html?green.png
-random-if(gtk2Widget) fuzzy-if(B2G,256,91) random-if(Android&&AndroidVersion<15)  == webgl-clear-test.html?__&alpha&preserve  wrapper.html?green.png
-random-if(gtk2Widget) fuzzy-if(B2G,256,91) random-if(Android&&AndroidVersion<15)  == webgl-clear-test.html?aa&alpha&preserve  wrapper.html?green.png
-
-pref(webgl.force-layers-readback,true)                      random-if(Android&&AndroidVersion<15)  == webgl-clear-test.html?readback&__&_____&________  wrapper.html?green.png
-pref(webgl.force-layers-readback,true)                      random-if(Android&&AndroidVersion<15)  == webgl-clear-test.html?readback&aa&_____&________  wrapper.html?green.png
-random-if(gtk2Widget) pref(webgl.force-layers-readback,true) fuzzy-if(B2G,256,91) random-if(Android&&AndroidVersion<15)  == webgl-clear-test.html?readback&__&alpha&________  wrapper.html?green.png
-random-if(gtk2Widget) pref(webgl.force-layers-readback,true) fuzzy-if(B2G,256,91) random-if(Android&&AndroidVersion<15)  == webgl-clear-test.html?readback&aa&alpha&________  wrapper.html?green.png
-pref(webgl.force-layers-readback,true)                      random-if(Android&&AndroidVersion<15)  == webgl-clear-test.html?readback&__&_____&preserve  wrapper.html?green.png
-pref(webgl.force-layers-readback,true)                      random-if(Android&&AndroidVersion<15)  == webgl-clear-test.html?readback&aa&_____&preserve  wrapper.html?green.png
-random-if(gtk2Widget) pref(webgl.force-layers-readback,true) fuzzy-if(B2G,256,91) random-if(Android&&AndroidVersion<15)  == webgl-clear-test.html?readback&__&alpha&preserve  wrapper.html?green.png
-random-if(gtk2Widget) pref(webgl.force-layers-readback,true) fuzzy-if(B2G,256,91) random-if(Android&&AndroidVersion<15)  == webgl-clear-test.html?readback&aa&alpha&preserve  wrapper.html?green.png
+# Make sure that our choice of attribs doesn't break rendering.
+== webgl-clear-test.html?depth wrapper.html?green.png
+== webgl-clear-test.html?stencil wrapper.html?green.png
+== webgl-clear-test.html?depth&stencil wrapper.html?green.png
 
 # Check that resize works:
-random-if(Android&&AndroidVersion<15)  == webgl-resize-test.html  wrapper.html?green.png
+== webgl-resize-test.html  wrapper.html?green.png
 
-# Check orientation:
-                     random-if(Android&&AndroidVersion<15)  == webgl-orientation-test.html?__&_____&________  wrapper.html?white-top-left.png
-                     random-if(Android&&AndroidVersion<15)  == webgl-orientation-test.html?aa&_____&________  wrapper.html?white-top-left.png
-random-if(gtk2Widget) fuzzy-if(B2G,256,90) random-if(Android&&AndroidVersion<15)  == webgl-orientation-test.html?__&alpha&________  wrapper.html?white-top-left.png
-random-if(gtk2Widget) fuzzy-if(B2G,256,90) random-if(Android&&AndroidVersion<15)  == webgl-orientation-test.html?aa&alpha&________  wrapper.html?white-top-left.png
-                     random-if(Android&&AndroidVersion<15)  == webgl-orientation-test.html?__&_____&preserve  wrapper.html?white-top-left.png
-                     random-if(Android&&AndroidVersion<15)  == webgl-orientation-test.html?aa&_____&preserve  wrapper.html?white-top-left.png
-random-if(gtk2Widget) fuzzy-if(B2G,256,90) random-if(Android&&AndroidVersion<15)  == webgl-orientation-test.html?__&alpha&preserve  wrapper.html?white-top-left.png
-random-if(gtk2Widget) fuzzy-if(B2G,256,90) random-if(Android&&AndroidVersion<15)  == webgl-orientation-test.html?aa&alpha&preserve  wrapper.html?white-top-left.png
+# Some of the failure conditions are a little crazy. I'm (jgilbert) setting these based on
+# failures encountered when running on Try, and then targetting the Try config by
+# differences in the `sandbox` contents. That is, I'm labeling based on symptoms rather
+# than cause.
+# Lin-R-e10s: gtk2Widget && browserIsRemote
+# WinXP-R: winWidget && layersGPUAccelerated && !d2d
+# Win7+-R: winWidget && layersGPUAccelerated && d2d
+# Win7+-Ru: winWidget && !layersGPUAccelerated
+# (Note that we have to remove spaces when used below)
 
-pref(webgl.force-layers-readback,true)                      random-if(Android&&AndroidVersion<15)  == webgl-orientation-test.html?readback&__&_____&________  wrapper.html?white-top-left.png
-pref(webgl.force-layers-readback,true)                      random-if(Android&&AndroidVersion<15)  == webgl-orientation-test.html?readback&aa&_____&________  wrapper.html?white-top-left.png
-random-if(gtk2Widget) pref(webgl.force-layers-readback,true) fuzzy-if(B2G,256,90) random-if(Android&&AndroidVersion<15)  == webgl-orientation-test.html?readback&__&alpha&________  wrapper.html?white-top-left.png
-random-if(gtk2Widget) pref(webgl.force-layers-readback,true) fuzzy-if(B2G,256,90) random-if(Android&&AndroidVersion<15)  == webgl-orientation-test.html?readback&aa&alpha&________  wrapper.html?white-top-left.png
-pref(webgl.force-layers-readback,true)                      random-if(Android&&AndroidVersion<15)  == webgl-orientation-test.html?readback&__&_____&preserve  wrapper.html?white-top-left.png
-pref(webgl.force-layers-readback,true)                      random-if(Android&&AndroidVersion<15)  == webgl-orientation-test.html?readback&aa&_____&preserve  wrapper.html?white-top-left.png
-random-if(gtk2Widget) pref(webgl.force-layers-readback,true) fuzzy-if(B2G,256,90) random-if(Android&&AndroidVersion<15)  == webgl-orientation-test.html?readback&__&alpha&preserve  wrapper.html?white-top-left.png
-random-if(gtk2Widget) pref(webgl.force-layers-readback,true) fuzzy-if(B2G,256,90) random-if(Android&&AndroidVersion<15)  == webgl-orientation-test.html?readback&aa&alpha&preserve  wrapper.html?white-top-left.png
+# IMPORTANT: Expected outcomes are evaluated left-to-right, and they replace eachother.
+# That means that if an unconditional status (`fuzzy()`) is to the right of another status
+# (such as fails-if), it will overwrite the old status.
+#
+# As such, all unconditional statuses should be to the left of conditional statuses.
+# (See /layout/tools/reftest/reftest.js:945)
 
-# Does we draw the correct color in the correct places with all context creation options?
-# (Note that our context creation option matrix is 2^6 = 64)
-random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?__&_____&_____&_______&________&_______  wrapper.html?colors.png # Bug 844439
-random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?aa&_____&_____&_______&________&_______  wrapper.html?colors.png # Bug 844439
-random-if(gtk2Widget) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?__&alpha&_____&_______&________&_______  wrapper.html?colors.png # Bug 844439
-random-if(gtk2Widget) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?aa&alpha&_____&_______&________&_______  wrapper.html?colors.png # Bug 844439
-random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?__&_____&depth&_______&________&_______  wrapper.html?colors.png # Bug 844439
-random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?aa&_____&depth&_______&________&_______  wrapper.html?colors.png # Bug 844439
-random-if(gtk2Widget) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?__&alpha&depth&_______&________&_______  wrapper.html?colors.png # Bug 844439
-random-if(gtk2Widget) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?aa&alpha&depth&_______&________&_______  wrapper.html?colors.png # Bug 844439
-random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?__&_____&_____&premult&________&_______  wrapper.html?colors.png # Bug 844439
-random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?aa&_____&_____&premult&________&_______  wrapper.html?colors.png # Bug 844439
-random-if(gtk2Widget) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?__&alpha&_____&premult&________&_______  wrapper.html?colors.png # Bug 844439
-random-if(gtk2Widget) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?aa&alpha&_____&premult&________&_______  wrapper.html?colors.png # Bug 844439
-random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?__&_____&depth&premult&________&_______  wrapper.html?colors.png # Bug 844439
-random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?aa&_____&depth&premult&________&_______  wrapper.html?colors.png # Bug 844439
-random-if(gtk2Widget) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?__&alpha&depth&premult&________&_______  wrapper.html?colors.png # Bug 844439
-random-if(gtk2Widget) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?aa&alpha&depth&premult&________&_______  wrapper.html?colors.png # Bug 844439
-
-random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?__&_____&_____&_______&preserve&_______  wrapper.html?colors.png # Bug 844439
-random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?aa&_____&_____&_______&preserve&_______  wrapper.html?colors.png # Bug 844439
-random-if(gtk2Widget) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?__&alpha&_____&_______&preserve&_______  wrapper.html?colors.png # Bug 844439
-random-if(gtk2Widget) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?aa&alpha&_____&_______&preserve&_______  wrapper.html?colors.png # Bug 844439
-random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?__&_____&depth&_______&preserve&_______  wrapper.html?colors.png # Bug 844439
-random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?aa&_____&depth&_______&preserve&_______  wrapper.html?colors.png # Bug 844439
-random-if(gtk2Widget) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?__&alpha&depth&_______&preserve&_______  wrapper.html?colors.png # Bug 844439
-random-if(gtk2Widget) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?aa&alpha&depth&_______&preserve&_______  wrapper.html?colors.png # Bug 844439
-random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?__&_____&_____&premult&preserve&_______  wrapper.html?colors.png # Bug 844439
-random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?aa&_____&_____&premult&preserve&_______  wrapper.html?colors.png # Bug 844439
-random-if(gtk2Widget) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?__&alpha&_____&premult&preserve&_______  wrapper.html?colors.png # Bug 844439
-random-if(gtk2Widget) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?aa&alpha&_____&premult&preserve&_______  wrapper.html?colors.png # Bug 844439
-random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?__&_____&depth&premult&preserve&_______  wrapper.html?colors.png # Bug 844439
-random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?aa&_____&depth&premult&preserve&_______  wrapper.html?colors.png # Bug 844439
-random-if(gtk2Widget) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?__&alpha&depth&premult&preserve&_______  wrapper.html?colors.png # Bug 844439
-random-if(gtk2Widget) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?aa&alpha&depth&premult&preserve&_______  wrapper.html?colors.png # Bug 844439
+# Does we draw the correct colors in the correct places?
+# Combinations: PowerSet([readback, aa, preserve, premult, alpha]) x [frame=1,frame=6]
+# This is 2^6 = 64 combinations.
+                                                                                                         == webgl-color-test.html?frame=1&__&________&_______&_____  wrapper.html?colors-no-alpha.png
+                                                                                                         == webgl-color-test.html?frame=1&aa&________&_______&_____  wrapper.html?colors-no-alpha.png
+                                                                                                         == webgl-color-test.html?frame=1&__&preserve&_______&_____  wrapper.html?colors-no-alpha.png
+                                                                                                         == webgl-color-test.html?frame=1&aa&preserve&_______&_____  wrapper.html?colors-no-alpha.png
+                                                                                                         == webgl-color-test.html?frame=1&__&________&premult&_____  wrapper.html?colors-no-alpha.png
+                                                                                                         == webgl-color-test.html?frame=1&aa&________&premult&_____  wrapper.html?colors-no-alpha.png
+                                                                                                         == webgl-color-test.html?frame=1&__&preserve&premult&_____  wrapper.html?colors-no-alpha.png
+                                                                                                         == webgl-color-test.html?frame=1&aa&preserve&premult&_____  wrapper.html?colors-no-alpha.png
+fuzzy(1,30000) fails-if(gtk2Widget&&browserIsRemote) fails-if(winWidget&&layersGPUAccelerated&&!d2d)     == webgl-color-test.html?frame=1&__&________&_______&alpha  wrapper.html?colors-non-premult.png
+fuzzy(1,30000) fails-if(gtk2Widget&&browserIsRemote) fails-if(winWidget&&layersGPUAccelerated&&!d2d)     == webgl-color-test.html?frame=1&aa&________&_______&alpha  wrapper.html?colors-non-premult.png
+fuzzy(1,30000) fails-if(gtk2Widget&&browserIsRemote) fails-if(winWidget&&layersGPUAccelerated&&!d2d)     == webgl-color-test.html?frame=1&__&preserve&_______&alpha  wrapper.html?colors-non-premult.png
+fuzzy(1,30000) fails-if(gtk2Widget&&browserIsRemote) fails-if(winWidget&&layersGPUAccelerated&&!d2d)     == webgl-color-test.html?frame=1&aa&preserve&_______&alpha  wrapper.html?colors-non-premult.png
+                                                                                                         == webgl-color-test.html?frame=1&__&________&premult&alpha  wrapper.html?colors-premult.png
+                                                                                                         == webgl-color-test.html?frame=1&aa&________&premult&alpha  wrapper.html?colors-premult.png
+                                                                                                         == webgl-color-test.html?frame=1&__&preserve&premult&alpha  wrapper.html?colors-premult.png
+                                                                                                         == webgl-color-test.html?frame=1&aa&preserve&premult&alpha  wrapper.html?colors-premult.png
 
-random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?__&_____&_____&_______&________&stencil  wrapper.html?colors.png # Bug 844439
-random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?aa&_____&_____&_______&________&stencil  wrapper.html?colors.png # Bug 844439
-random-if(gtk2Widget) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?__&alpha&_____&_______&________&stencil  wrapper.html?colors.png # Bug 844439
-random-if(gtk2Widget) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?aa&alpha&_____&_______&________&stencil  wrapper.html?colors.png # Bug 844439
-random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?__&_____&depth&_______&________&stencil  wrapper.html?colors.png # Bug 844439
-random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?aa&_____&depth&_______&________&stencil  wrapper.html?colors.png # Bug 844439
-random-if(gtk2Widget) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?__&alpha&depth&_______&________&stencil  wrapper.html?colors.png # Bug 844439
-random-if(gtk2Widget) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?aa&alpha&depth&_______&________&stencil  wrapper.html?colors.png # Bug 844439
-random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?__&_____&_____&premult&________&stencil  wrapper.html?colors.png # Bug 844439
-random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?aa&_____&_____&premult&________&stencil  wrapper.html?colors.png # Bug 844439
-random-if(gtk2Widget) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?__&alpha&_____&premult&________&stencil  wrapper.html?colors.png # Bug 844439
-random-if(gtk2Widget) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?aa&alpha&_____&premult&________&stencil  wrapper.html?colors.png # Bug 844439
-random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?__&_____&depth&premult&________&stencil  wrapper.html?colors.png # Bug 844439
-random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?aa&_____&depth&premult&________&stencil  wrapper.html?colors.png # Bug 844439
-random-if(gtk2Widget) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?__&alpha&depth&premult&________&stencil  wrapper.html?colors.png # Bug 844439
-random-if(gtk2Widget) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?aa&alpha&depth&premult&________&stencil  wrapper.html?colors.png # Bug 844439
-
-random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?__&_____&_____&_______&preserve&stencil  wrapper.html?colors.png # Bug 844439
-random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?aa&_____&_____&_______&preserve&stencil  wrapper.html?colors.png # Bug 844439
-random-if(gtk2Widget) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?__&alpha&_____&_______&preserve&stencil  wrapper.html?colors.png # Bug 844439
-random-if(gtk2Widget) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?aa&alpha&_____&_______&preserve&stencil  wrapper.html?colors.png # Bug 844439
-random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?__&_____&depth&_______&preserve&stencil  wrapper.html?colors.png # Bug 844439
-random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?aa&_____&depth&_______&preserve&stencil  wrapper.html?colors.png # Bug 844439
-random-if(gtk2Widget) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?__&alpha&depth&_______&preserve&stencil  wrapper.html?colors.png # Bug 844439
-random-if(gtk2Widget) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?aa&alpha&depth&_______&preserve&stencil  wrapper.html?colors.png # Bug 844439
-random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?__&_____&_____&premult&preserve&stencil  wrapper.html?colors.png # Bug 844439
-random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?aa&_____&_____&premult&preserve&stencil  wrapper.html?colors.png # Bug 844439
-random-if(gtk2Widget) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?__&alpha&_____&premult&preserve&stencil  wrapper.html?colors.png # Bug 844439
-random-if(gtk2Widget) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?aa&alpha&_____&premult&preserve&stencil  wrapper.html?colors.png # Bug 844439
-random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?__&_____&depth&premult&preserve&stencil  wrapper.html?colors.png # Bug 844439
-random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?aa&_____&depth&premult&preserve&stencil  wrapper.html?colors.png # Bug 844439
-random-if(gtk2Widget) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?__&alpha&depth&premult&preserve&stencil  wrapper.html?colors.png # Bug 844439
-random-if(gtk2Widget) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?aa&alpha&depth&premult&preserve&stencil  wrapper.html?colors.png # Bug 844439
-
+                                                                                                         == webgl-color-test.html?frame=6&__&________&_______&_____  wrapper.html?colors-no-alpha.png
+                                                                                                         == webgl-color-test.html?frame=6&aa&________&_______&_____  wrapper.html?colors-no-alpha.png
+                                                                                                         == webgl-color-test.html?frame=6&__&preserve&_______&_____  wrapper.html?colors-no-alpha.png
+fails-if(winWidget&&layersGPUAccelerated&&d2d)                                                           == webgl-color-test.html?frame=6&aa&preserve&_______&_____  wrapper.html?colors-no-alpha.png
+                                                                                                         == webgl-color-test.html?frame=6&__&________&premult&_____  wrapper.html?colors-no-alpha.png
+                                                                                                         == webgl-color-test.html?frame=6&aa&________&premult&_____  wrapper.html?colors-no-alpha.png
+                                                                                                         == webgl-color-test.html?frame=6&__&preserve&premult&_____  wrapper.html?colors-no-alpha.png
+fails-if(winWidget&&layersGPUAccelerated&&d2d)                                                           == webgl-color-test.html?frame=6&aa&preserve&premult&_____  wrapper.html?colors-no-alpha.png
+fuzzy(1,30000) fails-if(gtk2Widget&&browserIsRemote) fails-if(winWidget&&layersGPUAccelerated&&!d2d)     == webgl-color-test.html?frame=6&__&________&_______&alpha  wrapper.html?colors-non-premult.png
+fuzzy(1,30000) fails-if(gtk2Widget&&browserIsRemote) fails-if(winWidget&&layersGPUAccelerated&&!d2d)     == webgl-color-test.html?frame=6&aa&________&_______&alpha  wrapper.html?colors-non-premult.png
+fuzzy(1,30000) fails-if(gtk2Widget&&browserIsRemote) fails-if(winWidget&&layersGPUAccelerated&&!d2d)     == webgl-color-test.html?frame=6&__&preserve&_______&alpha  wrapper.html?colors-non-premult.png
+fuzzy(1,30000) fails-if(gtk2Widget&&browserIsRemote) fails-if(winWidget&&(!layersGPUAccelerated||!d2d))  == webgl-color-test.html?frame=6&aa&preserve&_______&alpha  wrapper.html?colors-non-premult.png
+                                                                                                         == webgl-color-test.html?frame=6&__&________&premult&alpha  wrapper.html?colors-premult.png
+                                                                                                         == webgl-color-test.html?frame=6&aa&________&premult&alpha  wrapper.html?colors-premult.png
+                                                                                                         == webgl-color-test.html?frame=6&__&preserve&premult&alpha  wrapper.html?colors-premult.png
+                                                                                                         == webgl-color-test.html?frame=6&aa&preserve&premult&alpha  wrapper.html?colors-premult.png
 
-# Check a smaller selection for readback:
-pref(webgl.force-layers-readback,true) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?readback&__&_____&________  wrapper.html?colors.png # Bug 844439
-pref(webgl.force-layers-readback,true) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?readback&aa&_____&________  wrapper.html?colors.png # Bug 844439
-random-if(gtk2Widget) pref(webgl.force-layers-readback,true) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?readback&__&alpha&________  wrapper.html?colors.png # Bug 844439
-random-if(gtk2Widget) pref(webgl.force-layers-readback,true) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?readback&aa&alpha&________  wrapper.html?colors.png # Bug 844439
-pref(webgl.force-layers-readback,true) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?readback&__&_____&preserve  wrapper.html?colors.png # Bug 844439
-pref(webgl.force-layers-readback,true) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?readback&aa&_____&preserve  wrapper.html?colors.png # Bug 844439
-random-if(gtk2Widget) pref(webgl.force-layers-readback,true) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?readback&__&alpha&preserve  wrapper.html?colors.png # Bug 844439
-random-if(gtk2Widget) pref(webgl.force-layers-readback,true) random-if(B2G) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?readback&aa&alpha&preserve  wrapper.html?colors.png # Bug 844439
-
-
-# Check alpha behavior:
-fuzzy-if(B2G,256,83) random-if(Android&&AndroidVersion<15)  == webgl-color-alpha-test.html?colorVal=1.0&alphaVal=1.0  wrapper.html?colors.png
-# These tests don't use wrapper.html, as there appear to be invalidation issues with black.png and async image decoding - Bug 803299
-random-if(Android&&AndroidVersion<15)  == webgl-color-alpha-test.html?colorVal=0.0&alphaVal=1.0  black.html
-
-fuzzy-if(B2G,256,83) random-if(Android&&AndroidVersion<15)  == webgl-color-alpha-test.html?colorVal=1.0&alphaVal=0.0        wrapper.html?colors.png
-random-if(Android&&AndroidVersion<15)  == webgl-color-alpha-test.html?colorVal=1.0&alphaVal=0.0&alpha  wrapper.html?white.png
+                                                                                                        pref(webgl.force-layers-readback,true)  == webgl-color-test.html?frame=1&readback&__&________&_______&_____  wrapper.html?colors-no-alpha.png
+                                                                                                        pref(webgl.force-layers-readback,true)  == webgl-color-test.html?frame=1&readback&aa&________&_______&_____  wrapper.html?colors-no-alpha.png
+                                                                                                        pref(webgl.force-layers-readback,true)  == webgl-color-test.html?frame=1&readback&__&preserve&_______&_____  wrapper.html?colors-no-alpha.png
+                                                                                                        pref(webgl.force-layers-readback,true)  == webgl-color-test.html?frame=1&readback&aa&preserve&_______&_____  wrapper.html?colors-no-alpha.png
+                                                                                                        pref(webgl.force-layers-readback,true)  == webgl-color-test.html?frame=1&readback&__&________&premult&_____  wrapper.html?colors-no-alpha.png
+                                                                                                        pref(webgl.force-layers-readback,true)  == webgl-color-test.html?frame=1&readback&aa&________&premult&_____  wrapper.html?colors-no-alpha.png
+                                                                                                        pref(webgl.force-layers-readback,true)  == webgl-color-test.html?frame=1&readback&__&preserve&premult&_____  wrapper.html?colors-no-alpha.png
+                                                                                                        pref(webgl.force-layers-readback,true)  == webgl-color-test.html?frame=1&readback&aa&preserve&premult&_____  wrapper.html?colors-no-alpha.png
+fuzzy(1,30000) fails-if(gtk2Widget&&browserIsRemote) fails-if(winWidget&&layersGPUAccelerated&&!d2d)    pref(webgl.force-layers-readback,true)  == webgl-color-test.html?frame=1&readback&__&________&_______&alpha  wrapper.html?colors-non-premult.png
+fuzzy(1,30000) fails-if(gtk2Widget&&browserIsRemote) fails-if(winWidget&&layersGPUAccelerated&&!d2d)    pref(webgl.force-layers-readback,true)  == webgl-color-test.html?frame=1&readback&aa&________&_______&alpha  wrapper.html?colors-non-premult.png
+fuzzy(1,30000) fails-if(gtk2Widget&&browserIsRemote) fails-if(winWidget&&layersGPUAccelerated&&!d2d)    pref(webgl.force-layers-readback,true)  == webgl-color-test.html?frame=1&readback&__&preserve&_______&alpha  wrapper.html?colors-non-premult.png
+fuzzy(1,30000) fails-if(gtk2Widget&&browserIsRemote) fails-if(winWidget&&layersGPUAccelerated&&!d2d)    pref(webgl.force-layers-readback,true)  == webgl-color-test.html?frame=1&readback&aa&preserve&_______&alpha  wrapper.html?colors-non-premult.png
+                                                                                                        pref(webgl.force-layers-readback,true)  == webgl-color-test.html?frame=1&readback&__&________&premult&alpha  wrapper.html?colors-premult.png
+                                                                                                        pref(webgl.force-layers-readback,true)  == webgl-color-test.html?frame=1&readback&aa&________&premult&alpha  wrapper.html?colors-premult.png
+                                                                                                        pref(webgl.force-layers-readback,true)  == webgl-color-test.html?frame=1&readback&__&preserve&premult&alpha  wrapper.html?colors-premult.png
+                                                                                                        pref(webgl.force-layers-readback,true)  == webgl-color-test.html?frame=1&readback&aa&preserve&premult&alpha  wrapper.html?colors-premult.png
 
-fuzzy(1,65536) fuzzy-if(B2G,256,83) fuzzy-if(Android||B2G,9,65536) random-if(Android&&AndroidVersion<15)  == webgl-color-alpha-test.html?colorVal=0.5&alphaVal=1.0  wrapper.html?half-colors.png
-
-# Test premult:
-# random-if(B2G) from bug 983650
-# Mark as failing on WinXP (winWidget&&!d2d), because Try said so. WFM outside of Try.
-# This might work on WinXP again if OMTC is disabled.
-fuzzy(1,65536) random-if(gtk2Widget) random-if(winWidget&&!d2d) random-if(B2G) fuzzy-if(Android,9,65536) random-if(Android&&AndroidVersion<15)  == webgl-color-alpha-test.html?colorVal=1.0&alphaVal=0.5&alpha          wrapper.html?colors-half-alpha.png
-fuzzy(1,65536) random-if(gtk2Widget) fails-if(winWidget&&!d2d)                 fuzzy-if(Android,9,65536) random-if(Android&&AndroidVersion<15)  == webgl-color-alpha-test.html?colorVal=0.5&alphaVal=0.5&alpha          wrapper.html?half-colors-half-alpha.png
-# random-if(B2G) from bug 983650
-fuzzy(1,65536)                       random-if(B2G) fuzzy-if(Android,9,65536) random-if(Android&&AndroidVersion<15)  == webgl-color-alpha-test.html?colorVal=0.5&alphaVal=0.5&alpha&premult  wrapper.html?colors-half-alpha.png
+                                                                                                        pref(webgl.force-layers-readback,true)  == webgl-color-test.html?frame=6&readback&__&________&_______&_____  wrapper.html?colors-no-alpha.png
+                                                                                                        pref(webgl.force-layers-readback,true)  == webgl-color-test.html?frame=6&readback&aa&________&_______&_____  wrapper.html?colors-no-alpha.png
+                                                                                                        pref(webgl.force-layers-readback,true)  == webgl-color-test.html?frame=6&readback&__&preserve&_______&_____  wrapper.html?colors-no-alpha.png
+fails-if(winWidget&&layersGPUAccelerated&&d2d)                                                          pref(webgl.force-layers-readback,true)  == webgl-color-test.html?frame=6&readback&aa&preserve&_______&_____  wrapper.html?colors-no-alpha.png
+                                                                                                        pref(webgl.force-layers-readback,true)  == webgl-color-test.html?frame=6&readback&__&________&premult&_____  wrapper.html?colors-no-alpha.png
+                                                                                                        pref(webgl.force-layers-readback,true)  == webgl-color-test.html?frame=6&readback&aa&________&premult&_____  wrapper.html?colors-no-alpha.png
+                                                                                                        pref(webgl.force-layers-readback,true)  == webgl-color-test.html?frame=6&readback&__&preserve&premult&_____  wrapper.html?colors-no-alpha.png
+random-if(winWidget&&layersGPUAccelerated&&d2d)                                                         pref(webgl.force-layers-readback,true)  == webgl-color-test.html?frame=6&readback&aa&preserve&premult&_____  wrapper.html?colors-no-alpha.png
+fuzzy(1,30000) fails-if(gtk2Widget&&browserIsRemote) fails-if(winWidget&&layersGPUAccelerated&&!d2d)    pref(webgl.force-layers-readback,true)  == webgl-color-test.html?frame=6&readback&__&________&_______&alpha  wrapper.html?colors-non-premult.png
+fuzzy(1,30000) fails-if(gtk2Widget&&browserIsRemote) fails-if(winWidget&&layersGPUAccelerated&&!d2d)    pref(webgl.force-layers-readback,true)  == webgl-color-test.html?frame=6&readback&aa&________&_______&alpha  wrapper.html?colors-non-premult.png
+fuzzy(1,30000) fails-if(gtk2Widget&&browserIsRemote) fails-if(winWidget&&layersGPUAccelerated&&!d2d)    pref(webgl.force-layers-readback,true)  == webgl-color-test.html?frame=6&readback&__&preserve&_______&alpha  wrapper.html?colors-non-premult.png
+fuzzy(1,30000) fails-if(gtk2Widget&&browserIsRemote) fails-if(winWidget&&(!layersGPUAccelerated||!d2d)) pref(webgl.force-layers-readback,true)  == webgl-color-test.html?frame=6&readback&aa&preserve&_______&alpha  wrapper.html?colors-non-premult.png
+                                                                                                        pref(webgl.force-layers-readback,true)  == webgl-color-test.html?frame=6&readback&__&________&premult&alpha  wrapper.html?colors-premult.png
+                                                                                                        pref(webgl.force-layers-readback,true)  == webgl-color-test.html?frame=6&readback&aa&________&premult&alpha  wrapper.html?colors-premult.png
+                                                                                                        pref(webgl.force-layers-readback,true)  == webgl-color-test.html?frame=6&readback&__&preserve&premult&alpha  wrapper.html?colors-premult.png
+                                                                                                        pref(webgl.force-layers-readback,true)  == webgl-color-test.html?frame=6&readback&aa&preserve&premult&alpha  wrapper.html?colors-premult.png
 
-# Check for hanging framebuffer bindings:
-                                       random-if(Android&&AndroidVersion<15)  == webgl-hanging-fb-test.html?__&________  wrapper.html?green.png
-                                       random-if(Android&&AndroidVersion<15)  == webgl-hanging-fb-test.html?aa&________  wrapper.html?green.png
-pref(webgl.force-layers-readback,true) random-if(Android&&AndroidVersion<15)  == webgl-hanging-fb-test.html?__&readback  wrapper.html?green.png
-pref(webgl.force-layers-readback,true) random-if(Android&&AndroidVersion<15)  == webgl-hanging-fb-test.html?aa&readback  wrapper.html?green.png
+# Check for hanging bindings/state settings:
+== webgl-hanging-fb-test.html?__&________  wrapper.html?green.png
+== webgl-hanging-fb-test.html?aa&________  wrapper.html?green.png
+== webgl-hanging-fb-test.html?__&preserve  wrapper.html?green.png
+== webgl-hanging-fb-test.html?aa&preserve  wrapper.html?green.png
+pref(webgl.force-layers-readback,true)  == webgl-hanging-fb-test.html?readback&__&________  wrapper.html?green.png
+pref(webgl.force-layers-readback,true)  == webgl-hanging-fb-test.html?readback&aa&________  wrapper.html?green.png
+pref(webgl.force-layers-readback,true)  == webgl-hanging-fb-test.html?readback&__&preserve  wrapper.html?green.png
+pref(webgl.force-layers-readback,true)  == webgl-hanging-fb-test.html?readback&aa&preserve  wrapper.html?green.png
 
-                                       random-if(Android&&AndroidVersion<15)  == webgl-hanging-scissor-test.html?__&________  wrapper.html?green.png
-                                       random-if(Android&&AndroidVersion<15)  == webgl-hanging-scissor-test.html?aa&________  wrapper.html?green.png
-pref(webgl.force-layers-readback,true) random-if(Android&&AndroidVersion<15)  == webgl-hanging-scissor-test.html?__&readback  wrapper.html?green.png
-pref(webgl.force-layers-readback,true) random-if(Android&&AndroidVersion<15)  == webgl-hanging-scissor-test.html?aa&readback  wrapper.html?green.png
+== webgl-hanging-scissor-test.html?__  wrapper.html?green.png
+== webgl-hanging-scissor-test.html?aa  wrapper.html?green.png
+pref(webgl.force-layers-readback,true)  == webgl-hanging-scissor-test.html?readback&__  wrapper.html?green.png
+pref(webgl.force-layers-readback,true)  == webgl-hanging-scissor-test.html?readback&aa  wrapper.html?green.png
 
 
 # Check that our experimental prefs still work:
 
-# 16bpp:
-skip-if(winWidget) pref(webgl.prefer-16bpp,true)                                        random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?16bpp           wrapper.html?colors.png
-skip-if(winWidget) pref(webgl.prefer-16bpp,true) pref(webgl.force-layers-readback,true) random-if(Android&&AndroidVersion<15)  == webgl-color-test.html?16bpp&readback  wrapper.html?colors.png
+# 16bpp for Android/B2G: [16bpp] * PowerSet([readback, premult, alpha])
+# RGB565 dithers 127 to [123,132]. (Max error: 5)
+# RGBA4444 dithers 128 to [119,136], and 191 to [192]. (Max error: 9)
+fuzzy(5,30000) skip-if(!(Android||B2G)) pref(webgl.prefer-16bpp,true)                                         == webgl-color-test.html?16bpp&________&_______&_____  wrapper.html?colors-no-alpha.png
+fuzzy(5,30000) skip-if(!(Android||B2G)) pref(webgl.prefer-16bpp,true) pref(webgl.force-layers-readback,true)  == webgl-color-test.html?16bpp&readback&_______&_____  wrapper.html?colors-no-alpha.png
+fuzzy(5,30000) skip-if(!(Android||B2G)) pref(webgl.prefer-16bpp,true)                                         == webgl-color-test.html?16bpp&________&premult&_____  wrapper.html?colors-no-alpha.png
+fuzzy(5,30000) skip-if(!(Android||B2G)) pref(webgl.prefer-16bpp,true) pref(webgl.force-layers-readback,true)  == webgl-color-test.html?16bpp&readback&premult&_____  wrapper.html?colors-no-alpha.png
+fuzzy(9,40000) skip-if(!(Android||B2G)) pref(webgl.prefer-16bpp,true)                                         == webgl-color-test.html?16bpp&________&_______&alpha  wrapper.html?colors-non-premult.png
+fuzzy(9,40000) skip-if(!(Android||B2G)) pref(webgl.prefer-16bpp,true) pref(webgl.force-layers-readback,true)  == webgl-color-test.html?16bpp&readback&_______&alpha  wrapper.html?colors-non-premult.png
+fuzzy(9,40000) skip-if(!(Android||B2G)) pref(webgl.prefer-16bpp,true)                                         == webgl-color-test.html?16bpp&________&premult&alpha  wrapper.html?colors-premult.png
+fuzzy(9,40000) skip-if(!(Android||B2G)) pref(webgl.prefer-16bpp,true) pref(webgl.force-layers-readback,true)  == webgl-color-test.html?16bpp&readback&premult&alpha  wrapper.html?colors-premult.png
 
 # Force native GL (Windows):
-skip-if(!winWidget) pref(webgl.disable-angle,true)                                == webgl-clear-test.html?native-gl        wrapper.html?green.png
-skip-if(!winWidget) pref(webgl.disable-angle,true)                                == webgl-orientation-test.html?native-gl  wrapper.html?white-top-left.png
-skip-if(!winWidget) pref(webgl.disable-angle,true)                                == webgl-color-test.html?native-gl        wrapper.html?colors.png
-skip-if(!winWidget) pref(webgl.disable-angle,true) pref(webgl.prefer-16bpp,true)  == webgl-color-test.html?native-gl&16bpp  wrapper.html?colors.png
+skip-if(!winWidget) pref(webgl.disable-angle,true)  == webgl-color-test.html?native-gl  wrapper.html?colors-no-alpha.png
 
 
 # Non-WebGL Reftests!
 
 # Do we correctly handle multiple clip paths?
 != clip-multiple-paths.html clip-multiple-paths-badref.html
 
 # Bug 815648
--- a/dom/canvas/test/reftest/webgl-clear-test.html
+++ b/dom/canvas/test/reftest/webgl-clear-test.html
@@ -1,50 +1,40 @@
 <!DOCTYPE html>
-<html class="reftest-wait">
-<head>
-<meta charset="UTF-8">
+<meta charset='UTF-8'>
+<!--
+Clear the canvas to green to test that we get pixels to the screen.
 
-<script type="text/javascript" src="webgl-utils.js"></script>
-<script type="text/javascript">
-/* Clear Test
- *
- * Clear the canvas to green to test that we get pixels to the screen.
- */
+If this fails, something is seriously wrong.
+-->
+<html>
 
-"use strict";
+<head>
+  <script type='text/javascript' src='webgl-utils.js'></script>
+  <script type='text/javascript'>
+'use strict';
 
-function renderGL(gl) {
-  gl.clearColor(0.0, 1.0, 0.0, 1.0);
-  gl.clear(gl.COLOR_BUFFER_BIT);
-  gl.finish();
-}
-
-function renderFailure(canvas) {
-  // This will also trigger RAF for us.
-  var context = canvas.getContext("2d");
-  context.fillText('WebGL failed.', 64, 64);
+function setStatus(text) {
+  var elem = document.getElementById('status');
+  elem.innerHTML = text;
 }
 
 function runTest() {
-  var canvas = document.getElementById("canvas");
-  var gl = initGL(canvas);
-
-  if (gl)
-    renderGL(gl);
-  else
-    renderFailure(canvas);
+  var canvas = document.getElementById('canvas');
 
-  waitForComposite(testComplete);
-}
+  var gl = initGL(canvas);
+  if (!gl) {
+    setStatus('WebGL context creation failed.');
+    return;
+  }
 
-function testComplete() {
-  document.documentElement.removeAttribute("class");
+  gl.clearColor(0.0, 1.0, 0.0, 1.0);
+  gl.clear(gl.COLOR_BUFFER_BIT);
 }
-
-</script>
+  </script>
 </head>
 
-<body onload="rAF(runTest);">
-  <canvas id="canvas" width="256" height="256"></canvas>
+<body onload='runTest();'>
+  <canvas id='canvas' width='256' height='256'></canvas>
+  <div id='status'></div>
 </body>
 
 </html>
deleted file mode 100644
--- a/dom/canvas/test/reftest/webgl-color-alpha-test.html
+++ /dev/null
@@ -1,81 +0,0 @@
-<!DOCTYPE html>
-<html class="reftest-wait">
-<head>
-<meta charset="UTF-8">
-
-<script type="text/javascript" src="webgl-utils.js"></script>
-<script type="text/javascript">
-/* Color-Alpha Test
- *
- * Clear the four quadrants of the canvas as follows:
- * +------+------+
- * | red  |green |
- * |      |      |
- * +------+------+
- * | blue |white |
- * |      |      |
- * +------+------+
- * However, unlike the Color test, clear with a given alpha value.
- * What effect this has depends on the context-creation args passed
- * to this page.
- *
- * Here we check that we handle various combinations of alpha and
- * premultipliedAlpha correctly.
- */
-
-"use strict";
-
-function renderGL(gl, value, alpha) {
-  gl.enable(gl.SCISSOR_TEST);
-
-  gl.scissor(0, 128, 128, 128);
-  gl.clearColor(value, 0.0, 0.0, alpha);
-  gl.clear(gl.COLOR_BUFFER_BIT);
-
-  gl.scissor(128, 128, 128, 128);
-  gl.clearColor(0.0, value, 0.0, alpha);
-  gl.clear(gl.COLOR_BUFFER_BIT);
-
-  gl.scissor(0, 0, 128, 128);
-  gl.clearColor(0.0, 0.0, value, alpha);
-  gl.clear(gl.COLOR_BUFFER_BIT);
-
-  gl.scissor(128, 0, 128, 128);
-  gl.clearColor(value, value, value, alpha);
-  gl.clear(gl.COLOR_BUFFER_BIT);
-
-  gl.finish();
-}
-
-function renderFailure(canvas) {
-  // This will also trigger RAF for us.
-  var context = canvas.getContext("2d");
-  context.fillText('WebGL failed.', 64, 64);
-}
-
-function runTest() {
-  var canvas = document.getElementById("canvas");
-  var gl = initGL(canvas);
-
-  var value = arg("colorVal");
-  var alpha = arg("alphaVal");
-
-  if (gl)
-    renderGL(gl, value, alpha);
-  else
-    renderFailure(canvas);
-
-  waitForComposite(testComplete);
-}
-
-function testComplete() {
-  document.documentElement.removeAttribute("class");
-}
-</script>
-</head>
-
-<body onload="rAF(runTest);">
-  <canvas id="canvas" width="256" height="256"></canvas>
-</body>
-
-</html>
--- a/dom/canvas/test/reftest/webgl-color-test.html
+++ b/dom/canvas/test/reftest/webgl-color-test.html
@@ -1,76 +1,123 @@
 <!DOCTYPE html>
-<html class="reftest-wait">
-<head>
-<meta charset="UTF-8">
+<meta charset='UTF-8'>
+<!--
+Color Test
+
+Clear the four quadrants of the canvas as follows:
++------+------+
+| blue |black |
+|      |      |
++------+------+
+| red  |green |
+|      |      |
++------+------+
 
-<script type="text/javascript" src="webgl-utils.js"></script>
-<script type="text/javascript">
-/* Color Test
- *
- * Clear the four quadrants of the canvas as follows:
- * +------+------+
- * | red  |green |
- * |      |      |
- * +------+------+
- * | blue |white |
- * |      |      |
- * +------+------+
- *
- * This is for checking that we're getting the right colors when
- * we ask for them. This combined with the Orientation test assure
- * that we are getting the correct colors in the correct places.
- */
+Clear with a given alpha value. What effect this has depends on the
+context-creation args passed to this page.
+-->
+<html class='reftest-wait'>
 
-"use strict";
+<head>
+  <script type='text/javascript' src='webgl-utils.js'></script>
+  <script type='text/javascript'>
+'use strict';
 
-function renderGL(gl) {
+var COLOR_VALUE = 127.0 / 255.0;
+var ALPHA_VALUE = 127.0 / 255.0;
+
+function renderFrame(gl) {
   gl.enable(gl.SCISSOR_TEST);
 
-  gl.scissor(0, 128, 128, 128);
-  gl.clearColor(1.0, 0.0, 0.0, 1.0);
+  gl.scissor(0, 0, 100, 100);
+  gl.clearColor(COLOR_VALUE, 0.0, 0.0, ALPHA_VALUE);
   gl.clear(gl.COLOR_BUFFER_BIT);
 
-  gl.scissor(128, 128, 128, 128);
-  gl.clearColor(0.0, 1.0, 0.0, 1.0);
+  gl.scissor(100, 0, 100, 100);
+  gl.clearColor(0.0, COLOR_VALUE, 0.0, ALPHA_VALUE);
   gl.clear(gl.COLOR_BUFFER_BIT);
 
-  gl.scissor(0, 0, 128, 128);
-  gl.clearColor(0.0, 0.0, 1.0, 1.0);
+  gl.scissor(0, 100, 100, 100);
+  gl.clearColor(0.0, 0.0, COLOR_VALUE, ALPHA_VALUE);
   gl.clear(gl.COLOR_BUFFER_BIT);
 
-  gl.scissor(128, 0, 128, 128);
-  gl.clearColor(1.0, 1.0, 1.0, 1.0);
+  gl.scissor(100, 100, 100, 100);
+  gl.clearColor(0.0, 0.0, 0.0, ALPHA_VALUE);
   gl.clear(gl.COLOR_BUFFER_BIT);
+}
 
-  gl.finish();
+////////////////////////////////////////////////////////////////////////////////
+// Boilerplate
+
+var TIMEOUT_MS = 10 * 1000;
+
+function setStatus(text) {
+  var elem = document.getElementById('status');
+  elem.innerHTML = text;
 }
 
-function renderFailure(canvas) {
-  // This will also trigger RAF for us.
-  var context = canvas.getContext("2d");
-  context.fillText('WebGL failed.', 64, 64);
+var gIsComplete = false;
+
+function markComplete(statusText) {
+  if (!statusText)
+    statusText = '';
+
+  if (gIsComplete)
+    return;
+  gIsComplete = true;
+
+  setStatus(statusText);
+  document.documentElement.removeAttribute('class');
+}
+
+function markError(text) {
+  markComplete('Error: ' + text);
+}
+
+function markTimedOut() {
+  markError('Timed out waiting on test completion.');
+}
+
+function runFrame(gl, frameCount, maxFrameCount) {
+  renderFrame(gl);
+  frameCount++;
+
+  if (frameCount >= maxFrameCount) {
+    console.log('Rendered ' + frameCount + ' frames.');
+    markComplete();
+    return;
+  }
+
+  requestAnimationFrame(function(){
+    runFrame(gl, frameCount, maxFrameCount);
+  });
 }
 
 function runTest() {
-  var canvas = document.getElementById("canvas");
-  var gl = initGL(canvas);
+  var canvas = document.getElementById('canvas');
 
-  if (gl)
-    renderGL(gl);
-  else
-    renderFailure(canvas);
+  var gl = initGL(canvas);
+  if (!gl) {
+    markError('WebGL context creation failed.');
+    return;
+  }
 
-  waitForComposite(testComplete);
-}
+  var maxFrameCount = arg('frame', 1);
+  if (maxFrameCount < 1) {
+    markError('Invalid `frame` arg: ' + maxFrameCount);
+    return;
+  }
 
-function testComplete() {
-  document.documentElement.removeAttribute("class");
+  setStatus('Waiting...');
+
+  runFrame(gl, 0, maxFrameCount);
+  setTimeout(markTimedOut, TIMEOUT_MS);
 }
-</script>
+  </script>
 </head>
 
-<body onload="rAF(runTest);">
-  <canvas id="canvas" width="256" height="256"></canvas>
+<body onload='runTest();'>
+  <canvas id='canvas' width='200' height='200'></canvas>
+  <div id='status'></div>
 </body>
 
 </html>
deleted file mode 100644
--- a/dom/canvas/test/reftest/webgl-orientation-test.html
+++ /dev/null
@@ -1,57 +0,0 @@
-<!DOCTYPE html>
-<html class="reftest-wait">
-<head>
-<meta charset="UTF-8">
-
-<script type="text/javascript" src="webgl-utils.js"></script>
-<script type="text/javascript">
-/* Orientation Test
- *
- * Clear the canvas to black, and clear the upper-left quadrant
- * to white. If this doesn't pass, but the Clear test does, then
- * likely y-flip is wrong.
- */
-
-"use strict";
-
-function renderGL(gl) {
-  gl.clearColor(0.0, 0.0, 0.0, 1.0);
-  gl.clear(gl.COLOR_BUFFER_BIT);
-
-  gl.enable(gl.SCISSOR_TEST);
-  gl.scissor(0, 128, 128, 128);
-  gl.clearColor(1.0, 1.0, 1.0, 1.0);
-  gl.clear(gl.COLOR_BUFFER_BIT);
-
-  gl.finish();
-}
-
-function renderFailure(canvas) {
-  // This will also trigger RAF for us.
-  var context = canvas.getContext("2d");
-  context.fillText('WebGL failed.', 64, 64);
-}
-
-function runTest() {
-  var canvas = document.getElementById("canvas");
-  var gl = initGL(canvas);
-
-  if (gl)
-    renderGL(gl);
-  else
-    renderFailure(canvas);
-
-  waitForComposite(testComplete);
-}
-
-function testComplete() {
-  document.documentElement.removeAttribute("class");
-}
-</script>
-</head>
-
-<body onload="rAF(runTest);">
-  <canvas id="canvas" width="256" height="256"></canvas>
-</body>
-
-</html>
--- a/dom/canvas/test/reftest/webgl-utils.js
+++ b/dom/canvas/test/reftest/webgl-utils.js
@@ -17,40 +17,39 @@ function parseArgs() {
 
     args[key] = value;
   }
 
   return args;
 }
 
 var gArgs = null;
-function arg(key) {
+function arg(key, defaultVal) {
   if (gArgs === null) {
     gArgs = parseArgs();
   }
 
-  var ret = gArgs[key];
-  if (ret === undefined)
-    ret = false;
+  if (!(key in gArgs))
+    return defaultVal;
 
-  return ret;
+  return gArgs[key];
 }
 
 function initGL(canvas) {
   if (arg("nogl"))
     return null;
 
   var gl = null;
 
-  var withAA = arg("aa");
-  var withAlpha = arg("alpha");
-  var withDepth = arg("depth");
-  var withPremult = arg("premult");
-  var withPreserve = arg("preserve");
-  var withStencil = arg("stencil");
+  var withAA = arg("aa", false);
+  var withAlpha = arg("alpha", false);
+  var withDepth = arg("depth", false);
+  var withPremult = arg("premult", false);
+  var withPreserve = arg("preserve", false);
+  var withStencil = arg("stencil", false);
 
   try {
     var argDict = {
       alpha: withAlpha,
       depth: withDepth,
       stencil: withStencil,
       antialias: withAA,
       premultipliedAlpha: withPremult,
deleted file mode 100644
index 224b193a5ec4d4f76d7dfc5bb8fa843336970a5f..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
GIT binary patch
literal 0
Hc$@<O00001
--- a/gfx/gl/GLScreenBuffer.cpp
+++ b/gfx/gl/GLScreenBuffer.cpp
@@ -447,17 +447,26 @@ GLScreenBuffer::Swap(const gfx::IntSize&
     }
 
     if (ShouldPreserveBuffer() &&
         mFront &&
         mBack)
     {
         auto src  = mFront->Surf();
         auto dest = mBack->Surf();
+
+        //uint32_t srcPixel = ReadPixel(src);
+        //uint32_t destPixel = ReadPixel(dest);
+        //printf_stderr("Before: src: 0x%08x, dest: 0x%08x\n", srcPixel, destPixel);
+
         SharedSurface::ProdCopy(src, dest, mFactory.get());
+
+        //srcPixel = ReadPixel(src);
+        //destPixel = ReadPixel(dest);
+        //printf_stderr("After: src: 0x%08x, dest: 0x%08x\n", srcPixel, destPixel);
     }
 
     return true;
 }
 
 bool
 GLScreenBuffer::PublishFrame(const gfx::IntSize& size)
 {
--- a/gfx/gl/SharedSurface.cpp
+++ b/gfx/gl/SharedSurface.cpp
@@ -548,10 +548,30 @@ ReadbackSharedSurface(SharedSurface* src
                 rowItr += 4;
             }
         }
     }
 
     return true;
 }
 
+uint32_t
+ReadPixel(SharedSurface* src)
+{
+    GLContext* gl = src->mGL;
+
+    uint32_t pixel;
+
+    ScopedReadbackFB a(src);
+    {
+        ScopedPackAlignment autoAlign(gl, 4);
+
+        UniquePtr<uint8_t[]> bytes(new uint8_t[4]);
+        gl->raw_fReadPixels(0, 0, 1, 1, LOCAL_GL_RGBA, LOCAL_GL_UNSIGNED_BYTE,
+                            bytes.get());
+        memcpy(&pixel, bytes.get(), 4);
+    }
+
+    return pixel;
+}
+
 } /* namespace gfx */
 } /* namespace mozilla */
--- a/gfx/gl/SharedSurface.h
+++ b/gfx/gl/SharedSurface.h
@@ -284,13 +284,14 @@ class ScopedReadbackFB
     SharedSurface* mSurfToLock;
 
 public:
     explicit ScopedReadbackFB(SharedSurface* src);
     ~ScopedReadbackFB();
 };
 
 bool ReadbackSharedSurface(SharedSurface* src, gfx::DrawTarget* dst);
+uint32_t ReadPixel(SharedSurface* src);
 
 } // namespace gl
 } // namespace mozilla
 
 #endif // SHARED_SURFACE_H_