Re: [OpenJDK 2D-Dev] RFR JDK-8184429: Path clipper added in Marlin2D & MarlinFX 0.8.0

2017-08-31 Thread Jim Graham
and accurate whether the entire path is EO or NZ... ...jim On 8/31/17 4:15 PM, Jim Graham wrote: For the Even-odd filling rule, I think it needs exact segment intersections on the left side, so I am focused on the Non-zero filling rule for now. They are identical

Re: [OpenJDK 2D-Dev] RFR JDK-8184429: Path clipper added in Marlin2D & MarlinFX 0.8.0

2017-08-31 Thread Jim Graham
pre-clip this" or "not" then this isn't really needed - just add the necessary logic to Renderer instead... ...jim On 8/31/17 4:15 PM, Jim Graham wrote: First, consider what is handled inside the guts of the Renderer process. - It doesn't need t

Re: [OpenJDK 2D-Dev] RFR JDK-8184429: Path clipper added in Marlin2D & MarlinFX 0.8.0

2017-08-31 Thread Jim Graham
First, consider what is handled inside the guts of the Renderer process. - It doesn't need to process any segments above or below the clip, they have no impact on the rendered pieces inside the clip - It needs to process segments that are out-left only in so far as it needs to come up with a pro

Re: [OpenJDK 2D-Dev] RFR JDK-8184429: Path clipper added in Marlin2D & MarlinFX 0.8.0

2017-08-31 Thread Jim Graham
the DDA stuff is just as good as any other technique for accomplishing that and since we have to do the DDA stuff anyway, we can just piggy-back off of that. When it calls addLine(), we will reject each of its pieces individually... ...jim On 8/31/17 12:45 PM, Jim Graha

Re: [OpenJDK 2D-Dev] RFR JDK-8184429: Path clipper added in Marlin2D & MarlinFX 0.8.0

2017-08-31 Thread Jim Graham
accuracy (cups...) Hope you will have time soon to look at the webrev, your feedback may help a lot. Cheers, Laurent Le 29 août 2017 2:58 AM, "Jim Graham" mailto:james.gra...@oracle.com>> a écrit : Hi Laurent, On 8/28/17 2:09 PM, Laurent Bourgès wrote: Hi Jim,

Re: [OpenJDK 2D-Dev] RFR JDK-8184429: Path clipper added in Marlin2D & MarlinFX 0.8.0

2017-08-28 Thread Jim Graham
Hi Laurent, On 8/28/17 2:09 PM, Laurent Bourgès wrote: Hi Jim, Thanks for your comments, it helped refining the webrev. Here are my answers: 2017-08-26 2:22 GMT+02:00 Jim Graham mailto:james.gra...@oracle.com>>: [D]Dasher.java - why the changes from (firstSegIdx > 0) to (fi

Re: [OpenJDK 2D-Dev] RFR JDK-8184429: Path clipper added in Marlin2D & MarlinFX 0.8.0

2017-08-25 Thread Jim Graham
Hi Laurent, I'm just reading through the code now to get a handle on the nature of the changes...(and starting with the 2D version)... [D]Dasher.java - why the changes from (firstSegIdx > 0) to (firstSegIdx != 0)? [D]Dasher.java - why is there a new goto_starting() which is only used from one p

Re: [OpenJDK 2D-Dev] [10] Review Request: 8185093 Expensive multi-core choke point when any graphics objects are created

2017-07-31 Thread Jim Graham
e-existing condition"... ...jim On 7/31/17 1:32 PM, Jim Graham wrote: I adjusted one of the statements to be a little more straightforward and set the compatibility risk to minimal. If Phil thinks the risk can be set to "None", that was my alternate, but

Re: [OpenJDK 2D-Dev] [10] JDK-8169044: The tray icon color is not green

2017-07-31 Thread Jim Graham
Will the tray icon canvas always be on the default screen? I believe the latest MacOS and Win10 both allow menu bars and task bars on all monitors. Linux may not be far behind... ...jim On 7/30/17 11:59 PM, Shashidhara Veerabhadraiah wrote: Hi, Kindly review a fix for

Re: [OpenJDK 2D-Dev] [10] Review Request: 8185093 Expensive multi-core choke point when any graphics objects are created

2017-07-31 Thread Jim Graham
lGraphicsEnvironment(), possibly with updating a specification? We have similar issues in other parts of code which I would like to update later after this one. Yes, I do think we can remove synchronized but we should do a CSR (CCC) On 07/25/2017 03:03 PM, Jim Graham wrote: +1 for the inner clas

Re: [OpenJDK 2D-Dev] [10] Review Request: 8185093 Expensive multi-core choke point when any graphics objects are created

2017-07-26 Thread Jim Graham
On 7/26/17 12:34 PM, Jim Graham wrote: I'll do a search and see if there are any cases of the above paradigm left... I did a basic grep over the Java sources in java.desktop looking primarily for synchronizations on a class, ignoring synchronized methods (both instance and static

Re: [OpenJDK 2D-Dev] [10] Review Request: 8185093 Expensive multi-core choke point when any graphics objects are created

2017-07-26 Thread Jim Graham
On 7/25/17 3:37 PM, Sergey Bylokhov wrote: If that is the case then I think we have a few places where we do this "manual conditional synchronization" that should probably be investigated. If I remember correctly, though, they may use the following paradigm which might not suffer from that is

Re: [OpenJDK 2D-Dev] [10] Review Request: 8185093 Expensive multi-core choke point when any graphics objects are created

2017-07-25 Thread Jim Graham
Hi Sergey, On 7/25/17 12:53 PM, Sergey Bylokhov wrote: In this variant the field should be volatile, and this will introduce some synchronization. Otherwise it will be possible to read non-null value in localEnv while the constructor of GraphicsEnvironment was not completed on some other thread

Re: [OpenJDK 2D-Dev] [10] Review Request: 8185093 Expensive multi-core choke point when any graphics objects are created

2017-07-25 Thread Jim Graham
This same thing is done in other places in a simpler way without creating an inner class simply by having createGE() do the assignment and test for null, as in: before: public static synchronized GraphicsEnvironment getLocalGraphicsEnvironment() { if (localEnv == null) {

Re: [OpenJDK 2D-Dev] [10] Review Request: 8183576 Synchronization in BufferedImage.setRGB(int x, int y, int rgb) is not necessary

2017-07-05 Thread Jim Graham
Looks fine to me... ...jim On 7/5/17 10:31 AM, Sergey Bylokhov wrote: Hello, Please review the fix for jdk10. Bug: https://bugs.openjdk.java.net/browse/JDK-8183576 Webrev can be found at: http://cr.openjdk.java.net/~serb/8183576/webrev.00 The method setRGB(int x, int y

Re: [OpenJDK 2D-Dev] [10] RFR JDK-8180055: Upgrade the Marlin renderer in Java2D

2017-05-16 Thread Jim Graham
This looks good. Approved... ...jim On 5/16/17 2:12 PM, Laurent Bourgès wrote: Hi, Here is a (slightly) modified Marlin2D patch after synchronizing again with the coming MarlinFX patch: http://cr.openjdk.java.net/~lbourges/marlin/Marlin-075.3/ Changes: - (D)Helpers:

Re: [OpenJDK 2D-Dev] [10] Marlin2D upgrade 0.7.5

2017-05-09 Thread Jim Graham
This looks fine, but I've reached out to Phil with a question about changing the default and whether we need to file a request for that. Is there a JBS bug for this yet? ...jim On 5/9/17 3:06 AM, Laurent Bourgès wrote: Jim, Here is the updated webrev: http://c

Re: [OpenJDK 2D-Dev] CFV: New2d group member : Laurent Bourges

2017-05-05 Thread Jim Graham
Vote: yes ...jim On 5/5/17 12:54 PM, Phil Race wrote: I hereby nominate Laurent Bourges to membership in the 2D group.

Re: [OpenJDK 2D-Dev] [10] Marlin2D upgrade 0.7.5

2017-05-05 Thread Jim Graham
Hi Laurent, A couple of comments that might just be points for clarification. Minimally it would make sense to include the JBS report number on the third item below, but the rest are just notes and suggestions... On 4/26/17 2:32 PM, Laurent Bourgès wrote: - MarlinProperties - TileSize vs

Re: [OpenJDK 2D-Dev] [10] Marlin2D upgrade 0.7.5

2017-04-25 Thread Jim Graham
Hi Laurent, - I found some fp constants with no "d" or "f" modifier. I sent a grep output in a separate email... - Why does FloatMath.java copy the constants from sun.misc rather than refer to them? (An alternative is a static import or having local copies that copy by source-based refer

Re: [OpenJDK 2D-Dev] [10] Marlin2D upgrade 0.7.5

2017-04-25 Thread Jim Graham
This is on my slate of things to finish code reviewing today, but I don't have an OpenJDK10 workspace built yet, so it will take some time to test a sanity check-build unless Phil wants to handle that...? ...jim On 4/22/17 4:28 AM, Laurent Bourgès wrote: Hi, I am pleas

Re: [OpenJDK 2D-Dev] [10] RFR 8078192: Path2D storage trimming

2017-04-20 Thread Jim Graham
Hi Laurent, The implementation looks good, except that the method chaining-style return value seems out of place here. Similar trimToSize() methods in Collections return void and none of the other methods in this area use the method chaining paradigm. In the interest of maintaining a common d

Re: [OpenJDK 2D-Dev] RFR: 8178457: Remove link to 2D guide from Line2D javadoc

2017-04-12 Thread Jim Graham
l the other classes would be to completely remove the entire sentence being modified. No mention of coordinate system at all. I can do that ... if it is what you meant. -phil. On 4/11/17, 3:01 PM, Jim Graham wrote: It's silly to include this statement in Line2D when no other geometry class

Re: [OpenJDK 2D-Dev] RFR: 8178457: Remove link to 2D guide from Line2D javadoc

2017-04-11 Thread Jim Graham
It's silly to include this statement in Line2D when no other geometry class bothers to mention this. It is considered assumed information if you've gotten far enough to be looking at this class. I would prefer to copy boiler plate from one of the other Foo2D geometry classes instead...

Re: [OpenJDK 2D-Dev] Review request for 8029339 Custom MultiResolution image support on HiDPI displays

2017-03-30 Thread Jim Graham
p://cr.openjdk.java.net/~alexsch/8029339/webrev.08/ - SunGraphics2D is updated to calculate the resolution variant size according to the _BASE, _DPI_FIT, and _SIZE_FIT resolution rendering hint - MultiResolutionRenderingHints test is added Thanks, Alexandr. On 4/7/2015 1:02 PM, Jim Gra

Re: [OpenJDK 2D-Dev] Review Request for JDK-7107905: ColorModel subclasses are missing hashCode() or equals() or both methods

2017-02-09 Thread Jim Graham
ks, Jay -Original Message- From: Jayathirth D V Sent: Wednesday, February 08, 2017 3:41 PM To: Jim Graham; Philip Race; 2d-dev@openjdk.java.net Subject: Re: [OpenJDK 2D-Dev] Review Request for JDK-7107905: ColorModel subclasses are missing hashCode() or equals() or both methods Hello All,

Re: [OpenJDK 2D-Dev] Review Request for JDK-7107905: ColorModel subclasses are missing hashCode() or equals() or both methods

2017-02-01 Thread Jim Graham
I think we should move this issue (array size returned from getCompSizes) into a separate bug entry and a separate fix. I don't think we need to fix the clone() in the constructor and the getter just to get hashcode/equals right... ...jim On 1/31/17 2:34 PM, Jim G

Re: [OpenJDK 2D-Dev] Review Request for JDK-7107905: ColorModel subclasses are missing hashCode() or equals() or both methods

2017-01-31 Thread Jim Graham
at the spec. says. Although it does indicate that there is at least a chance that application code might also fail due to similar assumptions. Does #1 not fail with the previous iteration of this change too ? -phil. On 01/30/2017 01:40 PM, Jim Graham wrote: Hmmm. Sounds like the test case

Re: [OpenJDK 2D-Dev] Review Request for JDK-7107905: ColorModel subclasses are missing hashCode() or equals() or both methods

2017-01-31 Thread Jim Graham
essage- From: Jayathirth D V Sent: Tuesday, January 31, 2017 11:53 AM To: Philip Race; Jim Graham; 2d-dev@openjdk.java.net Subject: Re: [OpenJDK 2D-Dev] Review Request for JDK-7107905: ColorModel subclasses are missing hashCode() or equals() or both methods Hi Phil & Jim, Thanks for your i

Re: [OpenJDK 2D-Dev] Review Request for JDK-7107905: ColorModel subclasses are missing hashCode() or equals() or both methods

2017-01-30 Thread Jim Graham
Hmmm. Sounds like the test cases were written based on bugs in the implementation. I'm not sure what the best tactic is here for the short term for getting this in, but many of these changes should eventually be considered bugs in the tests. Is it acceptable to break API tests like this at the

Re: [OpenJDK 2D-Dev] RFR: 8130737: AffineTransformOp can't handle child raster with non-zero x-offset

2016-12-20 Thread Jim Graham
+1 for the code changes, but I didn't review the test case... ...jim On 12/19/16 8:48 PM, Philip Race wrote: Bug: https://bugs.openjdk.java.net/browse/JDK-8130737 Webrev : http://cr.openjdk.java.net/~prr/8130737/ If a child raster is created with a non-zero x-offset th

Re: [OpenJDK 2D-Dev] [9] Review Request: 8167310 The graphics clip is incorrectly rounded for some fractional scales

2016-11-02 Thread Jim Graham
it is possible to tweak the transform? I mean that we can apply the "round", then calculate the diff between resulted destination and destination based on transform, and shift/rescale the transform so it will map exactly the pixels from source edges to destination edges. On 29.10.16 0

Re: [OpenJDK 2D-Dev] [9] Review Request: 8167310 The graphics clip is incorrectly rounded for some fractional scales

2016-10-28 Thread Jim Graham
oposed change you talk about below... ...jim On 10/28/16 6:40 AM, Alexandr Scherbatiy wrote: On 10/11/2016 10:13 PM, Sergey Bylokhov wrote: On 11.10.16 21:54, Jim Graham wrote: Additionally, for AA rendering, there is no such thing as "setClip(someShape)" and "fill(same

Re: [OpenJDK 2D-Dev] [9] Review Request: 8167310 The graphics clip is incorrectly rounded for some fractional scales

2016-10-28 Thread Jim Graham
ange you talk about below... ...jim On 10/28/16 6:40 AM, Alexandr Scherbatiy wrote: On 10/11/2016 10:13 PM, Sergey Bylokhov wrote: On 11.10.16 21:54, Jim Graham wrote: Additionally, for AA rendering, there is no such thing as "setClip(someShape)" and "

Re: [OpenJDK 2D-Dev] Marlin vs OpenPisces

2016-10-13 Thread Jim Graham
think the below list is reasonably comprehensive... ...jim On 10/13/16 1:24 PM, Jim Graham wrote: I'm trying to track down the old history after a lot of file moves, but here is what I have so far: (Note that some of these only apply when we use it in non-AA mode where

Re: [OpenJDK 2D-Dev] Marlin vs OpenPisces

2016-10-13 Thread Jim Graham
I'm trying to track down the old history after a lot of file moves, but here is what I have so far: (Note that some of these only apply when we use it in non-AA mode where we set the number of subpixel samples to 1x1) https://bugs.openjdk.java.net/browse/JDK-8092682 (non-AA: changing BND con

Re: [OpenJDK 2D-Dev] [9] Review Request: 8167310 The graphics clip is incorrectly rounded for some fractional scales

2016-10-12 Thread Jim Graham
On 10/11/16 12:49 PM, Jim Graham wrote: Right now I tried to fix overlapping, which produce visible artifacts and were considered as a bugs. The next issue which I would like to fix is a overlapping of drawImage(). Yes, that bears investigation... I looked into it and the issue is basically

Re: [OpenJDK 2D-Dev] [9] Review Request: 8167310 The graphics clip is incorrectly rounded for some fractional scales

2016-10-11 Thread Jim Graham
That looks good. +1 ...jim On 10/11/16 4:32 PM, Sergey Bylokhov wrote: On 11.10.16 23:12, Jim Graham wrote: Also, is it worth having a protective test for Rectangle in the intersect(Rectangle2D) method to avoid all of the double math when the rectangle was already an

Re: [OpenJDK 2D-Dev] [9] Review Request: 8167310 The graphics clip is incorrectly rounded for some fractional scales

2016-10-11 Thread Jim Graham
Also, is it worth having a protective test for Rectangle in the intersect(Rectangle2D) method to avoid all of the double math when the rectangle was already an integer one? ...jim On 10/10/16 4:37 PM, Sergey Bylokhov wrote: On 10.10.16 23:42, Jim Graham wrote: Can we

Re: [OpenJDK 2D-Dev] [9] Review Request: 8167310 The graphics clip is incorrectly rounded for some fractional scales

2016-10-11 Thread Jim Graham
erized the shape, so we should set an empty clip if we get a NaN in any coordinate... ...jim On 10/10/16 4:37 PM, Sergey Bylokhov wrote: On 10.10.16 23:42, Jim Graham wrote: Can we also not use MAX_INT for the drawImage test case? Either have the drawImage follow the cli

Re: [OpenJDK 2D-Dev] [9] Review Request: 8167310 The graphics clip is incorrectly rounded for some fractional scales

2016-10-11 Thread Jim Graham
On 10/11/16 12:13 PM, Sergey Bylokhov wrote: On 11.10.16 21:54, Jim Graham wrote: Additionally, for AA rendering, there is no such thing as "setClip(someShape)" and "fill(sameShape)" being identical no matter how much we predict which rules they may want because clips are i

Re: [OpenJDK 2D-Dev] [9] Review Request: 8167310 The graphics clip is incorrectly rounded for some fractional scales

2016-10-11 Thread Jim Graham
On 10/10/16 3:23 PM, Phil Race wrote: That last sentence sounds like the right answer in principle but I don't know if we'll be unpleasantly surprised by some consequence of "... that setClip(Shape) and fill(Shape) might disagree .." -phil. As I was thinking more about this last night we

Re: [OpenJDK 2D-Dev] [9] Review Request: 8167310 The graphics clip is incorrectly rounded for some fractional scales

2016-10-11 Thread Jim Graham
On 10/10/16 3:53 PM, Sergey Bylokhov wrote: On 11.10.16 1:23, Phil Race wrote: Yes, I think adjacent drawImage requests should not overlap. We should look into this separately. So previously, overlapping of the clip bounds ensured adjacent images were not drawn over-lapped .. but with this

Re: [OpenJDK 2D-Dev] [9] Review Request: 8167310 The graphics clip is incorrectly rounded for some fractional scales

2016-10-10 Thread Jim Graham
depends on what image was painted first). - Should the clip be affected by the stroke(if it was set by the shape)? Right now if the clip was set by the shape it will produce different result than if it was set via rectangle. On 10.10.16 22:29, Jim Graham wrote: That does sound like a problem

Re: [OpenJDK 2D-Dev] [9] Review Request: 8167310 The graphics clip is incorrectly rounded for some fractional scales

2016-10-10 Thread Jim Graham
[CC'ing Phil in case he has some suggestions for how the API should work...] Responding just to additional questions in this email... On 10/10/16 12:45 PM, Sergey Bylokhov wrote: The additional questions: - In the current fix we change behavior of the clip. Before the fix if we set the clip t

Re: [OpenJDK 2D-Dev] [9] Review Request: 8167310 The graphics clip is incorrectly rounded for some fractional scales

2016-10-10 Thread Jim Graham
Yes, we do bias both. So, the code we just added doesn't match the biasing that is performed by the fill operations, we should probably make it be the same. You can see that it computes a bias boolean when it calls getFillSSI(), but the bias is applied natively in the native ShapeSpanIterator c

Re: [OpenJDK 2D-Dev] [9] Review Request: 8167310 The graphics clip is incorrectly rounded for some fractional scales

2016-10-10 Thread Jim Graham
That does sound like a problem. Does it do the same thing with new Path2D(Rectangle)? The Area class does some processing on the path and it would be nice to eliminate that as a potential source of this problem. I don't have a buildable JDK9 repo right now that I can fire off some quick tests

Re: [OpenJDK 2D-Dev] [9] Review Request: 8167310 The graphics clip is incorrectly rounded for some fractional scales

2016-10-10 Thread Jim Graham
On 10/10/16 11:55 AM, Sergey Bylokhov wrote: On 10.10.16 21:31, Jim Graham wrote: OK, but you only need a line width of 2.0 to cover the gap regardless of scale. Line width scales in user space so larger scales scale up the line width along with the clip region being rendered. With

Re: [OpenJDK 2D-Dev] [9] Review Request: 8167310 The graphics clip is incorrectly rounded for some fractional scales

2016-10-10 Thread Jim Graham
Hi Sergey, Comments inline... On 10/8/16 2:15 PM, Sergey Bylokhov wrote: On 08.10.16 0:58, Jim Graham wrote: That looks great. A couple of questions. An updated version and a comments inline: http://cr.openjdk.java.net/~serb/8167310/webrev.01 Test case: Where do you get white gaps? Is

Re: [OpenJDK 2D-Dev] HiDPI support issues on Windows

2016-10-07 Thread Jim Graham
ed to scroll, it gets a little dicey unless the scroll mode is considered just a hint. ...jim On 10/7/16 3:41 PM, Jim Graham wrote: Aren't the components inside the scrollpane located relative to the origin of the entire scrollable region? In which case, the precise l

Re: [OpenJDK 2D-Dev] HiDPI support issues on Windows

2016-10-07 Thread Jim Graham
have fractional coordinate which we cannot use via int API. On 07.10.16 0:21, Jim Graham wrote: Yes, most likely. It involves making sure that the origin of the viewport is always an even multiple of pixels, then the copyArea will match up with the repainting. The damage repair messages here

Re: [OpenJDK 2D-Dev] [9] Review Request: 8167310 The graphics clip is incorrectly rounded for some fractional scales

2016-10-07 Thread Jim Graham
That looks great. A couple of questions. Region, line 132: why are you testing for newv > coordinate? Test case: Where do you get white gaps? Is it in the line test? If so, then consider setting the line width higher (or drawing 2 lines per iteration as I mention in the last paragraph). I

Re: [OpenJDK 2D-Dev] HiDPI support issues on Windows

2016-10-06 Thread Jim Graham
f the graphics)... ...jim On 10/6/16 3:11 AM, Anton Tarasov wrote: Hi all, On 04 Oct 2016, at 23:28, Jim Graham wrote: On 10/4/16 1:01 PM, Anton Tarasov wrote: Anyway, I roughly tried your approach mentioned in the previous e-mail, but forcing RM to paint via offs

Re: [OpenJDK 2D-Dev] HiDPI support issues on Windows

2016-10-06 Thread Jim Graham
..jim On 10/4/16 1:46 PM, Anton Tarasov wrote: On 10/4/2016 11:30 PM, Jim Graham wrote: I wasn't familiar with the test code for this particular case. Is it in a bug report somewhere? Jim, I'm re-attaching it (it was in my first e-mail). Thanks, Anton. ...jim On 10/4/16

Re: [OpenJDK 2D-Dev] HiDPI support issues on Windows

2016-10-05 Thread Jim Graham
. On 02.10.16 22:10, Jim Graham wrote: After looking into the code in RepaintManager and re-reading Alexander's message again I can see how it describes what is going on more clearly. Fixing the rounding errors doesn't necessarily require avoiding use of the intermediate image for damage r

Re: [OpenJDK 2D-Dev] HiDPI support issues on Windows

2016-10-04 Thread Jim Graham
I wasn't familiar with the test code for this particular case. Is it in a bug report somewhere? ...jim On 10/4/16 1:01 PM, Anton Tarasov wrote: Also, the problem with primitives rendering (http://cr.openjdk.java.net/%7Eant/hidpi_pics/Scaling-150-percent.png) is still

Re: [OpenJDK 2D-Dev] HiDPI support issues on Windows

2016-10-04 Thread Jim Graham
On 10/4/16 1:01 PM, Anton Tarasov wrote: Anyway, I roughly tried your approach mentioned in the previous e-mail, but forcing RM to paint via offscreen BufferedImage, not volatile (just for a quick check). It solved the shift issue of the demo listed in 8162350, which is cool. It also solved the

Re: [OpenJDK 2D-Dev] HiDPI support issues on Windows

2016-10-04 Thread Jim Graham
On 10/4/16 1:01 PM, Anton Tarasov wrote: - Simply ask for a large enough integer to make sure you got the entire clip to fit in it and let the allocator give you an even larger image. It doesn't matter if you paint into a larger image (other than having to allocate an extra row/column on occasi

Re: [OpenJDK 2D-Dev] HiDPI support issues on Windows

2016-10-03 Thread Jim Graham
Hi Anton, Yes, the numbers you are describing are consistent with performing that standard boilerplate using an origin/translate that is not exactly at an integer pixel location. My comments about our mechanisms not allowing for scale-aware allocations can be dealt with in a couple of ways:

Re: [OpenJDK 2D-Dev] HiDPI support issues on Windows

2016-10-02 Thread Jim Graham
TITY) // translate by an integer amount, and then scale g.setClip(pixelx1, pixely1, pixelw, pixelh) g.translate(pixelx1, pixely1) g.scale(scaleX, scaleY); component.paint(g) destinationg.setTransform(IDENTITY) destinationg.drawImage(img, pixelx1, pixely1) // (restore transforms where needed)

Re: [OpenJDK 2D-Dev] HiDPI support issues on Windows

2016-09-30 Thread Jim Graham
On 9/30/16 3:22 AM, Alexandr Scherbatiy wrote: The problem is that the RepaintManager draws a region to a buffered image at first and draws the image after that to the window. Suppose the image has int coordinates and size (x, y, w, h) in the user space. It should be drawn into the region wit

Re: [OpenJDK 2D-Dev] [8u Backport] Fix for JDK-8158356 : SIGSEGV when attempting to rotate BufferedImage using AffineTransform by NaN degrees

2016-09-29 Thread Jim Graham
address the review comment in JDK-8166009. The original backport webrev is still the same. http://cr.openjdk.java.net/~aghaisas/8158356/8u_backport/webrev.00/ Request you to approve this 8u backport. Regards, Ajit -Original Message- From: Jim Graham Sent: Friday, September

Re: [OpenJDK 2D-Dev] Request for Review: JDK-8162591 All existing gradient paint implementations have issues with coordinates/sizes larger than Short.MAX_VALUE (exactly) on any Linux systems

2016-09-27 Thread Jim Graham
All of those conditions are optimized equivalents to getting the determinant. invert() is a destructive call, but since getTransform is documented to return a copy, that is fine - but getDeterminant() will involve less math to check the condition... ...jim On 9/27/16 6

Re: [OpenJDK 2D-Dev] Different rounding applied by ProcessPath and ShapeSpanIterator

2016-09-26 Thread Jim Graham
I hope that explanation was at least 90% accurate... ...jim On 9/26/16 11:55 AM, Jim Graham wrote: They do operate differently. They aren't meant to be mixed and matched. One thing that may shed some light is the STROKE_CONTROL hint. If it is sent to Pure then th

Re: [OpenJDK 2D-Dev] Different rounding applied by ProcessPath and ShapeSpanIterator

2016-09-26 Thread Jim Graham
They do operate differently. They aren't meant to be mixed and matched. One thing that may shed some light is the STROKE_CONTROL hint. If it is sent to Pure then there is no heuristic for how to rasterize and all rasterizers should agree on how to scan convert shapes. But, if it is set to an

Re: [OpenJDK 2D-Dev] [9] Review request for 8163854 Add ToolkitImage.getImage() method which loads an image with schema variant

2016-09-22 Thread Jim Graham
Does that need a whole new API class to support a list of strings ? And it still not a "schema". It is simply one of a list of suffixes. -phil. On 9/22/16, 1:51 PM, Jim Graham wrote: If I am developing a skinned UI and I provide a set of 20 images for various parts of the controls and

Re: [OpenJDK 2D-Dev] [9] Review request for 8163854 Add ToolkitImage.getImage() method which loads an image with schema variant

2016-09-22 Thread Jim Graham
If I am developing a skinned UI and I provide a set of 20 images for various parts of the controls and then hand off to my graphic designer to create the DPI variants for all of the images, it is much easier for me to tell them to name all of the images with suffixes for the DPI variants and then

Re: [OpenJDK 2D-Dev] [9] Review request for 8163854 Add ToolkitImage.getImage() method which loads an image with schema variant

2016-09-22 Thread Jim Graham
andle things as Phil suggests... ...jim On 9/21/16 5:48 PM, Jim Graham wrote: I think this is a good point. The only gotcha would appear to be handling the ImageObserver notifications and the prepareImage() calls. The ImageObserver should get the variant's dim

Re: [OpenJDK 2D-Dev] [9] Review request for 8163854 Add ToolkitImage.getImage() method which loads an image with schema variant

2016-09-21 Thread Jim Graham
I think this is a good point. The only gotcha would appear to be handling the ImageObserver notifications and the prepareImage() calls. The ImageObserver should get the variant's dimensions as one of the first notifications, though if they trigger an image load and then add an observer later,

Re: [OpenJDK 2D-Dev] [8u Backport] Fix for JDK-8158356 : SIGSEGV when attempting to rotate BufferedImage using AffineTransform by NaN degrees

2016-09-01 Thread Jim Graham
Hi Ajit, In the cases where you "continue" on a non-finite slope, doesn't that mean that the edges will be mismatched? If you can't determine the bounding polygon, perhaps the entire operation should be aborted instead...? It's different from the case of dy1==dy2 which also results in a "cont

Re: [OpenJDK 2D-Dev] [9]Fix for JDK-8158356 : SIGSEGV when attempting to rotate BufferedImage using AffineTransform by NaN degrees

2016-08-24 Thread Jim Graham
hilip Race Sent: Thursday, August 11, 2016 3:22 AM To: Jim Graham Cc: Ajit Ghaisas; 2d-dev Subject: Re: [OpenJDK 2D-Dev] [9]Fix for JDK-8158356 : SIGSEGV when attempting to rotate BufferedImage using AffineTransform by NaN degrees Agreed, I had previously asked for that too (off-line). ie. root cause

Re: [OpenJDK 2D-Dev] 8138771: java.awt.image.AbstractMultiResolutionImage needs customized spec for methods of Image which it implements

2016-08-24 Thread Jim Graham
Hi Avik, On 8/23/16 11:43 PM, Avik Niyogi wrote: Hi Jim, Just a few queries I have regarding the inputs provided. I have added them inline in red. Thank you for further inputs in advance. On 24-Aug-2016, at 3:02 am, Jim Graham mailto:james.gra...@oracle.com>> wrote: I wonder why the @

Re: [OpenJDK 2D-Dev] 8138771: java.awt.image.AbstractMultiResolutionImage needs customized spec for methods of Image which it implements

2016-08-23 Thread Jim Graham
I wonder why the @throws is not inherited...? Another way to fix this would be to implement it in the base Image class with the throw and all classes that can return a graphics override it. Then you wouldn't even need documentation in the AMRI class just to say "never mind we don't provide thi

Re: [OpenJDK 2D-Dev] [9] Review request for 8151303 [macosx] [hidpi] JButton's low-res. icon is visible when clicking on it

2016-08-15 Thread Jim Graham
:10, Jim Graham wrote: Hi Alexandr, Should something be done to transfer the array of sizes to the new instance if the source is an MRCI? Perhaps a special case for MRCI as well that calls mrciInstance.map(mapper) instead of constructing a brand new object from scratch? ...jim On 08

Re: [OpenJDK 2D-Dev] [9] Review request for 8151303 [macosx] [hidpi] JButton's low-res. icon is visible when clicking on it

2016-08-11 Thread Jim Graham
/2016 01:32 AM, Alexander Scherbatiy wrote: Could you review the updated fix: http://cr.openjdk.java.net/~alexsch/8151303/webrev.03 MultiResolutionToolkitImage handing is added to the MultiResolutionCachedImage.map() method. Thanks, Alexandr. On 11/08/16 01:46, Jim Graham wrote: Ah, yes, only

Re: [OpenJDK 2D-Dev] [9]Fix for JDK-8158356 : SIGSEGV when attempting to rotate BufferedImage using AffineTransform by NaN degrees

2016-08-10 Thread Jim Graham
This does address the specific test case directly, but I'd be happier if we dug down and figured out where it went wrong in trying to transform the image and put in a fix that addressed the root problem whether it comes from the inputs being NaN or from some other similar condition that could als

Re: [OpenJDK 2D-Dev] [9] Review request for 8151303 [macosx] [hidpi] JButton's low-res. icon is visible when clicking on it

2016-08-10 Thread Jim Graham
for a non-MRCI... ...jim On 8/10/16 5:35 AM, Alexander Scherbatiy wrote: On 09/08/16 03:49, Jim Graham wrote: Does MultiResolutionCachedImage.map() work if the Image hasn't been loaded yet (where getWidth/Height(Observer) can return -1)? Can it ever be called in a case like that? Could we r

Re: [OpenJDK 2D-Dev] [9] Review request for 8151303 [macosx] [hidpi] JButton's low-res. icon is visible when clicking on it

2016-08-08 Thread Jim Graham
xandr. On 27/06/16 22:17, Alexander Scherbatiy wrote: Hello, Could you review the updated fix: http://cr.openjdk.java.net/~alexsch/8151303/webrev.02 The fix does not use a new public API to apply filters to multi-resolution images. Thanks, Alexandr. On 14/05/16 02:54, Jim G

Re: [OpenJDK 2D-Dev] RFR 8159638: Improve array caches and renderer stats in Marlin renderer

2016-08-03 Thread Jim Graham
mmands and it works well. Here is the updated webrev: http://cr.openjdk.java.net/~lbourges/marlin/marlin-8159638.2/ Cheers, Laurent 2016-08-03 2:28 GMT+02:00 Jim Graham mailto:james.gra...@oracle.com>>: How about instead of the shell script we put a comment up at the top of the fil

Re: [OpenJDK 2D-Dev] RFR 8159638: Improve array caches and renderer stats in Marlin renderer

2016-08-02 Thread Jim Graham
source file" so should have a license. -phil. On 8/2/16, 2:56 PM, Jim Graham wrote: Thanks Laurent, On 08/02/2016 05:57 AM, Laurent Bourgès wrote: Thanks for the tip, I made another webrev (for archive) that shows the proper diffs in ArrayCache / ArrayCacheConst: http://cr.openjdk.java.net/~lb

Re: [OpenJDK 2D-Dev] RFR: 8074843: Resolve disabled warnings for libmlib_image and libmlib_image_v

2016-08-02 Thread Jim Graham
I agree as well. Assignments really aren't ever needed inside if statements... ...jim On 08/02/2016 03:06 PM, Vadim Pakhnushev wrote: Or as j = w & 1; if (j != 0) { as in other longer cases. Too much parentheses to my taste. Vadim On 03.08.2016 1:04, J

Re: [OpenJDK 2D-Dev] RFR: 8074843: Resolve disabled warnings for libmlib_image and libmlib_image_v

2016-08-02 Thread Jim Graham
te. Vadim On 03.08.2016 1:04, Jim Graham wrote: In that case, then I'd write it as "if ((j = (w & 1)) != 0)" to make it clear that the LHS is an assignment. A casual reading of the code might see this as a comparison with an extra set of parentheses until someone counts the equal

Re: [OpenJDK 2D-Dev] RFR: 8074843: Resolve disabled warnings for libmlib_image and libmlib_image_v

2016-08-02 Thread Jim Graham
In that case, then I'd write it as "if ((j = (w & 1)) != 0)" to make it clear that the LHS is an assignment. A casual reading of the code might see this as a comparison with an extra set of parentheses until someone counts the equal signs... ...jim On 08/02/2016 10:38

Re: [OpenJDK 2D-Dev] [9] Review request for 8160124 SunGraphics2D.hitClip() can give wrong result for floating point scale

2016-08-02 Thread Jim Graham
On 08/02/2016 10:36 AM, Sergey Bylokhov wrote: On 27.07.16 1:56, Jim Graham wrote: Rectangle2D rClip = (Rectangle2D) usrClip; int x0 = (int) Math.ceil(rClip.getMinX() - 0.5); int y0 = (int) Math.ceil(rClip.getMinY() - 0.5); int x1 = (int) Math.ceil(rClip.getMaxX() - 0.5); int x1 = (int

Re: [OpenJDK 2D-Dev] RFR 8159638: Improve array caches and renderer stats in Marlin renderer

2016-08-02 Thread Jim Graham
Thanks Laurent, On 08/02/2016 05:57 AM, Laurent Bourgès wrote: Thanks for the tip, I made another webrev (for archive) that shows the proper diffs in ArrayCache / ArrayCacheConst: http://cr.openjdk.java.net/~lbourges/marlin/marlin-8159638.1_bis/

Re: [OpenJDK 2D-Dev] RFR 8159638: Improve array caches and renderer stats in Marlin renderer

2016-08-01 Thread Jim Graham
he is clean or dirty + the putArray method always performs the array cleanup - ArrayCache renamed to ArrayCacheConst + simplified thresholds More comments, below: 2016-07-21 23:41 GMT+02:00 Jim Graham mailto:james.gra...@oracle.com>>: On 07/21/2016 06:56 AM, Laurent Bourgès wrote:

Re: [OpenJDK 2D-Dev] [9] RFR: JDK-8160943 : skipImage() in JPEGImageReader class throws IIOException if we have gaps between markers in Jpeg image

2016-08-01 Thread Jim Graham
Hi Jay, This looks good... ...jim On 8/1/16 1:26 AM, Jayathirth D V wrote: Hi, Please review the following fix in JDK9 at your convenience: Bug : https://bugs.openjdk.java.net/browse/JDK-8160943 Webrev : http://cr.openjdk.java.net/~jdv/8160943/webrev.00/ Root

Re: [OpenJDK 2D-Dev] Review Request for JDK-8153943 : In PixelInterLeavedSampleModel and BandedSampleModel we dont need hashCode() method

2016-07-28 Thread Jim Graham
Please find webrev for the above changes: http://cr.openjdk.java.net/~jdv/8153943/webrev.04/ Thanks, Jay -Original Message----- From: Jim Graham Sent: Thursday, June 30, 2016 4:22 AM To: Phil Race Cc: Jayathirth D V; 2d-dev@openjdk.java.net Subject: Re: [OpenJDK 2D-Dev] Review Request f

Re: [OpenJDK 2D-Dev] [9] Review request for 8160124 SunGraphics2D.hitClip() can give wrong result for floating point scale

2016-07-26 Thread Jim Graham
oordinates overflow an integer, but that would be the basic gist of what we should be doing in that case in validateCompClip()... ...jim On 07/26/2016 02:50 PM, Sergey Bylokhov wrote: On 13.07.16 5:42, Jim Graham wrote: What does the compClip end up being in

Re: [OpenJDK 2D-Dev] Review request for: JDK-8147542 Linux: ClassCastException when repainting after display resolution change

2016-07-22 Thread Jim Graham
+1 from me too... ...jim On 07/22/2016 10:16 AM, Phil Race wrote: This is OK by me. -phil. On 07/22/2016 02:20 AM, Alexey Ushakov wrote: Friendly reminder :) Best Regards, Alexey On 13 Jul 2016, at 12:33, Alexey Ushakov mailto:alexey.usha...@jetbrains.com>> wrote: Hi, Is

Re: [OpenJDK 2D-Dev] Review Request for JDK-8160943 : [PIT] new failure of closed/javax/imageio/ReadAllThumbnailsTest.java

2016-07-22 Thread Jim Graham
I just ran the test case attached in https://bugs.openjdk.java.net/browse/JDK-4958271 . It is actually generating an image and using it to do reader.readAll(). Thanks, Jay -Original Message----- From: Jim Graham Sent: Thursday, July 21, 2016 2:22 PM To: Jayathirth D V; Philip Race Cc: 2d-dev Subj

Re: [OpenJDK 2D-Dev] Review Request for JDK-7107905: ColorModel subclasses are missing hashCode() or equals() or both methods

2016-07-21 Thread Jim Graham
-Original Message- From: Jim Graham Sent: Tuesday, July 12, 2016 7:41 PM To: Jayathirth D V; Philip Race Cc: 2d-dev@openjdk.java.net Subject: Re: [OpenJDK 2D-Dev] Review Request for JDK-7107905: ColorModel subclasses are missing hashCode() or equals() or both methods Hi Jay, When I write

Re: [OpenJDK 2D-Dev] RFR 8159638: Improve array caches and renderer stats in Marlin renderer

2016-07-21 Thread Jim Graham
Hi Laurent, On 07/21/2016 06:56 AM, Laurent Bourgès wrote: I don't have any issues with those numbers, but the way that they are calculated makes it look like they are supposed to be unique numbers and yet through the obscurity of the loops used to populate the sizes they just en

Re: [OpenJDK 2D-Dev] Review Request for JDK-8160943 : [PIT] new failure of closed/javax/imageio/ReadAllThumbnailsTest.java

2016-07-21 Thread Jim Graham
particular image) with new image that I have created. Thanks, Jay -Original Message- From: Philip Race Sent: Wednesday, July 13, 2016 10:06 AM To: Jim Graham Cc: Jayathirth D V; 2d-dev Subject: Re: [OpenJDK 2D-Dev] Review Request for JDK-8160943 : [PIT] new failure of closed/javax/imageio/

Re: [OpenJDK 2D-Dev] RFR 8159638: Improve array caches and renderer stats in Marlin renderer

2016-07-19 Thread Jim Graham
Hi Laurent, Some work should be done on the comments at the top of ArrayCache.java - line 38 and 42 make the same claim about 2 different thresholds. It seems silly, but in ArrayCache.getNewLargeSize(), lines 162 and 164 are both ">" tests and then the newly added test at 166 is a "<" test.

Re: [OpenJDK 2D-Dev] Review Request for JDK-8160943 : [PIT] new failure of closed/javax/imageio/ReadAllThumbnailsTest.java

2016-07-12 Thread Jim Graham
v/8160943/webrev.00/ Thanks, Jay *From:*Phil Race *Sent:* Saturday, July 09, 2016 12:37 AM *To:* Jayathirth D V *Cc:* Jim Graham; 2d-dev *Subject:* Re: REG : JDK-8160943 : [PIT] new failure of closed/javax/imageio/ReadAllThumbnailsTest.java On 07/08/2016 04:08 AM, Jayathirth D V wrote:

Re: [OpenJDK 2D-Dev] [9] Review request for 8160124 SunGraphics2D.hitClip() can give wrong result for floating point scale

2016-07-12 Thread Jim Graham
What does the compClip end up being in that case? ...jim On 7/4/16 1:12 AM, Sergey Bylokhov wrote: On 01.07.16 2:49, Jim Graham wrote: How is it returning true? If the clip really is empty, then intersectsQuickCheck() should never return true. Or are you saying that

Re: [OpenJDK 2D-Dev] Review Request for JDK-7107905: ColorModel subclasses are missing hashCode() or equals() or both methods

2016-07-12 Thread Jim Graham
concern of "The ColorModel equals and hashCode methods should spell out the protocol subclasses need to follow to obey the respective contracts of methods.", I have discussed with Phil also regarding the same offline. Any inputs on this also would be helpful. Thanks, Jay -O

Re: [OpenJDK 2D-Dev] REG : JDK-8160943 : [PIT] new failure of closed/javax/imageio/ReadAllThumbnailsTest.java

2016-07-12 Thread Jim Graham
universally considered a valid JPEG? ...jim On 7/12/16 6:57 PM, Jim Graham wrote: That doesn't appear to be happening in this case. If you take the APP0 marker lengths at face value, there are 3 APP0 markers. The first has a length that brings you to the second one.

Re: [OpenJDK 2D-Dev] REG : JDK-8160943 : [PIT] new failure of closed/javax/imageio/ReadAllThumbnailsTest.java

2016-07-12 Thread Jim Graham
That doesn't appear to be happening in this case. If you take the APP0 marker lengths at face value, there are 3 APP0 markers. The first has a length that brings you to the second one. The second one has a length that takes you 2 bytes short of the next. The intervening bytes are 00,00 which

  1   2   3   4   5   6   7   8   9   >