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

8242861: Update ImagePattern to apply SVG pattern transforms #190

Closed
wants to merge 16 commits into from

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 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 label Apr 23, 2020
@mlbridge
Copy link

@mlbridge mlbridge bot commented Apr 23, 2020

@kevinrushforth
Copy link
Member

@kevinrushforth kevinrushforth commented Apr 27, 2020

/reviewers 2

@openjdk
Copy link

@openjdk 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

@kevinrushforth kevinrushforth commented Apr 27, 2020

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 Apr 27, 2020
@arun-Joseph
Copy link
Member Author

@arun-Joseph arun-Joseph commented Apr 29, 2020

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

@arun-Joseph arun-Joseph commented Apr 29, 2020

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

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 Jul 15, 2020
@openjdk openjdk bot removed the rfr label Jul 15, 2020
@arun-Joseph arun-Joseph marked this pull request as ready for review Aug 24, 2020
@openjdk openjdk bot added the rfr label Aug 24, 2020
@arun-Joseph arun-Joseph requested a review from kevinrushforth Aug 24, 2020
Copy link
Member

@kevinrushforth kevinrushforth left a comment

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

Copy link
Member

@arapte arapte left a comment

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.

arapte
arapte approved these changes Nov 6, 2020
@openjdk
Copy link

@openjdk 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 label Nov 6, 2020
@arun-Joseph
Copy link
Member Author

@arun-Joseph arun-Joseph commented Nov 6, 2020

/integrate

@openjdk openjdk bot closed this Nov 6, 2020
@openjdk openjdk bot added integrated and removed ready rfr labels Nov 6, 2020
@openjdk
Copy link

@openjdk 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 Nov 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants