Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Image-Orientation] Fix canvas drawImage #21788

Merged
merged 1 commit into from Feb 16, 2020

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Feb 13, 2020

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.

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/c/chromium/src/+/2044050
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Xida Chen <xidachen@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Fernando Serboncini <fserb@chromium.org>
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Auto-Submit: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#741635}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Chromium project.

@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-2044050 branch 4 times, most recently from d428369 to 2095c2f Compare February 14, 2020 20:13
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.

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/c/chromium/src/+/2044050
Reviewed-by: Fredrik Söderquist <fs@opera.com>
Reviewed-by: Xida Chen <xidachen@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Fernando Serboncini <fserb@chromium.org>
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Auto-Submit: Stephen Chenney <schenney@chromium.org>
Cr-Commit-Position: refs/heads/master@{#741635}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants