Bug 271977 - REGRESSION (276827@main): When drawing a pattern, get the oriented image frame only if the orientation is not TopLeft
Summary: REGRESSION (276827@main): When drawing a pattern, get the oriented image fram...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Images (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Said Abou-Hallawa
URL:
Keywords: InRadar
Depends on:
Blocks: 265363
  Show dependency treegraph
 
Reported: 2024-04-01 11:43 PDT by Said Abou-Hallawa
Modified: 2024-04-01 14:36 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Said Abou-Hallawa 2024-04-01 11:43:27 PDT
BitmapImage::drawPattern() uses ImageOrientation::Orientation::FromImage when using the current ImageFrame to draw the pattern. We end up calling BitmapImageSource::preTransformedNativeImageAtIndex() via other calls. After 276827@main, this function checks

if (orientation == ImageOrientation::Orientation::None && size == sourceSize)
    return nativeImage;

Before resolving the orientation if FromImage is passed. We then resolve the image orientation.

if (orientation == ImageOrientation::Orientation::FromImage)
    orientation = frameOrientationAtIndex(index);

We then draw the current ImageFrame to a temporary ImageBuffer then we sink the drawn the ImageBuffer to a new NativeImage. This step is not needed if image orientation is TopLeft. We can just return the original image frame.
Comment 1 Radar WebKit Bug Importer 2024-04-01 12:10:16 PDT
<rdar://problem/125731142>
Comment 2 Said Abou-Hallawa 2024-04-01 12:28:33 PDT
Pull request: https://github.com/WebKit/WebKit/pull/26688
Comment 3 EWS 2024-04-01 14:36:15 PDT
Committed 276902@main (34d1f9aabb7b): <https://commits.webkit.org/276902@main>

Reviewed commits have been landed. Closing PR #26688 and removing active labels.