Skip to content

Conversation

@arun-joseph
Copy link
Member

@arun-joseph arun-joseph commented Apr 20, 2020

fillPath() and fillRect() functions in GraphicsContextJava.cpp use Image::drawPattern() for applying patterns as fill. But drawPattern() doesn't use patternTransform argument as ImagePattern doesn't have the same attribute. So, the final image won't be transformed.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8242861: Update ImagePattern to apply SVG pattern transforms

Reviewers

Download

$ git fetch https://git.openjdk.java.net/jfx pull/190/head:pull/190
$ git checkout pull/190

@bridgekeeper
Copy link

bridgekeeper bot commented Apr 20, 2020

👋 Welcome back ajoseph! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request.

@arun-joseph arun-joseph changed the title [WIP] 8242861: Update ImagePattern to apply SVG pattern transforms 8242861: Update ImagePattern to apply SVG pattern transforms Apr 23, 2020
@openjdk openjdk bot added the rfr Ready for review label Apr 23, 2020
@mlbridge
Copy link

mlbridge bot commented Apr 23, 2020

Webrevs

@kevinrushforth
Copy link
Member

/reviewers 2

@openjdk
Copy link

openjdk bot commented Apr 27, 2020

@kevinrushforth
The number of required reviews for this PR is now set to 2 (with at least 1 of role reviewers).

@kevinrushforth
Copy link
Member

Since this is in a common method used by all shapes, and not just WebView, we will need to ensure no regressions.

@kevinrushforth kevinrushforth self-requested a review April 27, 2020 23:56
@arun-joseph
Copy link
Member Author

All ImagePattern objects, other than the one from WebView, uses the second constructor which assigns an identity transform as the pattern transform. So, existing calls to PaintHelper concatenates the shader transform with an identity matrix and thus, shouldn't cause any regressions. Only calls from WebView's drawPattern() method in WCGraphicsPrismContext uses the patternTransform attribute.

@arun-joseph
Copy link
Member Author

The changes in drawPattern() forces the function to handle the operations for drawPattern (for images) and fillPattern (for shapes) together. If required, a new opcode SET_FILL_PATTERN can be introduced for handling patterns in shapes and part of the implementation can be seen from my previous commits to this PR.

Copy link
Member

@kevinrushforth kevinrushforth left a comment

Choose a reason for hiding this comment

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

This works for the HW accelerated pipeline, but you need to also modify the SW pipeline and J2D pipeline (used for printing). See SWPaint::computeImagePatternTransform and the ImagePattern case in J2DPrismGraphics::toJ2DPaint. In the J2D pipeline case, you will have more work to do, since it doesn't use a pattern transform that I can see.

@arun-joseph arun-joseph marked this pull request as draft July 15, 2020 03:36
@openjdk openjdk bot removed the rfr Ready for review label Jul 15, 2020
@arun-joseph arun-joseph marked this pull request as ready for review August 24, 2020 05:24
@openjdk openjdk bot added the rfr Ready for review label Aug 24, 2020
Copy link
Member

@kevinrushforth kevinrushforth left a comment

Choose a reason for hiding this comment

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

This looks good to me with one suggestion and one request for a clarifying comment.

Copy link
Member

@arapte arapte left a comment

Choose a reason for hiding this comment

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

Added a small query comment.
Rest looks good to me, change seems specific to ImagePattern transformation. This transformation is set only when specified from webkit and is identity otherwise.

@openjdk
Copy link

openjdk bot commented Nov 6, 2020

@arun-joseph This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8242861: Update ImagePattern to apply SVG pattern transforms

Reviewed-by: kcr, arapte

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 173 new commits pushed to the master branch:

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Ready to be integrated label Nov 6, 2020
@arun-joseph
Copy link
Member Author

/integrate

@openjdk openjdk bot closed this Nov 6, 2020
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Ready to be integrated rfr Ready for review labels Nov 6, 2020
@openjdk
Copy link

openjdk bot commented Nov 6, 2020

@arun-joseph Since your change was applied there have been 173 commits pushed to the master branch:

Your commit was automatically rebased without conflicts.

Pushed as commit dd22cd2.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@arun-joseph arun-joseph deleted the 8242861 branch November 6, 2020 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integrated Pull request has been integrated

Development

Successfully merging this pull request may close these issues.

3 participants