Open Bug 1164912 Opened 9 years ago Updated 2 years ago

globalAlpha fails under certain radial gradient conditions

Categories

(Core :: Graphics: Canvas2D, defect)

7 Branch
Unspecified
Windows
defect

Tracking

()

Tracking Status
firefox38 --- wontfix
firefox38.0.5 --- wontfix
firefox39 --- wontfix
firefox40 --- wontfix
firefox41 --- wontfix
firefox-esr31 --- wontfix
firefox-esr38 --- wontfix

People

(Reporter: srjh1982, Assigned: bas.schouten)

References

Details

(Keywords: regression, Whiteboard: gfx-noted)

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36

Steps to reproduce:

Following js code fails to render correctly (with HTML canvas object of id "myCanvas"):

var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
var gradient = ctx.createRadialGradient(50, 50, 40, 50,50,50);

gradient.addColorStop("0", "black");
gradient.addColorStop("0.5", "red");
gradient.addColorStop("1.0", "black");

ctx.globalAlpha = 0.5;
ctx.beginPath();
ctx.strokeStyle = gradient;
ctx.lineWidth = 10;
ctx.arc(50,50,45,0,2*Math.PI);
ctx.stroke();

The fault occurs when the radial gradient begins at a value other than zero.


Actual results:

Drawn object rendered with full alpha; no transparency.


Expected results:

Drawn object renders with partial transparency as per globalAlpha value.
Reproduced since Firefox7 on Windows

Disable HWA or set gfx.canvas.azure.backends = skia,cairo helps

Pushlog:
https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=f53268a84b23&tochange=c0eaec585ea7

Triggered by:c0eaec585ea7	Bas Schouten — Bug 666097 - Fix radial gradient drawing in Azure. r=jrmuizel
Blocks: 666097
Status: UNCONFIRMED → NEW
Component: Untriaged → Graphics
Ever confirmed: true
Keywords: regression
OS: Unspecified → Windows
Product: Firefox → Core
Version: 37 Branch → Trunk
Attached file reporter's testcase
Component: Graphics → Canvas: 2D
Flags: needinfo?(bas)
Whiteboard: gfx-noted
Assignee: nobody → bas
Flags: needinfo?(bas)
Version: Trunk → 7 Branch
Attachment #8771142 - Flags: review?(jmuizelaar) → review-
Comment on attachment 8771142 [details]
Bug 1164912: Respect DrawOptions alpha value when drawing complex radial gradients.

https://reviewboard.mozilla.org/r/64388/#review61736

Looks reasonable but please include a test
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: