Closed Bug 1615440 Opened 4 years ago Closed 4 years ago

[wpt-sync] Sync PR 21788 - [Image-Orientation] Fix canvas drawImage

Categories

(Core :: Graphics: Canvas2D, task, P4)

task

Tracking

()

RESOLVED FIXED
mozilla75
Tracking Status
firefox75 --- fixed

People

(Reporter: mozilla.org, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 21788 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/21788
Details from upstream follow.

Stephen Chenney <schenney@chromium.org> wrote:

[Image-Orientation] Fix canvas drawImage

Image orientation was not correctly applied in base_rendering_context_2d,
resulting in always oriented images sometimes drawn with the wrong source
rect. This change fixes that.

The image-orientation setting we respect always comes from the canvas
into which the image is being drawn. This keeps the rules for which
orientation to apply simple.

As part of this change, orientation is added to StaticBitmapImage and
used in the necessary cases to track the orientation of the source
image. Only non-texture-backed images will be drawn with the correct
orientation because image orientation is not supported by
directly composited images.

As part of this change, the code to correct an image source rect is
moved to Image and callers updated.

Bug: 1043790
Change-Id: I13d74b66cff912382f8f5efe0050eae6a0f283c0

Reviewed-on: https://chromium-review.googlesource.com/2044050
WPT-Export-Revision: 5cb57bc5602de55c8dbc89e1c810b4db80ba7dcf

Component: web-platform-tests → Canvas: 2D
Product: Testing → Core
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → INVALID
Status: RESOLVED → REOPENED
Resolution: INVALID → ---

CI Results

Ran 13 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI

Total 8 tests

Status Summary

Firefox

PASS: 6
FAIL: 2

Chrome

PASS: 2
FAIL: 6

Safari

PASS: 3
FAIL: 5

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

/2dcontext/drawing-images-to-the-canvas/image-orientation/drawImage-from-element-swap-width-height.html: FAIL (Chrome: FAIL, Safari: PASS)
/2dcontext/drawing-images-to-the-canvas/image-orientation/drawImage-from-bitmap-swap-width-height.html: FAIL (Chrome: FAIL, Safari: FAIL)

Pushed by wptsync@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/5b625db07181
[wpt PR 21788] - [Image-Orientation] Fix canvas drawImage, a=testonly
https://hg.mozilla.org/integration/autoland/rev/2157de86143f
[wpt PR 21788] - Update wpt metadata, a=testonly
Status: REOPENED → RESOLVED
Closed: 4 years ago4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla75
You need to log in before you can comment on or make changes to this bug.