Closed Bug 1719886 Opened 3 years ago Closed 3 years ago

Translated canvas with transformed pattern not drawn

Categories

(Core :: Graphics: Canvas2D, defect, P3)

defect

Tracking

()

RESOLVED FIXED
93 Branch
Tracking Status
firefox93 --- fixed

People

(Reporter: bdahl, Assigned: lsalzman)

References

(Depends on 1 open bug)

Details

Attachments

(4 files)

A canvas that has translated coordinates outside of the canvas bounds fails to draw a pattern that has a transform that should move the pattern back into the canvas bounds.

Overview of the test case:
Translate the canvas y 100 so is out of bounds. Create a non repeating pattern that uses a setTransform that reverses the y translation. Fill the canvas with the pattern.

STR

  1. Open attached example

Expected:
There should be a red square drawn in the top-left corner of the main canvas.

Actual:
Nothing is drawn

Attached image chrome output.png
Attached image firefox output.png
Blocks: gfx-triage
Severity: -- → S3
Priority: -- → P3
See Also: → 1719337
Flags: needinfo?(lsalzman)
No longer blocks: gfx-triage
Flags: needinfo?(lsalzman)

This is a bandaid designed to cope with a subset of the encountered transforms that
may be applied to a pattern inside FillRect. The existing code did not consider the
transform at all that might be applied to a pattern when it tried to manually clip
the geometry to a no-repeat pattern.

This manual clipping only seems to occur in FillRect, whereas no-repeat patterns
are not properly handled anywhere else in canvas entry-points. To fix this more
generally requires a clamp-to-transparent tile mode (like Skia's decal or Cairo's
none) which we can't currently rely upon with our D2D support. However, that is
much beyond the scope of this temporary workaround.

Assignee: nobody → lsalzman
Status: NEW → ASSIGNED
Depends on: 1263776
Pushed by lsalzman@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ffc7756de047
Support translated no-repeat patterns in canvas FillRect. r=jrmuizel
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 93 Branch
Regressions: 1768521
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: