-
Notifications
You must be signed in to change notification settings - Fork 541
8242861: Update ImagePattern to apply SVG pattern transforms #190
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
Conversation
|
👋 Welcome back ajoseph! A progress list of the required criteria for merging this PR into |
Webrevs
|
|
/reviewers 2 |
|
@kevinrushforth |
|
Since this is in a common method used by all shapes, and not just WebView, we will need to ensure no regressions. |
|
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. |
|
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. |
kevinrushforth
left a comment
There was a problem hiding this 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.
kevinrushforth
left a comment
There was a problem hiding this 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.
modules/javafx.graphics/src/main/java/com/sun/prism/j2d/J2DPrismGraphics.java
Outdated
Show resolved
Hide resolved
modules/javafx.web/src/main/java/com/sun/javafx/webkit/prism/WCGraphicsPrismContext.java
Outdated
Show resolved
Hide resolved
arapte
left a comment
There was a problem hiding this 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.
modules/javafx.graphics/src/main/java/com/sun/prism/impl/ps/PaintHelper.java
Show resolved
Hide resolved
|
@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: 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
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 |
|
/integrate |
|
@arun-joseph Since your change was applied there have been 173 commits pushed to the
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. |
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
Issue
Reviewers
Download
$ git fetch https://git.openjdk.java.net/jfx pull/190/head:pull/190$ git checkout pull/190