Bug 821191 - Switch recent files from accidental windows line endings to unix line endings - r=bjacob
authorJeff Gilbert <jgilbert@mozilla.com>
Mon, 17 Dec 2012 17:58:44 -0800
changeset 125473 664be99e44f62668138aea79a5f3a33ef103fb78
parent 125472 ab006da8f88df746b52eeb1d580b1aa21a6ccf8c
child 125474 d65f28340dd95357d07e15f94fa2fc67d695e5b0
push id2151
push userlsblakk@mozilla.com
push dateTue, 19 Feb 2013 18:06:57 +0000
treeherdermozilla-beta@4952e88741ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbjacob
bugs821191
milestone20.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 821191 - Switch recent files from accidental windows line endings to unix line endings - r=bjacob
content/canvas/test/reftest/reftest.list
gfx/gl/GLContextTypes.h
gfx/gl/GLTextureImage.h
--- a/content/canvas/test/reftest/reftest.list
+++ b/content/canvas/test/reftest/reftest.list
@@ -1,188 +1,188 @@
-# WebGL Reftests!
-# If you add new tests, don't forget to add sanity (&nogl) tests! (if needed)
-
-# 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
-
-# Basic WebGL tests:
-# Do we get pixels to the screen at all?
-# Try to just hit the different rendering paths here.
-# Test: {aa, alpha, preserve, readback} = 16
-== webgl-clear-test.html?nogl  wrapper.html?green.png
-
-== webgl-clear-test.html?__&_____&________  wrapper.html?green.png
-== webgl-clear-test.html?aa&_____&________  wrapper.html?green.png
-== webgl-clear-test.html?__&alpha&________  wrapper.html?green.png
-== webgl-clear-test.html?aa&alpha&________  wrapper.html?green.png
-== webgl-clear-test.html?__&_____&preserve  wrapper.html?green.png
-== webgl-clear-test.html?aa&_____&preserve  wrapper.html?green.png
-== webgl-clear-test.html?__&alpha&preserve  wrapper.html?green.png
-== webgl-clear-test.html?aa&alpha&preserve  wrapper.html?green.png
-
-pref(webgl.force-layers-readback,true) fails-if(nativeFennec)  == webgl-clear-test.html?readback&__&_____&________  wrapper.html?green.png
-pref(webgl.force-layers-readback,true) fails-if(nativeFennec)  == webgl-clear-test.html?readback&aa&_____&________  wrapper.html?green.png
-pref(webgl.force-layers-readback,true)                         == webgl-clear-test.html?readback&__&alpha&________  wrapper.html?green.png
-pref(webgl.force-layers-readback,true)                         == webgl-clear-test.html?readback&aa&alpha&________  wrapper.html?green.png
-pref(webgl.force-layers-readback,true) fails-if(nativeFennec)  == webgl-clear-test.html?readback&__&_____&preserve  wrapper.html?green.png
-pref(webgl.force-layers-readback,true) fails-if(nativeFennec)  == webgl-clear-test.html?readback&aa&_____&preserve  wrapper.html?green.png
-pref(webgl.force-layers-readback,true)                         == webgl-clear-test.html?readback&__&alpha&preserve  wrapper.html?green.png
-pref(webgl.force-layers-readback,true)                         == webgl-clear-test.html?readback&aa&alpha&preserve  wrapper.html?green.png
-
-# Check orientation:
-== webgl-orientation-test.html?nogl  wrapper.html?white-top-left.png
-
-== webgl-orientation-test.html?__&_____&________  wrapper.html?white-top-left.png
-== webgl-orientation-test.html?aa&_____&________  wrapper.html?white-top-left.png
-== webgl-orientation-test.html?__&alpha&________  wrapper.html?white-top-left.png
-== webgl-orientation-test.html?aa&alpha&________  wrapper.html?white-top-left.png
-== webgl-orientation-test.html?__&_____&preserve  wrapper.html?white-top-left.png
-== webgl-orientation-test.html?aa&_____&preserve  wrapper.html?white-top-left.png
-== webgl-orientation-test.html?__&alpha&preserve  wrapper.html?white-top-left.png
-== webgl-orientation-test.html?aa&alpha&preserve  wrapper.html?white-top-left.png
-
-pref(webgl.force-layers-readback,true) fails-if(nativeFennec)  == webgl-orientation-test.html?readback&__&_____&________  wrapper.html?white-top-left.png
-pref(webgl.force-layers-readback,true) fails-if(nativeFennec)  == webgl-orientation-test.html?readback&aa&_____&________  wrapper.html?white-top-left.png
-pref(webgl.force-layers-readback,true)                         == webgl-orientation-test.html?readback&__&alpha&________  wrapper.html?white-top-left.png
-pref(webgl.force-layers-readback,true)                         == webgl-orientation-test.html?readback&aa&alpha&________  wrapper.html?white-top-left.png
-pref(webgl.force-layers-readback,true) fails-if(nativeFennec)  == webgl-orientation-test.html?readback&__&_____&preserve  wrapper.html?white-top-left.png
-pref(webgl.force-layers-readback,true) fails-if(nativeFennec)  == webgl-orientation-test.html?readback&aa&_____&preserve  wrapper.html?white-top-left.png
-pref(webgl.force-layers-readback,true)                         == webgl-orientation-test.html?readback&__&alpha&preserve  wrapper.html?white-top-left.png
-pref(webgl.force-layers-readback,true)                         == webgl-orientation-test.html?readback&aa&alpha&preserve  wrapper.html?white-top-left.png
-
-# 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)
-== webgl-color-test.html?nogl  wrapper.html?colors.png
-
-== webgl-color-test.html?__&_____&_____&_______&________&_______  wrapper.html?colors.png
-== webgl-color-test.html?aa&_____&_____&_______&________&_______  wrapper.html?colors.png
-== webgl-color-test.html?__&alpha&_____&_______&________&_______  wrapper.html?colors.png
-== webgl-color-test.html?aa&alpha&_____&_______&________&_______  wrapper.html?colors.png
-== webgl-color-test.html?__&_____&depth&_______&________&_______  wrapper.html?colors.png
-== webgl-color-test.html?aa&_____&depth&_______&________&_______  wrapper.html?colors.png
-== webgl-color-test.html?__&alpha&depth&_______&________&_______  wrapper.html?colors.png
-== webgl-color-test.html?aa&alpha&depth&_______&________&_______  wrapper.html?colors.png
-== webgl-color-test.html?__&_____&_____&premult&________&_______  wrapper.html?colors.png
-== webgl-color-test.html?aa&_____&_____&premult&________&_______  wrapper.html?colors.png
-== webgl-color-test.html?__&alpha&_____&premult&________&_______  wrapper.html?colors.png
-== webgl-color-test.html?aa&alpha&_____&premult&________&_______  wrapper.html?colors.png
-== webgl-color-test.html?__&_____&depth&premult&________&_______  wrapper.html?colors.png
-== webgl-color-test.html?aa&_____&depth&premult&________&_______  wrapper.html?colors.png
-== webgl-color-test.html?__&alpha&depth&premult&________&_______  wrapper.html?colors.png
-== webgl-color-test.html?aa&alpha&depth&premult&________&_______  wrapper.html?colors.png
-
-== webgl-color-test.html?__&_____&_____&_______&preserve&_______  wrapper.html?colors.png
-== webgl-color-test.html?aa&_____&_____&_______&preserve&_______  wrapper.html?colors.png
-== webgl-color-test.html?__&alpha&_____&_______&preserve&_______  wrapper.html?colors.png
-== webgl-color-test.html?aa&alpha&_____&_______&preserve&_______  wrapper.html?colors.png
-== webgl-color-test.html?__&_____&depth&_______&preserve&_______  wrapper.html?colors.png
-== webgl-color-test.html?aa&_____&depth&_______&preserve&_______  wrapper.html?colors.png
-== webgl-color-test.html?__&alpha&depth&_______&preserve&_______  wrapper.html?colors.png
-== webgl-color-test.html?aa&alpha&depth&_______&preserve&_______  wrapper.html?colors.png
-== webgl-color-test.html?__&_____&_____&premult&preserve&_______  wrapper.html?colors.png
-== webgl-color-test.html?aa&_____&_____&premult&preserve&_______  wrapper.html?colors.png
-== webgl-color-test.html?__&alpha&_____&premult&preserve&_______  wrapper.html?colors.png
-== webgl-color-test.html?aa&alpha&_____&premult&preserve&_______  wrapper.html?colors.png
-== webgl-color-test.html?__&_____&depth&premult&preserve&_______  wrapper.html?colors.png
-== webgl-color-test.html?aa&_____&depth&premult&preserve&_______  wrapper.html?colors.png
-== webgl-color-test.html?__&alpha&depth&premult&preserve&_______  wrapper.html?colors.png
-== webgl-color-test.html?aa&alpha&depth&premult&preserve&_______  wrapper.html?colors.png
-
-== webgl-color-test.html?__&_____&_____&_______&________&stencil  wrapper.html?colors.png
-== webgl-color-test.html?aa&_____&_____&_______&________&stencil  wrapper.html?colors.png
-== webgl-color-test.html?__&alpha&_____&_______&________&stencil  wrapper.html?colors.png
-== webgl-color-test.html?aa&alpha&_____&_______&________&stencil  wrapper.html?colors.png
-== webgl-color-test.html?__&_____&depth&_______&________&stencil  wrapper.html?colors.png
-== webgl-color-test.html?aa&_____&depth&_______&________&stencil  wrapper.html?colors.png
-== webgl-color-test.html?__&alpha&depth&_______&________&stencil  wrapper.html?colors.png
-== webgl-color-test.html?aa&alpha&depth&_______&________&stencil  wrapper.html?colors.png
-== webgl-color-test.html?__&_____&_____&premult&________&stencil  wrapper.html?colors.png
-== webgl-color-test.html?aa&_____&_____&premult&________&stencil  wrapper.html?colors.png
-== webgl-color-test.html?__&alpha&_____&premult&________&stencil  wrapper.html?colors.png
-== webgl-color-test.html?aa&alpha&_____&premult&________&stencil  wrapper.html?colors.png
-== webgl-color-test.html?__&_____&depth&premult&________&stencil  wrapper.html?colors.png
-== webgl-color-test.html?aa&_____&depth&premult&________&stencil  wrapper.html?colors.png
-== webgl-color-test.html?__&alpha&depth&premult&________&stencil  wrapper.html?colors.png
-== webgl-color-test.html?aa&alpha&depth&premult&________&stencil  wrapper.html?colors.png
-
-== webgl-color-test.html?__&_____&_____&_______&preserve&stencil  wrapper.html?colors.png
-== webgl-color-test.html?aa&_____&_____&_______&preserve&stencil  wrapper.html?colors.png
-== webgl-color-test.html?__&alpha&_____&_______&preserve&stencil  wrapper.html?colors.png
-== webgl-color-test.html?aa&alpha&_____&_______&preserve&stencil  wrapper.html?colors.png
-== webgl-color-test.html?__&_____&depth&_______&preserve&stencil  wrapper.html?colors.png
-== webgl-color-test.html?aa&_____&depth&_______&preserve&stencil  wrapper.html?colors.png
-== webgl-color-test.html?__&alpha&depth&_______&preserve&stencil  wrapper.html?colors.png
-== webgl-color-test.html?aa&alpha&depth&_______&preserve&stencil  wrapper.html?colors.png
-== webgl-color-test.html?__&_____&_____&premult&preserve&stencil  wrapper.html?colors.png
-== webgl-color-test.html?aa&_____&_____&premult&preserve&stencil  wrapper.html?colors.png
-== webgl-color-test.html?__&alpha&_____&premult&preserve&stencil  wrapper.html?colors.png
-== webgl-color-test.html?aa&alpha&_____&premult&preserve&stencil  wrapper.html?colors.png
-== webgl-color-test.html?__&_____&depth&premult&preserve&stencil  wrapper.html?colors.png
-== webgl-color-test.html?aa&_____&depth&premult&preserve&stencil  wrapper.html?colors.png
-== webgl-color-test.html?__&alpha&depth&premult&preserve&stencil  wrapper.html?colors.png
-== webgl-color-test.html?aa&alpha&depth&premult&preserve&stencil  wrapper.html?colors.png
-
-
-# Check a smaller selection for readback:
-pref(webgl.force-layers-readback,true) fails-if(nativeFennec)  == webgl-color-test.html?readback&__&_____&________  wrapper.html?colors.png
-pref(webgl.force-layers-readback,true) fails-if(nativeFennec)  == webgl-color-test.html?readback&aa&_____&________  wrapper.html?colors.png
-pref(webgl.force-layers-readback,true)                         == webgl-color-test.html?readback&__&alpha&________  wrapper.html?colors.png
-pref(webgl.force-layers-readback,true)                         == webgl-color-test.html?readback&aa&alpha&________  wrapper.html?colors.png
-pref(webgl.force-layers-readback,true) fails-if(nativeFennec)  == webgl-color-test.html?readback&__&_____&preserve  wrapper.html?colors.png
-pref(webgl.force-layers-readback,true) fails-if(nativeFennec)  == webgl-color-test.html?readback&aa&_____&preserve  wrapper.html?colors.png
-pref(webgl.force-layers-readback,true)                         == webgl-color-test.html?readback&__&alpha&preserve  wrapper.html?colors.png
-pref(webgl.force-layers-readback,true)                         == webgl-color-test.html?readback&aa&alpha&preserve  wrapper.html?colors.png
-
-
-# Check alpha behavior:
-== webgl-color-alpha-test.html?colorVal=1.0&alphaVal=1.0&nogl        wrapper.html?colors.png
-== webgl-color-alpha-test.html?colorVal=1.0&alphaVal=1.0             wrapper.html?colors.png
-== webgl-color-alpha-test.html?colorVal=0.0&alphaVal=1.0&nogl        wrapper.html?black.png
-== webgl-color-alpha-test.html?colorVal=0.0&alphaVal=1.0             wrapper.html?black.png
-
-== webgl-color-alpha-test.html?colorVal=1.0&alphaVal=0.0&nogl        wrapper.html?colors.png
-== webgl-color-alpha-test.html?colorVal=1.0&alphaVal=0.0             wrapper.html?colors.png
-== webgl-color-alpha-test.html?colorVal=1.0&alphaVal=0.0&alpha&nogl  wrapper.html?white.png
-== webgl-color-alpha-test.html?colorVal=1.0&alphaVal=0.0&alpha       wrapper.html?white.png
-
-fuzzy(1,65536) fuzzy-if(Android,9,65536) == webgl-color-alpha-test.html?colorVal=0.5&alphaVal=1.0&nogl  wrapper.html?half-colors.png
-fuzzy(1,65536) fuzzy-if(Android,9,65536) == webgl-color-alpha-test.html?colorVal=0.5&alphaVal=1.0       wrapper.html?half-colors.png
-
-# Test premult:
-fuzzy(1,65536) fuzzy-if(Android,9,65536)                                == webgl-color-alpha-test.html?colorVal=1.0&alphaVal=0.5&alpha&nogl          wrapper.html?colors-half-alpha.png
-fuzzy(1,65536) fuzzy-if(Android,9,65536)                                == webgl-color-alpha-test.html?colorVal=1.0&alphaVal=0.5&alpha               wrapper.html?colors-half-alpha.png
-fuzzy(1,65536) fuzzy-if(Android,9,65536)                                == webgl-color-alpha-test.html?colorVal=0.5&alphaVal=0.5&alpha&nogl          wrapper.html?half-colors-half-alpha.png
-fuzzy(1,65536) fuzzy-if(Android,9,65536) fails-if(cocoaWidget||Android) == webgl-color-alpha-test.html?colorVal=0.5&alphaVal=0.5&alpha               wrapper.html?half-colors-half-alpha.png
-fuzzy(1,65536) fuzzy-if(Android,9,65536)                                == webgl-color-alpha-test.html?colorVal=0.5&alphaVal=0.5&alpha&premult&nogl  wrapper.html?colors-half-alpha.png
-fuzzy(1,65536) fuzzy-if(Android,9,65536)                                == webgl-color-alpha-test.html?colorVal=0.5&alphaVal=0.5&alpha&premult       wrapper.html?colors-half-alpha.png
-
-# Test over-bright premult:
-fuzzy(1,65536) fuzzy-if(Android,9,65536) == webgl-color-alpha-test.html?colorVal=1.0&alphaVal=0.5&alpha&premult&nogl  wrapper.html?colors-half-alpha.png
-fuzzy(1,65536) fuzzy-if(Android,9,65536) == webgl-color-alpha-test.html?colorVal=1.0&alphaVal=0.5&alpha&premult       wrapper.html?colors-half-alpha.png
-
-
-# Check for hanging framebuffer bindings:
-== webgl-hanging-fb-test.html?nogl  wrapper.html?green.png
-
-== webgl-hanging-fb-test.html       wrapper.html?green.png
-== webgl-hanging-fb-test.html?aa    wrapper.html?green.png
-pref(webgl.force-layers-readback,true) fails-if(nativeFennec)  == webgl-hanging-fb-test.html?readback     wrapper.html?green.png
-pref(webgl.force-layers-readback,true) fails-if(nativeFennec)  == webgl-hanging-fb-test.html?readback&aa  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) fails-if(nativeFennec)  == webgl-hanging-scissor-test.html?readback     wrapper.html?green.png
-pref(webgl.force-layers-readback,true) fails-if(nativeFennec)  == webgl-hanging-scissor-test.html?readback&aa  wrapper.html?green.png
-
-
-# Check that our experimental prefs still work:
-
-# 16bpp:
-pref(webgl.prefer-16bpp,true)                                                               == webgl-color-test.html?16bpp           wrapper.html?colors.png
-pref(webgl.prefer-16bpp,true) pref(webgl.force-layers-readback,true) fails-if(nativeFennec) == webgl-color-test.html?16bpp&readback  wrapper.html?colors.png
-
-# Force native GL (Windows):
-skip-if(!winWidget) pref(webgl.prefer-native-gl,true)                                == webgl-clear-test.html?native-gl        wrapper.html?green.png
-skip-if(!winWidget) pref(webgl.prefer-native-gl,true)                                == webgl-orientation-test.html?native-gl  wrapper.html?white-top-left.png
-skip-if(!winWidget) pref(webgl.prefer-native-gl,true)                                == webgl-color-test.html?native-gl        wrapper.html?colors.png
-skip-if(!winWidget) pref(webgl.prefer-native-gl,true) pref(webgl.prefer-16bpp,true)  == webgl-color-test.html?native-gl&16bpp  wrapper.html?colors.png
+# WebGL Reftests!
+# If you add new tests, don't forget to add sanity (&nogl) tests! (if needed)
+
+# 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
+
+# Basic WebGL tests:
+# Do we get pixels to the screen at all?
+# Try to just hit the different rendering paths here.
+# Test: {aa, alpha, preserve, readback} = 16
+== webgl-clear-test.html?nogl  wrapper.html?green.png
+
+== webgl-clear-test.html?__&_____&________  wrapper.html?green.png
+== webgl-clear-test.html?aa&_____&________  wrapper.html?green.png
+== webgl-clear-test.html?__&alpha&________  wrapper.html?green.png
+== webgl-clear-test.html?aa&alpha&________  wrapper.html?green.png
+== webgl-clear-test.html?__&_____&preserve  wrapper.html?green.png
+== webgl-clear-test.html?aa&_____&preserve  wrapper.html?green.png
+== webgl-clear-test.html?__&alpha&preserve  wrapper.html?green.png
+== webgl-clear-test.html?aa&alpha&preserve  wrapper.html?green.png
+
+pref(webgl.force-layers-readback,true) fails-if(nativeFennec)  == webgl-clear-test.html?readback&__&_____&________  wrapper.html?green.png
+pref(webgl.force-layers-readback,true) fails-if(nativeFennec)  == webgl-clear-test.html?readback&aa&_____&________  wrapper.html?green.png
+pref(webgl.force-layers-readback,true)                         == webgl-clear-test.html?readback&__&alpha&________  wrapper.html?green.png
+pref(webgl.force-layers-readback,true)                         == webgl-clear-test.html?readback&aa&alpha&________  wrapper.html?green.png
+pref(webgl.force-layers-readback,true) fails-if(nativeFennec)  == webgl-clear-test.html?readback&__&_____&preserve  wrapper.html?green.png
+pref(webgl.force-layers-readback,true) fails-if(nativeFennec)  == webgl-clear-test.html?readback&aa&_____&preserve  wrapper.html?green.png
+pref(webgl.force-layers-readback,true)                         == webgl-clear-test.html?readback&__&alpha&preserve  wrapper.html?green.png
+pref(webgl.force-layers-readback,true)                         == webgl-clear-test.html?readback&aa&alpha&preserve  wrapper.html?green.png
+
+# Check orientation:
+== webgl-orientation-test.html?nogl  wrapper.html?white-top-left.png
+
+== webgl-orientation-test.html?__&_____&________  wrapper.html?white-top-left.png
+== webgl-orientation-test.html?aa&_____&________  wrapper.html?white-top-left.png
+== webgl-orientation-test.html?__&alpha&________  wrapper.html?white-top-left.png
+== webgl-orientation-test.html?aa&alpha&________  wrapper.html?white-top-left.png
+== webgl-orientation-test.html?__&_____&preserve  wrapper.html?white-top-left.png
+== webgl-orientation-test.html?aa&_____&preserve  wrapper.html?white-top-left.png
+== webgl-orientation-test.html?__&alpha&preserve  wrapper.html?white-top-left.png
+== webgl-orientation-test.html?aa&alpha&preserve  wrapper.html?white-top-left.png
+
+pref(webgl.force-layers-readback,true) fails-if(nativeFennec)  == webgl-orientation-test.html?readback&__&_____&________  wrapper.html?white-top-left.png
+pref(webgl.force-layers-readback,true) fails-if(nativeFennec)  == webgl-orientation-test.html?readback&aa&_____&________  wrapper.html?white-top-left.png
+pref(webgl.force-layers-readback,true)                         == webgl-orientation-test.html?readback&__&alpha&________  wrapper.html?white-top-left.png
+pref(webgl.force-layers-readback,true)                         == webgl-orientation-test.html?readback&aa&alpha&________  wrapper.html?white-top-left.png
+pref(webgl.force-layers-readback,true) fails-if(nativeFennec)  == webgl-orientation-test.html?readback&__&_____&preserve  wrapper.html?white-top-left.png
+pref(webgl.force-layers-readback,true) fails-if(nativeFennec)  == webgl-orientation-test.html?readback&aa&_____&preserve  wrapper.html?white-top-left.png
+pref(webgl.force-layers-readback,true)                         == webgl-orientation-test.html?readback&__&alpha&preserve  wrapper.html?white-top-left.png
+pref(webgl.force-layers-readback,true)                         == webgl-orientation-test.html?readback&aa&alpha&preserve  wrapper.html?white-top-left.png
+
+# 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)
+== webgl-color-test.html?nogl  wrapper.html?colors.png
+
+== webgl-color-test.html?__&_____&_____&_______&________&_______  wrapper.html?colors.png
+== webgl-color-test.html?aa&_____&_____&_______&________&_______  wrapper.html?colors.png
+== webgl-color-test.html?__&alpha&_____&_______&________&_______  wrapper.html?colors.png
+== webgl-color-test.html?aa&alpha&_____&_______&________&_______  wrapper.html?colors.png
+== webgl-color-test.html?__&_____&depth&_______&________&_______  wrapper.html?colors.png
+== webgl-color-test.html?aa&_____&depth&_______&________&_______  wrapper.html?colors.png
+== webgl-color-test.html?__&alpha&depth&_______&________&_______  wrapper.html?colors.png
+== webgl-color-test.html?aa&alpha&depth&_______&________&_______  wrapper.html?colors.png
+== webgl-color-test.html?__&_____&_____&premult&________&_______  wrapper.html?colors.png
+== webgl-color-test.html?aa&_____&_____&premult&________&_______  wrapper.html?colors.png
+== webgl-color-test.html?__&alpha&_____&premult&________&_______  wrapper.html?colors.png
+== webgl-color-test.html?aa&alpha&_____&premult&________&_______  wrapper.html?colors.png
+== webgl-color-test.html?__&_____&depth&premult&________&_______  wrapper.html?colors.png
+== webgl-color-test.html?aa&_____&depth&premult&________&_______  wrapper.html?colors.png
+== webgl-color-test.html?__&alpha&depth&premult&________&_______  wrapper.html?colors.png
+== webgl-color-test.html?aa&alpha&depth&premult&________&_______  wrapper.html?colors.png
+
+== webgl-color-test.html?__&_____&_____&_______&preserve&_______  wrapper.html?colors.png
+== webgl-color-test.html?aa&_____&_____&_______&preserve&_______  wrapper.html?colors.png
+== webgl-color-test.html?__&alpha&_____&_______&preserve&_______  wrapper.html?colors.png
+== webgl-color-test.html?aa&alpha&_____&_______&preserve&_______  wrapper.html?colors.png
+== webgl-color-test.html?__&_____&depth&_______&preserve&_______  wrapper.html?colors.png
+== webgl-color-test.html?aa&_____&depth&_______&preserve&_______  wrapper.html?colors.png
+== webgl-color-test.html?__&alpha&depth&_______&preserve&_______  wrapper.html?colors.png
+== webgl-color-test.html?aa&alpha&depth&_______&preserve&_______  wrapper.html?colors.png
+== webgl-color-test.html?__&_____&_____&premult&preserve&_______  wrapper.html?colors.png
+== webgl-color-test.html?aa&_____&_____&premult&preserve&_______  wrapper.html?colors.png
+== webgl-color-test.html?__&alpha&_____&premult&preserve&_______  wrapper.html?colors.png
+== webgl-color-test.html?aa&alpha&_____&premult&preserve&_______  wrapper.html?colors.png
+== webgl-color-test.html?__&_____&depth&premult&preserve&_______  wrapper.html?colors.png
+== webgl-color-test.html?aa&_____&depth&premult&preserve&_______  wrapper.html?colors.png
+== webgl-color-test.html?__&alpha&depth&premult&preserve&_______  wrapper.html?colors.png
+== webgl-color-test.html?aa&alpha&depth&premult&preserve&_______  wrapper.html?colors.png
+
+== webgl-color-test.html?__&_____&_____&_______&________&stencil  wrapper.html?colors.png
+== webgl-color-test.html?aa&_____&_____&_______&________&stencil  wrapper.html?colors.png
+== webgl-color-test.html?__&alpha&_____&_______&________&stencil  wrapper.html?colors.png
+== webgl-color-test.html?aa&alpha&_____&_______&________&stencil  wrapper.html?colors.png
+== webgl-color-test.html?__&_____&depth&_______&________&stencil  wrapper.html?colors.png
+== webgl-color-test.html?aa&_____&depth&_______&________&stencil  wrapper.html?colors.png
+== webgl-color-test.html?__&alpha&depth&_______&________&stencil  wrapper.html?colors.png
+== webgl-color-test.html?aa&alpha&depth&_______&________&stencil  wrapper.html?colors.png
+== webgl-color-test.html?__&_____&_____&premult&________&stencil  wrapper.html?colors.png
+== webgl-color-test.html?aa&_____&_____&premult&________&stencil  wrapper.html?colors.png
+== webgl-color-test.html?__&alpha&_____&premult&________&stencil  wrapper.html?colors.png
+== webgl-color-test.html?aa&alpha&_____&premult&________&stencil  wrapper.html?colors.png
+== webgl-color-test.html?__&_____&depth&premult&________&stencil  wrapper.html?colors.png
+== webgl-color-test.html?aa&_____&depth&premult&________&stencil  wrapper.html?colors.png
+== webgl-color-test.html?__&alpha&depth&premult&________&stencil  wrapper.html?colors.png
+== webgl-color-test.html?aa&alpha&depth&premult&________&stencil  wrapper.html?colors.png
+
+== webgl-color-test.html?__&_____&_____&_______&preserve&stencil  wrapper.html?colors.png
+== webgl-color-test.html?aa&_____&_____&_______&preserve&stencil  wrapper.html?colors.png
+== webgl-color-test.html?__&alpha&_____&_______&preserve&stencil  wrapper.html?colors.png
+== webgl-color-test.html?aa&alpha&_____&_______&preserve&stencil  wrapper.html?colors.png
+== webgl-color-test.html?__&_____&depth&_______&preserve&stencil  wrapper.html?colors.png
+== webgl-color-test.html?aa&_____&depth&_______&preserve&stencil  wrapper.html?colors.png
+== webgl-color-test.html?__&alpha&depth&_______&preserve&stencil  wrapper.html?colors.png
+== webgl-color-test.html?aa&alpha&depth&_______&preserve&stencil  wrapper.html?colors.png
+== webgl-color-test.html?__&_____&_____&premult&preserve&stencil  wrapper.html?colors.png
+== webgl-color-test.html?aa&_____&_____&premult&preserve&stencil  wrapper.html?colors.png
+== webgl-color-test.html?__&alpha&_____&premult&preserve&stencil  wrapper.html?colors.png
+== webgl-color-test.html?aa&alpha&_____&premult&preserve&stencil  wrapper.html?colors.png
+== webgl-color-test.html?__&_____&depth&premult&preserve&stencil  wrapper.html?colors.png
+== webgl-color-test.html?aa&_____&depth&premult&preserve&stencil  wrapper.html?colors.png
+== webgl-color-test.html?__&alpha&depth&premult&preserve&stencil  wrapper.html?colors.png
+== webgl-color-test.html?aa&alpha&depth&premult&preserve&stencil  wrapper.html?colors.png
+
+
+# Check a smaller selection for readback:
+pref(webgl.force-layers-readback,true) fails-if(nativeFennec)  == webgl-color-test.html?readback&__&_____&________  wrapper.html?colors.png
+pref(webgl.force-layers-readback,true) fails-if(nativeFennec)  == webgl-color-test.html?readback&aa&_____&________  wrapper.html?colors.png
+pref(webgl.force-layers-readback,true)                         == webgl-color-test.html?readback&__&alpha&________  wrapper.html?colors.png
+pref(webgl.force-layers-readback,true)                         == webgl-color-test.html?readback&aa&alpha&________  wrapper.html?colors.png
+pref(webgl.force-layers-readback,true) fails-if(nativeFennec)  == webgl-color-test.html?readback&__&_____&preserve  wrapper.html?colors.png
+pref(webgl.force-layers-readback,true) fails-if(nativeFennec)  == webgl-color-test.html?readback&aa&_____&preserve  wrapper.html?colors.png
+pref(webgl.force-layers-readback,true)                         == webgl-color-test.html?readback&__&alpha&preserve  wrapper.html?colors.png
+pref(webgl.force-layers-readback,true)                         == webgl-color-test.html?readback&aa&alpha&preserve  wrapper.html?colors.png
+
+
+# Check alpha behavior:
+== webgl-color-alpha-test.html?colorVal=1.0&alphaVal=1.0&nogl        wrapper.html?colors.png
+== webgl-color-alpha-test.html?colorVal=1.0&alphaVal=1.0             wrapper.html?colors.png
+== webgl-color-alpha-test.html?colorVal=0.0&alphaVal=1.0&nogl        wrapper.html?black.png
+== webgl-color-alpha-test.html?colorVal=0.0&alphaVal=1.0             wrapper.html?black.png
+
+== webgl-color-alpha-test.html?colorVal=1.0&alphaVal=0.0&nogl        wrapper.html?colors.png
+== webgl-color-alpha-test.html?colorVal=1.0&alphaVal=0.0             wrapper.html?colors.png
+== webgl-color-alpha-test.html?colorVal=1.0&alphaVal=0.0&alpha&nogl  wrapper.html?white.png
+== webgl-color-alpha-test.html?colorVal=1.0&alphaVal=0.0&alpha       wrapper.html?white.png
+
+fuzzy(1,65536) fuzzy-if(Android,9,65536) == webgl-color-alpha-test.html?colorVal=0.5&alphaVal=1.0&nogl  wrapper.html?half-colors.png
+fuzzy(1,65536) fuzzy-if(Android,9,65536) == webgl-color-alpha-test.html?colorVal=0.5&alphaVal=1.0       wrapper.html?half-colors.png
+
+# Test premult:
+fuzzy(1,65536) fuzzy-if(Android,9,65536)                                == webgl-color-alpha-test.html?colorVal=1.0&alphaVal=0.5&alpha&nogl          wrapper.html?colors-half-alpha.png
+fuzzy(1,65536) fuzzy-if(Android,9,65536)                                == webgl-color-alpha-test.html?colorVal=1.0&alphaVal=0.5&alpha               wrapper.html?colors-half-alpha.png
+fuzzy(1,65536) fuzzy-if(Android,9,65536)                                == webgl-color-alpha-test.html?colorVal=0.5&alphaVal=0.5&alpha&nogl          wrapper.html?half-colors-half-alpha.png
+fuzzy(1,65536) fuzzy-if(Android,9,65536) fails-if(cocoaWidget||Android) == webgl-color-alpha-test.html?colorVal=0.5&alphaVal=0.5&alpha               wrapper.html?half-colors-half-alpha.png
+fuzzy(1,65536) fuzzy-if(Android,9,65536)                                == webgl-color-alpha-test.html?colorVal=0.5&alphaVal=0.5&alpha&premult&nogl  wrapper.html?colors-half-alpha.png
+fuzzy(1,65536) fuzzy-if(Android,9,65536)                                == webgl-color-alpha-test.html?colorVal=0.5&alphaVal=0.5&alpha&premult       wrapper.html?colors-half-alpha.png
+
+# Test over-bright premult:
+fuzzy(1,65536) fuzzy-if(Android,9,65536) == webgl-color-alpha-test.html?colorVal=1.0&alphaVal=0.5&alpha&premult&nogl  wrapper.html?colors-half-alpha.png
+fuzzy(1,65536) fuzzy-if(Android,9,65536) == webgl-color-alpha-test.html?colorVal=1.0&alphaVal=0.5&alpha&premult       wrapper.html?colors-half-alpha.png
+
+
+# Check for hanging framebuffer bindings:
+== webgl-hanging-fb-test.html?nogl  wrapper.html?green.png
+
+== webgl-hanging-fb-test.html       wrapper.html?green.png
+== webgl-hanging-fb-test.html?aa    wrapper.html?green.png
+pref(webgl.force-layers-readback,true) fails-if(nativeFennec)  == webgl-hanging-fb-test.html?readback     wrapper.html?green.png
+pref(webgl.force-layers-readback,true) fails-if(nativeFennec)  == webgl-hanging-fb-test.html?readback&aa  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) fails-if(nativeFennec)  == webgl-hanging-scissor-test.html?readback     wrapper.html?green.png
+pref(webgl.force-layers-readback,true) fails-if(nativeFennec)  == webgl-hanging-scissor-test.html?readback&aa  wrapper.html?green.png
+
+
+# Check that our experimental prefs still work:
+
+# 16bpp:
+pref(webgl.prefer-16bpp,true)                                                               == webgl-color-test.html?16bpp           wrapper.html?colors.png
+pref(webgl.prefer-16bpp,true) pref(webgl.force-layers-readback,true) fails-if(nativeFennec) == webgl-color-test.html?16bpp&readback  wrapper.html?colors.png
+
+# Force native GL (Windows):
+skip-if(!winWidget) pref(webgl.prefer-native-gl,true)                                == webgl-clear-test.html?native-gl        wrapper.html?green.png
+skip-if(!winWidget) pref(webgl.prefer-native-gl,true)                                == webgl-orientation-test.html?native-gl  wrapper.html?white-top-left.png
+skip-if(!winWidget) pref(webgl.prefer-native-gl,true)                                == webgl-color-test.html?native-gl        wrapper.html?colors.png
+skip-if(!winWidget) pref(webgl.prefer-native-gl,true) pref(webgl.prefer-16bpp,true)  == webgl-color-test.html?native-gl&16bpp  wrapper.html?colors.png
--- a/gfx/gl/GLContextTypes.h
+++ b/gfx/gl/GLContextTypes.h
@@ -1,42 +1,42 @@
-/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef GLCONTEXTSTUFF_H_
-#define GLCONTEXTSTUFF_H_
-
-/**
- * We don't include GLDefs.h here since we don't want to drag in all defines
- * in for all our users.
- */
-typedef unsigned int GLenum;
-typedef unsigned int GLbitfield;
-typedef unsigned int GLuint;
-typedef int GLint;
-typedef int GLsizei;
-
-namespace mozilla {
-namespace gl {
-
-enum ShaderProgramType {
-    RGBALayerProgramType,
-    RGBALayerExternalProgramType,
-    BGRALayerProgramType,
-    RGBXLayerProgramType,
-    BGRXLayerProgramType,
-    RGBARectLayerProgramType,
-    RGBAExternalLayerProgramType,
-    ColorLayerProgramType,
-    YCbCrLayerProgramType,
-    ComponentAlphaPass1ProgramType,
-    ComponentAlphaPass2ProgramType,
-    Copy2DProgramType,
-    Copy2DRectProgramType,
-    NumProgramTypes
-};
-
-} // namespace gl
-} // namespace mozilla
-
-#endif /* GLCONTEXTSTUFF_H_ */
+/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#ifndef GLCONTEXTSTUFF_H_
+#define GLCONTEXTSTUFF_H_
+
+/**
+ * We don't include GLDefs.h here since we don't want to drag in all defines
+ * in for all our users.
+ */
+typedef unsigned int GLenum;
+typedef unsigned int GLbitfield;
+typedef unsigned int GLuint;
+typedef int GLint;
+typedef int GLsizei;
+
+namespace mozilla {
+namespace gl {
+
+enum ShaderProgramType {
+    RGBALayerProgramType,
+    RGBALayerExternalProgramType,
+    BGRALayerProgramType,
+    RGBXLayerProgramType,
+    BGRXLayerProgramType,
+    RGBARectLayerProgramType,
+    RGBAExternalLayerProgramType,
+    ColorLayerProgramType,
+    YCbCrLayerProgramType,
+    ComponentAlphaPass1ProgramType,
+    ComponentAlphaPass2ProgramType,
+    Copy2DProgramType,
+    Copy2DRectProgramType,
+    NumProgramTypes
+};
+
+} // namespace gl
+} // namespace mozilla
+
+#endif /* GLCONTEXTSTUFF_H_ */
--- a/gfx/gl/GLTextureImage.h
+++ b/gfx/gl/GLTextureImage.h
@@ -1,385 +1,385 @@
-/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef GLTEXTUREIMAGE_H_
-#define GLTEXTUREIMAGE_H_
-
-#include "nsAutoPtr.h"
-#include "nsRegion.h"
-#include "gfxASurface.h"
-#include "GLContextTypes.h"
-#include "gfxPattern.h"
-
-namespace mozilla {
-namespace gl {
-class GLContext;
-
-/**
- * A TextureImage encapsulates a surface that can be drawn to by a
- * Thebes gfxContext and (hopefully efficiently!) synchronized to a
- * texture in the server.  TextureImages are associated with one and
- * only one GLContext.
- *
- * Implementation note: TextureImages attempt to unify two categories
- * of backends
- *
- *  (1) proxy to server-side object that can be bound to a texture;
- *      e.g. Pixmap on X11.
- *
- *  (2) efficient manager of texture memory; e.g. by having clients draw
- *      into a scratch buffer which is then uploaded with
- *      glTexSubImage2D().
- */
-class TextureImage
-{
-    NS_INLINE_DECL_REFCOUNTING(TextureImage)
-public:
-    enum TextureState
-    {
-      Created, // Texture created, but has not had glTexImage called to initialize it.
-      Allocated,  // Texture memory exists, but contents are invalid.
-      Valid  // Texture fully ready to use.
-    };
-
-    enum Flags {
-        NoFlags          = 0x0,
-        UseNearestFilter = 0x1,
-        NeedsYFlip       = 0x2,
-        ForceSingleTile  = 0x4
-    };
-
-    typedef gfxASurface::gfxContentType ContentType;
-
-    static already_AddRefed<TextureImage> Create(
-                       GLContext* gl,
-                       const nsIntSize& aSize,
-                       TextureImage::ContentType aContentType,
-                       GLenum aWrapMode,
-                       TextureImage::Flags aFlags = TextureImage::NoFlags);
-
-    virtual ~TextureImage() {}
-
-    /**
-     * Returns a gfxASurface for updating |aRegion| of the client's
-     * image if successul, NULL if not.  |aRegion|'s bounds must fit
-     * within Size(); its coordinate space (if any) is ignored.  If
-     * the update begins successfully, the returned gfxASurface is
-     * owned by this.  Otherwise, NULL is returned.
-     *
-     * |aRegion| is an inout param: the returned region is what the
-     * client must repaint.  Category (1) regions above can
-     * efficiently handle repaints to "scattered" regions, while (2)
-     * can only efficiently handle repaints to rects.
-     *
-     * Painting the returned surface outside of |aRegion| results
-     * in undefined behavior.
-     *
-     * BeginUpdate() calls cannot be "nested", and each successful
-     * BeginUpdate() must be followed by exactly one EndUpdate() (see
-     * below).  Failure to do so can leave this in a possibly
-     * inconsistent state.  Unsuccessful BeginUpdate()s must not be
-     * followed by EndUpdate().
-     */
-    virtual gfxASurface* BeginUpdate(nsIntRegion& aRegion) = 0;
-    /**
-     * Retrieves the region that will require updating, given a
-     * region that needs to be updated. This can be used for
-     * making decisions about updating before calling BeginUpdate().
-     *
-     * |aRegion| is an inout param.
-     */
-    virtual void GetUpdateRegion(nsIntRegion& aForRegion) {
-    }
-    /**
-     * Finish the active update and synchronize with the server, if
-     * necessary.
-     *
-     * BeginUpdate() must have been called exactly once before
-     * EndUpdate().
-     */
-    virtual void EndUpdate() = 0;
-
-    /**
-     * The Image may contain several textures for different regions (tiles).
-     * These functions iterate over each sub texture image tile.
-     */
-    virtual void BeginTileIteration() {
-    }
-
-    virtual bool NextTile() {
-        return false;
-    }
-
-    // Function prototype for a tile iteration callback. Returning false will
-    // cause iteration to be interrupted (i.e. the corresponding NextTile call
-    // will return false).
-    typedef bool (* TileIterationCallback)(TextureImage* aImage,
-                                           int aTileNumber,
-                                           void* aCallbackData);
-
-    // Sets a callback to be called every time NextTile is called.
-    virtual void SetIterationCallback(TileIterationCallback aCallback,
-                                      void* aCallbackData) {
-    }
-
-    virtual nsIntRect GetTileRect() {
-        return nsIntRect(nsIntPoint(0,0), mSize);
-    }
-
-    virtual GLuint GetTextureID() = 0;
-
-    virtual uint32_t GetTileCount() {
-        return 1;
-    }
-
-    /**
-     * Set this TextureImage's size, and ensure a texture has been
-     * allocated.  Must not be called between BeginUpdate and EndUpdate.
-     * After a resize, the contents are undefined.
-     *
-     * If this isn't implemented by a subclass, it will just perform
-     * a dummy BeginUpdate/EndUpdate pair.
-     */
-    virtual void Resize(const nsIntSize& aSize) {
-        mSize = aSize;
-        nsIntRegion r(nsIntRect(0, 0, aSize.width, aSize.height));
-        BeginUpdate(r);
-        EndUpdate();
-    }
-
-    /**
-     * Mark this texture as having valid contents. Call this after modifying
-     * the texture contents externally.
-     */
-    virtual void MarkValid() {}
-
-    /**
-     * aSurf - the source surface to update from
-     * aRegion - the region in this image to update
-     * aFrom - offset in the source to update from
-     */
-    virtual bool DirectUpdate(gfxASurface *aSurf, const nsIntRegion& aRegion, const nsIntPoint& aFrom = nsIntPoint(0,0)) = 0;
-
-    virtual void BindTexture(GLenum aTextureUnit) = 0;
-    virtual void ReleaseTexture() {}
-
-    void BindTextureAndApplyFilter(GLenum aTextureUnit) {
-        BindTexture(aTextureUnit);
-        ApplyFilter();
-    }
-
-    class ScopedBindTexture
-    {
-    public:
-        ScopedBindTexture(TextureImage *aTexture, GLenum aTextureUnit);
-
-        ~ScopedBindTexture()
-        {
-            if (mTexture) {
-                mTexture->ReleaseTexture();
-            }
-        }
-
-    protected:
-        TextureImage *mTexture;
-    };
-
-    class ScopedBindTextureAndApplyFilter
-        : public ScopedBindTexture
-    {
-    public:
-        ScopedBindTextureAndApplyFilter(TextureImage *aTexture, GLenum aTextureUnit) :
-          ScopedBindTexture(aTexture, aTextureUnit)
-        {
-            if (mTexture) {
-                mTexture->ApplyFilter();
-            }
-        }
-    };
-
-    /**
-     * Returns the shader program type that should be used to render
-     * this texture. Only valid after a matching BeginUpdate/EndUpdate
-     * pair have been called.
-     */
-    virtual ShaderProgramType GetShaderProgramType()
-    {
-         return mShaderType;
-    }
-
-    /** Can be called safely at any time. */
-
-    /**
-     * If this TextureImage has a permanent gfxASurface backing,
-     * return it.  Otherwise return NULL.
-     */
-    virtual already_AddRefed<gfxASurface> GetBackingSurface()
-    { return NULL; }
-
-    const nsIntSize& GetSize() const { return mSize; }
-    ContentType GetContentType() const { return mContentType; }
-    virtual bool InUpdate() const = 0;
-    GLenum GetWrapMode() const { return mWrapMode; }
-
-    void SetFilter(gfxPattern::GraphicsFilter aFilter) { mFilter = aFilter; }
-
-    /**
-     * Applies this TextureImage's filter, assuming that its texture is
-     * the currently bound texture.
-     */
-    virtual void ApplyFilter() = 0;
-
-protected:
-    friend class GLContext;
-
-    /**
-     * After the ctor, the TextureImage is invalid.  Implementations
-     * must allocate resources successfully before returning the new
-     * TextureImage from GLContext::CreateTextureImage().  That is,
-     * clients must not be given partially-constructed TextureImages.
-     */
-    TextureImage(const nsIntSize& aSize,
-                 GLenum aWrapMode, ContentType aContentType,
-                 Flags aFlags = NoFlags)
-        : mSize(aSize)
-        , mWrapMode(aWrapMode)
-        , mContentType(aContentType)
-        , mFilter(gfxPattern::FILTER_GOOD)
-        , mFlags(aFlags)
-    {}
-
-    virtual nsIntRect GetSrcTileRect() {
-        return nsIntRect(nsIntPoint(0,0), mSize);
-    }
-
-    nsIntSize mSize;
-    GLenum mWrapMode;
-    ContentType mContentType;
-    ShaderProgramType mShaderType;
-    gfxPattern::GraphicsFilter mFilter;
-    Flags mFlags;
-};
-
-/**
- * BasicTextureImage is the baseline TextureImage implementation ---
- * it updates its texture by allocating a scratch buffer for the
- * client to draw into, then using glTexSubImage2D() to upload the new
- * pixels.  Platforms must provide the code to create a new surface
- * into which the updated pixels will be drawn, and the code to
- * convert the update surface's pixels into an image on which we can
- * glTexSubImage2D().
- */
-class BasicTextureImage
-    : public TextureImage
-{
-public:
-    typedef gfxASurface::gfxImageFormat ImageFormat;
-    virtual ~BasicTextureImage();
-
-    BasicTextureImage(GLuint aTexture,
-                      const nsIntSize& aSize,
-                      GLenum aWrapMode,
-                      ContentType aContentType,
-                      GLContext* aContext,
-                      TextureImage::Flags aFlags = TextureImage::NoFlags)
-        : TextureImage(aSize, aWrapMode, aContentType, aFlags)
-        , mTexture(aTexture)
-        , mTextureState(Created)
-        , mGLContext(aContext)
-        , mUpdateOffset(0, 0)
-    {}
-
-    virtual void BindTexture(GLenum aTextureUnit);
-
-    virtual gfxASurface* BeginUpdate(nsIntRegion& aRegion);
-    virtual void GetUpdateRegion(nsIntRegion& aForRegion);
-    virtual void EndUpdate();
-    virtual bool DirectUpdate(gfxASurface* aSurf, const nsIntRegion& aRegion, const nsIntPoint& aFrom = nsIntPoint(0,0));
-    virtual GLuint GetTextureID() { return mTexture; }
-    // Returns a surface to draw into
-    virtual already_AddRefed<gfxASurface>
-      GetSurfaceForUpdate(const gfxIntSize& aSize, ImageFormat aFmt);
-
-    virtual void MarkValid() { mTextureState = Valid; }
-
-    // Call when drawing into the update surface is complete.
-    // Returns true if textures should be upload with a relative
-    // offset - See UploadSurfaceToTexture.
-    virtual bool FinishedSurfaceUpdate();
-
-    // Call after surface data has been uploaded to a texture.
-    virtual void FinishedSurfaceUpload();
-
-    virtual bool InUpdate() const { return !!mUpdateSurface; }
-
-    virtual void Resize(const nsIntSize& aSize);
-
-    virtual void ApplyFilter();
-protected:
-
-    GLuint mTexture;
-    TextureState mTextureState;
-    GLContext* mGLContext;
-    nsRefPtr<gfxASurface> mUpdateSurface;
-    nsIntRegion mUpdateRegion;
-
-    // The offset into the update surface at which the update rect is located.
-    nsIntPoint mUpdateOffset;
-};
-
-/**
- * A container class that complements many sub TextureImages into a big TextureImage.
- * Aims to behave just like the real thing.
- */
-
-class TiledTextureImage
-    : public TextureImage
-{
-public:
-    TiledTextureImage(GLContext* aGL, nsIntSize aSize,
-        TextureImage::ContentType, TextureImage::Flags aFlags = TextureImage::NoFlags);
-    ~TiledTextureImage();
-    void DumpDiv();
-    virtual gfxASurface* BeginUpdate(nsIntRegion& aRegion);
-    virtual void GetUpdateRegion(nsIntRegion& aForRegion);
-    virtual void EndUpdate();
-    virtual void Resize(const nsIntSize& aSize);
-    virtual uint32_t GetTileCount();
-    virtual void BeginTileIteration();
-    virtual bool NextTile();
-    virtual void SetIterationCallback(TileIterationCallback aCallback,
-                                      void* aCallbackData);
-    virtual nsIntRect GetTileRect();
-    virtual GLuint GetTextureID() {
-        return mImages[mCurrentImage]->GetTextureID();
-    }
-    virtual bool DirectUpdate(gfxASurface* aSurf, const nsIntRegion& aRegion, const nsIntPoint& aFrom = nsIntPoint(0,0));
-    virtual bool InUpdate() const { return mInUpdate; }
-    virtual void BindTexture(GLenum);
-    virtual void ApplyFilter();
-
-protected:
-    virtual nsIntRect GetSrcTileRect();
-
-    unsigned int mCurrentImage;
-    TileIterationCallback mIterationCallback;
-    void* mIterationCallbackData;
-    nsTArray< nsRefPtr<TextureImage> > mImages;
-    bool mInUpdate;
-    nsIntSize mSize;
-    unsigned int mTileSize;
-    unsigned int mRows, mColumns;
-    GLContext* mGL;
-    // A temporary surface to faciliate cross-tile updates.
-    nsRefPtr<gfxASurface> mUpdateSurface;
-    // The region of update requested
-    nsIntRegion mUpdateRegion;
-    TextureState mTextureState;
-};
-
-} // namespace gl
-} // namespace mozilla
-
-#endif /* GLTEXTUREIMAGE_H_ */
+/* -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40; -*- */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#ifndef GLTEXTUREIMAGE_H_
+#define GLTEXTUREIMAGE_H_
+
+#include "nsAutoPtr.h"
+#include "nsRegion.h"
+#include "gfxASurface.h"
+#include "GLContextTypes.h"
+#include "gfxPattern.h"
+
+namespace mozilla {
+namespace gl {
+class GLContext;
+
+/**
+ * A TextureImage encapsulates a surface that can be drawn to by a
+ * Thebes gfxContext and (hopefully efficiently!) synchronized to a
+ * texture in the server.  TextureImages are associated with one and
+ * only one GLContext.
+ *
+ * Implementation note: TextureImages attempt to unify two categories
+ * of backends
+ *
+ *  (1) proxy to server-side object that can be bound to a texture;
+ *      e.g. Pixmap on X11.
+ *
+ *  (2) efficient manager of texture memory; e.g. by having clients draw
+ *      into a scratch buffer which is then uploaded with
+ *      glTexSubImage2D().
+ */
+class TextureImage
+{
+    NS_INLINE_DECL_REFCOUNTING(TextureImage)
+public:
+    enum TextureState
+    {
+      Created, // Texture created, but has not had glTexImage called to initialize it.
+      Allocated,  // Texture memory exists, but contents are invalid.
+      Valid  // Texture fully ready to use.
+    };
+
+    enum Flags {
+        NoFlags          = 0x0,
+        UseNearestFilter = 0x1,
+        NeedsYFlip       = 0x2,
+        ForceSingleTile  = 0x4
+    };
+
+    typedef gfxASurface::gfxContentType ContentType;
+
+    static already_AddRefed<TextureImage> Create(
+                       GLContext* gl,
+                       const nsIntSize& aSize,
+                       TextureImage::ContentType aContentType,
+                       GLenum aWrapMode,
+                       TextureImage::Flags aFlags = TextureImage::NoFlags);
+
+    virtual ~TextureImage() {}
+
+    /**
+     * Returns a gfxASurface for updating |aRegion| of the client's
+     * image if successul, NULL if not.  |aRegion|'s bounds must fit
+     * within Size(); its coordinate space (if any) is ignored.  If
+     * the update begins successfully, the returned gfxASurface is
+     * owned by this.  Otherwise, NULL is returned.
+     *
+     * |aRegion| is an inout param: the returned region is what the
+     * client must repaint.  Category (1) regions above can
+     * efficiently handle repaints to "scattered" regions, while (2)
+     * can only efficiently handle repaints to rects.
+     *
+     * Painting the returned surface outside of |aRegion| results
+     * in undefined behavior.
+     *
+     * BeginUpdate() calls cannot be "nested", and each successful
+     * BeginUpdate() must be followed by exactly one EndUpdate() (see
+     * below).  Failure to do so can leave this in a possibly
+     * inconsistent state.  Unsuccessful BeginUpdate()s must not be
+     * followed by EndUpdate().
+     */
+    virtual gfxASurface* BeginUpdate(nsIntRegion& aRegion) = 0;
+    /**
+     * Retrieves the region that will require updating, given a
+     * region that needs to be updated. This can be used for
+     * making decisions about updating before calling BeginUpdate().
+     *
+     * |aRegion| is an inout param.
+     */
+    virtual void GetUpdateRegion(nsIntRegion& aForRegion) {
+    }
+    /**
+     * Finish the active update and synchronize with the server, if
+     * necessary.
+     *
+     * BeginUpdate() must have been called exactly once before
+     * EndUpdate().
+     */
+    virtual void EndUpdate() = 0;
+
+    /**
+     * The Image may contain several textures for different regions (tiles).
+     * These functions iterate over each sub texture image tile.
+     */
+    virtual void BeginTileIteration() {
+    }
+
+    virtual bool NextTile() {
+        return false;
+    }
+
+    // Function prototype for a tile iteration callback. Returning false will
+    // cause iteration to be interrupted (i.e. the corresponding NextTile call
+    // will return false).
+    typedef bool (* TileIterationCallback)(TextureImage* aImage,
+                                           int aTileNumber,
+                                           void* aCallbackData);
+
+    // Sets a callback to be called every time NextTile is called.
+    virtual void SetIterationCallback(TileIterationCallback aCallback,
+                                      void* aCallbackData) {
+    }
+
+    virtual nsIntRect GetTileRect() {
+        return nsIntRect(nsIntPoint(0,0), mSize);
+    }
+
+    virtual GLuint GetTextureID() = 0;
+
+    virtual uint32_t GetTileCount() {
+        return 1;
+    }
+
+    /**
+     * Set this TextureImage's size, and ensure a texture has been
+     * allocated.  Must not be called between BeginUpdate and EndUpdate.
+     * After a resize, the contents are undefined.
+     *
+     * If this isn't implemented by a subclass, it will just perform
+     * a dummy BeginUpdate/EndUpdate pair.
+     */
+    virtual void Resize(const nsIntSize& aSize) {
+        mSize = aSize;
+        nsIntRegion r(nsIntRect(0, 0, aSize.width, aSize.height));
+        BeginUpdate(r);
+        EndUpdate();
+    }
+
+    /**
+     * Mark this texture as having valid contents. Call this after modifying
+     * the texture contents externally.
+     */
+    virtual void MarkValid() {}
+
+    /**
+     * aSurf - the source surface to update from
+     * aRegion - the region in this image to update
+     * aFrom - offset in the source to update from
+     */
+    virtual bool DirectUpdate(gfxASurface *aSurf, const nsIntRegion& aRegion, const nsIntPoint& aFrom = nsIntPoint(0,0)) = 0;
+
+    virtual void BindTexture(GLenum aTextureUnit) = 0;
+    virtual void ReleaseTexture() {}
+
+    void BindTextureAndApplyFilter(GLenum aTextureUnit) {
+        BindTexture(aTextureUnit);
+        ApplyFilter();
+    }
+
+    class ScopedBindTexture
+    {
+    public:
+        ScopedBindTexture(TextureImage *aTexture, GLenum aTextureUnit);
+
+        ~ScopedBindTexture()
+        {
+            if (mTexture) {
+                mTexture->ReleaseTexture();
+            }
+        }
+
+    protected:
+        TextureImage *mTexture;
+    };
+
+    class ScopedBindTextureAndApplyFilter
+        : public ScopedBindTexture
+    {
+    public:
+        ScopedBindTextureAndApplyFilter(TextureImage *aTexture, GLenum aTextureUnit) :
+          ScopedBindTexture(aTexture, aTextureUnit)
+        {
+            if (mTexture) {
+                mTexture->ApplyFilter();
+            }
+        }
+    };
+
+    /**
+     * Returns the shader program type that should be used to render
+     * this texture. Only valid after a matching BeginUpdate/EndUpdate
+     * pair have been called.
+     */
+    virtual ShaderProgramType GetShaderProgramType()
+    {
+         return mShaderType;
+    }
+
+    /** Can be called safely at any time. */
+
+    /**
+     * If this TextureImage has a permanent gfxASurface backing,
+     * return it.  Otherwise return NULL.
+     */
+    virtual already_AddRefed<gfxASurface> GetBackingSurface()
+    { return NULL; }
+
+    const nsIntSize& GetSize() const { return mSize; }
+    ContentType GetContentType() const { return mContentType; }
+    virtual bool InUpdate() const = 0;
+    GLenum GetWrapMode() const { return mWrapMode; }
+
+    void SetFilter(gfxPattern::GraphicsFilter aFilter) { mFilter = aFilter; }
+
+    /**
+     * Applies this TextureImage's filter, assuming that its texture is
+     * the currently bound texture.
+     */
+    virtual void ApplyFilter() = 0;
+
+protected:
+    friend class GLContext;
+
+    /**
+     * After the ctor, the TextureImage is invalid.  Implementations
+     * must allocate resources successfully before returning the new
+     * TextureImage from GLContext::CreateTextureImage().  That is,
+     * clients must not be given partially-constructed TextureImages.
+     */
+    TextureImage(const nsIntSize& aSize,
+                 GLenum aWrapMode, ContentType aContentType,
+                 Flags aFlags = NoFlags)
+        : mSize(aSize)
+        , mWrapMode(aWrapMode)
+        , mContentType(aContentType)
+        , mFilter(gfxPattern::FILTER_GOOD)
+        , mFlags(aFlags)
+    {}
+
+    virtual nsIntRect GetSrcTileRect() {
+        return nsIntRect(nsIntPoint(0,0), mSize);
+    }
+
+    nsIntSize mSize;
+    GLenum mWrapMode;
+    ContentType mContentType;
+    ShaderProgramType mShaderType;
+    gfxPattern::GraphicsFilter mFilter;
+    Flags mFlags;
+};
+
+/**
+ * BasicTextureImage is the baseline TextureImage implementation ---
+ * it updates its texture by allocating a scratch buffer for the
+ * client to draw into, then using glTexSubImage2D() to upload the new
+ * pixels.  Platforms must provide the code to create a new surface
+ * into which the updated pixels will be drawn, and the code to
+ * convert the update surface's pixels into an image on which we can
+ * glTexSubImage2D().
+ */
+class BasicTextureImage
+    : public TextureImage
+{
+public:
+    typedef gfxASurface::gfxImageFormat ImageFormat;
+    virtual ~BasicTextureImage();
+
+    BasicTextureImage(GLuint aTexture,
+                      const nsIntSize& aSize,
+                      GLenum aWrapMode,
+                      ContentType aContentType,
+                      GLContext* aContext,
+                      TextureImage::Flags aFlags = TextureImage::NoFlags)
+        : TextureImage(aSize, aWrapMode, aContentType, aFlags)
+        , mTexture(aTexture)
+        , mTextureState(Created)
+        , mGLContext(aContext)
+        , mUpdateOffset(0, 0)
+    {}
+
+    virtual void BindTexture(GLenum aTextureUnit);
+
+    virtual gfxASurface* BeginUpdate(nsIntRegion& aRegion);
+    virtual void GetUpdateRegion(nsIntRegion& aForRegion);
+    virtual void EndUpdate();
+    virtual bool DirectUpdate(gfxASurface* aSurf, const nsIntRegion& aRegion, const nsIntPoint& aFrom = nsIntPoint(0,0));
+    virtual GLuint GetTextureID() { return mTexture; }
+    // Returns a surface to draw into
+    virtual already_AddRefed<gfxASurface>
+      GetSurfaceForUpdate(const gfxIntSize& aSize, ImageFormat aFmt);
+
+    virtual void MarkValid() { mTextureState = Valid; }
+
+    // Call when drawing into the update surface is complete.
+    // Returns true if textures should be upload with a relative
+    // offset - See UploadSurfaceToTexture.
+    virtual bool FinishedSurfaceUpdate();
+
+    // Call after surface data has been uploaded to a texture.
+    virtual void FinishedSurfaceUpload();
+
+    virtual bool InUpdate() const { return !!mUpdateSurface; }
+
+    virtual void Resize(const nsIntSize& aSize);
+
+    virtual void ApplyFilter();
+protected:
+
+    GLuint mTexture;
+    TextureState mTextureState;
+    GLContext* mGLContext;
+    nsRefPtr<gfxASurface> mUpdateSurface;
+    nsIntRegion mUpdateRegion;
+
+    // The offset into the update surface at which the update rect is located.
+    nsIntPoint mUpdateOffset;
+};
+
+/**
+ * A container class that complements many sub TextureImages into a big TextureImage.
+ * Aims to behave just like the real thing.
+ */
+
+class TiledTextureImage
+    : public TextureImage
+{
+public:
+    TiledTextureImage(GLContext* aGL, nsIntSize aSize,
+        TextureImage::ContentType, TextureImage::Flags aFlags = TextureImage::NoFlags);
+    ~TiledTextureImage();
+    void DumpDiv();
+    virtual gfxASurface* BeginUpdate(nsIntRegion& aRegion);
+    virtual void GetUpdateRegion(nsIntRegion& aForRegion);
+    virtual void EndUpdate();
+    virtual void Resize(const nsIntSize& aSize);
+    virtual uint32_t GetTileCount();
+    virtual void BeginTileIteration();
+    virtual bool NextTile();
+    virtual void SetIterationCallback(TileIterationCallback aCallback,
+                                      void* aCallbackData);
+    virtual nsIntRect GetTileRect();
+    virtual GLuint GetTextureID() {
+        return mImages[mCurrentImage]->GetTextureID();
+    }
+    virtual bool DirectUpdate(gfxASurface* aSurf, const nsIntRegion& aRegion, const nsIntPoint& aFrom = nsIntPoint(0,0));
+    virtual bool InUpdate() const { return mInUpdate; }
+    virtual void BindTexture(GLenum);
+    virtual void ApplyFilter();
+
+protected:
+    virtual nsIntRect GetSrcTileRect();
+
+    unsigned int mCurrentImage;
+    TileIterationCallback mIterationCallback;
+    void* mIterationCallbackData;
+    nsTArray< nsRefPtr<TextureImage> > mImages;
+    bool mInUpdate;
+    nsIntSize mSize;
+    unsigned int mTileSize;
+    unsigned int mRows, mColumns;
+    GLContext* mGL;
+    // A temporary surface to faciliate cross-tile updates.
+    nsRefPtr<gfxASurface> mUpdateSurface;
+    // The region of update requested
+    nsIntRegion mUpdateRegion;
+    TextureState mTextureState;
+};
+
+} // namespace gl
+} // namespace mozilla
+
+#endif /* GLTEXTUREIMAGE_H_ */