Bug 587316 - Part 6: Disable failing gradient test on D2D. r=jrmuizel
authorBas Schouten <bschouten@mozilla.com>
Mon, 16 Aug 2010 09:15:03 +0200
changeset 50653 0fb6352dc09cc885d0345c4c5689ccb4b38d471d
parent 50652 6aa55fbbabc0100ee46aed3d63b6ae0fe0577ae1
child 50654 16aa8f0aa149a86158961ebbc23a9cbe5f990464
push idunknown
push userunknown
push dateunknown
reviewersjrmuizel
bugs587316
milestone2.0b4pre
Bug 587316 - Part 6: Disable failing gradient test on D2D. r=jrmuizel
content/canvas/test/test_canvas.html
--- a/content/canvas/test/test_canvas.html
+++ b/content/canvas/test/test_canvas.html
@@ -5694,44 +5694,47 @@ isPixel(ctx, 80,25, 0,255,0,255, 2);
 <script>
 
 
 function test_2d_gradient_interpolate_overlap() {
 
 var canvas = document.getElementById('c215');
 var ctx = canvas.getContext('2d');
 
-canvas.width = 200;
-var g = ctx.createLinearGradient(0, 0, 200, 0);
-g.addColorStop(0, '#f00');
-g.addColorStop(0, '#ff0');
-g.addColorStop(0.25, '#00f');
-g.addColorStop(0.25, '#0f0');
-g.addColorStop(0.25, '#0f0');
-g.addColorStop(0.25, '#0f0');
-g.addColorStop(0.25, '#ff0');
-g.addColorStop(0.5, '#00f');
-g.addColorStop(0.5, '#0f0');
-g.addColorStop(0.75, '#00f');
-g.addColorStop(0.75, '#f00');
-g.addColorStop(0.75, '#ff0');
-g.addColorStop(0.5, '#0f0');
-g.addColorStop(0.5, '#0f0');
-g.addColorStop(0.5, '#ff0');
-g.addColorStop(1, '#00f');
-ctx.fillStyle = g;
-ctx.fillRect(0, 0, 200, 50);
-isPixel(ctx, 49,25, 0,0,255,255, 16);
-isPixel(ctx, 51,25, 255,255,0,255, 16);
-isPixel(ctx, 99,25, 0,0,255,255, 16);
-isPixel(ctx, 101,25, 255,255,0,255, 16);
-isPixel(ctx, 149,25, 0,0,255,255, 16);
-isPixel(ctx, 151,25, 255,255,0,255, 16);
-
-
+if (!IsD2DEnabled()) {
+    // Only run this on non-D2D. On D2D the different nature of how gradients
+    // are drawn makes it so we cannot guarantee these stops are completely
+    // hard.
+    canvas.width = 200;
+    var g = ctx.createLinearGradient(0, 0, 200, 0);
+    g.addColorStop(0, '#f00');
+    g.addColorStop(0, '#ff0');
+    g.addColorStop(0.25, '#00f');
+    g.addColorStop(0.25, '#0f0');
+    g.addColorStop(0.25, '#0f0');
+    g.addColorStop(0.25, '#0f0');
+    g.addColorStop(0.25, '#ff0');
+    g.addColorStop(0.5, '#00f');
+    g.addColorStop(0.5, '#0f0');
+    g.addColorStop(0.75, '#00f');
+    g.addColorStop(0.75, '#f00');
+    g.addColorStop(0.75, '#ff0');
+    g.addColorStop(0.5, '#0f0');
+    g.addColorStop(0.5, '#0f0');
+    g.addColorStop(0.5, '#ff0');
+    g.addColorStop(1, '#00f');
+    ctx.fillStyle = g;
+    ctx.fillRect(0, 0, 200, 50);
+    isPixel(ctx, 49,25, 0,0,255,255, 16);
+    isPixel(ctx, 51,25, 255,255,0,255, 16);
+    isPixel(ctx, 99,25, 0,0,255,255, 16);
+    isPixel(ctx, 101,25, 255,255,0,255, 16);
+    isPixel(ctx, 149,25, 0,0,255,255, 16);
+    isPixel(ctx, 151,25, 255,255,0,255, 16);
+}
 }
 </script>
 
 <!-- [[[ test_2d.gradient.interpolate.overlap2.html ]]] -->
 
 <p>Canvas test: 2d.gradient.interpolate.overlap2</p>
 <canvas id="c216" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
 <script>