Bug 1028288: Add two reftests for globalAlpha. One just tests globalAlpha, and one tests scaling and globalAlpha. r=roc

This commit is contained in:
Masatoshi Kimura 2014-08-29 23:04:35 +09:00
parent ea2c2a5c07
commit 51d834d152
6 changed files with 68 additions and 0 deletions

View File

@ -0,0 +1,6 @@
<html>
<body>
<div style="width: 100px; height: 100px; background: orange; position:absolute"></div>
<div style="width: 100px; height: 100px; background: lime; opacity: .25; position:absolute"></div>
</body>
</html>

View File

@ -0,0 +1,22 @@
<html>
<head>
<script type="text/javascript">
function go() {
var canvas = document.getElementById("canvas");
var ctx = canvas.getContext("2d");
var image = document.getElementById("image");
// Draw some orange
ctx.fillStyle = "orange";
ctx.fillRect(0, 0, 100, 100);
ctx.globalAlpha = 0.25;
ctx.drawImage(image, 0, 0);
}
</script>
</head>
<body onload="go()">
<canvas id="canvas" width="200" height="200"></canvas>
<img id="image" src="lime100x100.svg" style="display: none">
</body>
</html>

View File

@ -0,0 +1,6 @@
<html>
<body>
<embed style="width: 200px; height: 200px;"
src="squaredCircle-transparent.svg"/>
</body>
</html>

View File

@ -0,0 +1,22 @@
<html>
<head>
<script type="text/javascript">
function go() {
var canvas = document.getElementById("canvas");
var ctx = canvas.getContext("2d");
var image = document.getElementById("image");
// Draw some orange
ctx.fillStyle = "orange";
ctx.fillRect(0, 0, 200, 200);
ctx.globalAlpha = 0.75;
ctx.drawImage(image, 0, 0, 200, 200);
}
</script>
</head>
<body onload="go()">
<canvas id="canvas" width="200" height="200"></canvas>
<img id="image" src="squaredCircle-viewBox-100x100.svg" style="display: none">
</body>
</html>

View File

@ -46,6 +46,10 @@ skip-if(B2G) == canvas-drawImage-scale-1c.html lime100x100-ref.html
fuzzy(1,2) fails-if(Android&&AndroidVersion<15&&AndroidVersion!=10) == canvas-drawImage-scale-2a.html canvas-drawImage-scale-2-ref.html
fuzzy(1,2) fails-if(Android&&AndroidVersion<15&&AndroidVersion!=10) == canvas-drawImage-scale-2b.html canvas-drawImage-scale-2-ref.html
fuzzy-if(winWidget&&!d2d,1,10000) fuzzy-if(Android||B2G,1,10000) == canvas-drawImage-alpha-1.html canvas-drawImage-alpha-1-ref.html
#Same as scale-2a but with globalAlpha:
fuzzy(1,2) fuzzy-if(winWidget&&!d2d,1,40000) fuzzy-if(Android||B2G,1,40000) fails-if(Android&&AndroidVersion<15&&AndroidVersion!=10) == canvas-drawImage-alpha-2.html canvas-drawImage-alpha-2-ref.html
skip-if(B2G) == canvas-drawImage-slice-1a.html lime100x100-ref.html
== canvas-drawImage-slice-1b.html lime100x100-ref.html

View File

@ -0,0 +1,8 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" >
<rect x="0" y="0" height="100" width="100" fill="orange"/>
<g style="opacity:.75">
<rect x="2" y="2" height="96" width="96"
stroke-width="4" stroke="black" fill="yellow"/>
<circle cx="50" cy="50" r="46" style="fill: blue"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 330 B