Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Unified Diff: LayoutTests/fast/canvas/canvas-composite-stroke-alpha.html

Issue 227213002: globalCompositeOperation is ignored in stroke, strokeRect. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fixed Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/canvas/canvas-composite-stroke-alpha-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/canvas/canvas-composite-stroke-alpha.html
diff --git a/LayoutTests/fast/canvas/canvas-composite-alpha.html b/LayoutTests/fast/canvas/canvas-composite-stroke-alpha.html
similarity index 97%
copy from LayoutTests/fast/canvas/canvas-composite-alpha.html
copy to LayoutTests/fast/canvas/canvas-composite-stroke-alpha.html
index 1510d2db15f56e32bc59d17f42b1f611bb56e75d..43a87be3b336d58b3910a323f7742f9dddd10589 100644
--- a/LayoutTests/fast/canvas/canvas-composite-alpha.html
+++ b/LayoutTests/fast/canvas/canvas-composite-stroke-alpha.html
@@ -313,6 +313,7 @@
trMessageElement.appendChild(tdElement);
var ctx = expectedCanvasElement.getContext("2d");
+ ctx.lineWidth = 10;
// Draw expected image.
ctx.globalCompositeOperation = "copy";
ctx.fillStyle = getRGBAString(expectedColor.destination);
@@ -326,6 +327,7 @@
drawPolicy.drawComposition(ctx);
ctx = actualCanvasElement.getContext("2d");
+ ctx.lineWidth = 10;
// Draw destination rectangle.
ctx.globalCompositeOperation = "copy";
@@ -381,9 +383,9 @@
}
}
- var useFillRect = {
+ var useStrokeRect = {
drawSource: function(ctx) {
- ctx.fillRect(0, 0, 20, 20);
+ ctx.strokeRect(5, 5, 10, 10);
},
drawDestination: function(ctx) {
@@ -394,45 +396,35 @@
ctx.fillRect(5, 5, 15, 15);
},
- name: "fill rect"
+ name: "stroke rect"
};
- var usePathAndFill = {
+ var usePathAndStroke = {
drawSource: function(ctx) {
ctx.beginPath();
- ctx.moveTo(0, 0);
- ctx.lineTo(15, 0);
+ ctx.moveTo(5, 5);
+ ctx.lineTo(15, 5);
ctx.lineTo(15, 15);
ctx.lineTo(5, 15);
ctx.closePath();
- ctx.fill();
+ ctx.stroke();
},
drawDestination: function(ctx) {
- ctx.beginPath();
- ctx.moveTo(25, 25);
- ctx.lineTo(10, 25);
- ctx.lineTo(10, 10);
- ctx.lineTo(20, 10);
- ctx.closePath();
- ctx.fill();
+ ctx.fillRect(5, 5, 20, 20);
},
drawComposition: function(ctx) {
- ctx.fillRect(10, 10, 5, 5);
-
- ctx.beginPath();
- ctx.closePath();
- ctx.fill();
+ ctx.fillRect(5, 5, 15, 15);
},
- name: "path and fill"
+ name: "path and stroke"
};
function draw()
{
- drawTable(useFillRect);
- drawTable(usePathAndFill);
+ drawTable(useStrokeRect);
+ drawTable(usePathAndStroke);
if (window.testRunner)
testRunner.notifyDone();
}
@@ -448,7 +440,7 @@
</style>
</head>
<body onload="draw();">
- <p>This test exercises a bunch of color composition with alpha blending. The top-left rectangles are the source images and bottom-right rectangles are the destination images.</p>
+ <p>This test exercises a bunch of alpha composition checks with stroking. The top-left rectangles are the source images and bottom-right rectangles are the destination images.</p>
<div id="results">
</div>
<textarea id="debug"></textarea>
« no previous file with comments | « no previous file | LayoutTests/fast/canvas/canvas-composite-stroke-alpha-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698