<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Alexey,<div class=""><br class=""><div class="">FYI.</div><div class="">We are also trying to merge the latest webrev shared into Open sandbox we have under <a href="https://bugs.openjdk.java.net/browse/JDK-8225160" class="">https://bugs.openjdk.java.net/browse/JDK-8225160</a>.</div><div class="">It is in initial phase of merge, we will be updating the JBS bug with more details as we continue merge process.</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Jay<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 11-Jun-2019, at 2:31 PM, Ajit Ghaisas <<a href="mailto:ajit.ghaisas@oracle.com" class="">ajit.ghaisas@oracle.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Alexey,<div class=""><br class=""></div><div class="">    Thanks for suggesting how to run basic perf test.</div><div class=""><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">    I did run it with and without Metal. The test run with Metal takes ~2X time to run as compared with OpenGL.</div><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">    What is your observation?</div><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""></div><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">    Although, the java side code changes are good, I see an issue with native Metal renderer implementation. </div><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">    For rendering primitives, I see that the metal commands are being encoded for each drawXXX call in MTLRenderer.m</div><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""> </div><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">    Why is MetalContext.createRenderEncoderForDest is being created for each draw call? I think, it is an overhead.</div><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">    Have you considered managing a VertexBuffer and encoding ’N’ set of draw calls in a render pass?</div><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""></div><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Regards,</div><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Ajit</div><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""></div><div class=""><br class=""><blockquote type="cite" class=""><div class="">On 17-May-2019, at 12:20 PM, Jayathirth Rao <<a href="mailto:jayathirth.d.v@oracle.com" class="">jayathirth.d.v@oracle.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=us-ascii" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Alexey,<div class=""><br class=""></div><div class="">Thanks for the clarifications.</div><div class="">Build failures we are getting are mainly because of tighter compiler restrictions, I have attached error log for the same.</div><div class="">Basically we have 2 log errors and one conditional error.</div><div class=""><br class=""></div><div class="">Yes in the latest build there is refactoring of LWComponentPeer.java but I have taken care of it and build error was not because of that.</div><div class=""><br class=""></div><div class="">And thanks for sharing test and Graphics2D supported method details.</div><div class=""><br class=""></div><div class="">Regards,</div><div class="">Jay</div><div class=""></div></div><span id="cid:D6FBC871-B546-4C8F-ABD2-2A095418694F@in.oracle.com" class=""><Build_failure.txt></span><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class=""></div><div class=""><br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On 16-May-2019, at 10:39 PM, Alexey Ushakov <<a href="mailto:alexey.ushakov@jetbrains.com" class="">alexey.ushakov@jetbrains.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Jay,<div class=""><br class=""><blockquote type="cite" class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div class=""><div class=""><blockquote type="cite" class=""><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div class=""><div class="">I can see that now you have added the MTLTexturePool.m file. It only partially solves the build failures.</div><div class="">Jay & myself tried building it separately and we do still see the build failures.</div></div></div></div></blockquote></div></div></div></blockquote><br class=""></div><div class="">It’s strange. There wasn’t any copy/paste errors. The only reason that I can imagine that some chunks of the patch were rejected (as I actually experienced recently because of some refactoring of LWComponentPeer.java happened couple of days ago).</div><div class="">Anyway, I regenerated webrev once more (<a href="http://cr.openjdk.java.net/~avu/JDK-8220154/webrev.01" class="">http://cr.openjdk.java.net/~avu/JDK-8220154/webrev.01</a>) and verified it with the openjdk workspace <a href="http://hg.openjdk.java.net/jdk/client" class="">hg.openjdk.java.net/jdk/client</a> . </div><div class=""><br class=""><div class=""><br class=""></div><div class=""><blockquote type="cite" class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div class="">So with current JB changes what parts of primitive and image drawing are expected to work?</div><div class="">Please provide your inputs.</div></div></blockquote><div class=""><div class="" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;"><div class=""><br class=""></div><div class="">I’ve included junit4 performance test that you can try to see what is currently supported.</div><div class="">Here is some steps to run the test provided with the webrev</div><div class=""><br class=""></div><div class="">#cd openjdk_ws </div><div class="">#mkdir -p test/jdk/jbu/testdata/perf/metal/<br class="">#cp webrev/raw_files/new/test/jdk/jbu/testdata/perf/metal/duke.png test/jdk/jbu/testdata/perf/metal/</div><div class=""><br class=""></div><div class="">#./build/macosx-x86_64-server-release/images/jdk-bundle/jdk-13.jdk/Contents/Home/bin/javac  -cp .:/Users/avu/tools/junit-4.10.jar -d . test/jdk/jbu/perf/metal/MetalPerfTest.java</div><div class=""><br class=""></div><div class="">#./build/macosx-x86_64-server-release/images/jdk-bundle/jdk-13.jdk/Contents/Home/bin/java  -cp .:/Users/avu/tools/junit-4.10.jar -Dtestdata=/Users/avu/ws/openjdk/test/jdk/jbu/testdata -Djb.java2d.metal=true org.junit.runner.JUnitCore  perf.metal.MetalPerfTest</div><div class=""><br class=""></div><div class="">Here is the list of supported methods from Graphics2D: </div><div class="">setColor</div><div class="">fillOval</div><div class="">translate</div><div class="">setTransform</div><div class="">rotate</div><div class="">setPaint(new LinearGradientPaint())</div><div class="">drawImage</div><div class="">fillRect</div><div class="">draw/fill (Shape)</div><div class=""><br class=""></div><div class="">Best Regards,</div><div class="">Alexey </div></div></div></div><div class=""><br class=""><blockquote type="cite" class=""><div class="">On 16 May 2019, at 15:08, Jayathirth Rao <<a href="mailto:jayathirth.d.v@oracle.com" class="">jayathirth.d.v@oracle.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Alexey,<div class=""><br class=""></div><div class="">We are trying to test basic calls of Graphics2D as mentioned in <a href="https://docs.oracle.com/javase/tutorial/2d/TOC.html" class="">https://docs.oracle.com/javase/tutorial/2d/TOC.html</a> </div><div class=""><br class=""></div><div class="">I see that Graphics2D.drawImage() with BufferedImage as input works. Also I tried other operations like fillRect() and fillOval() and they work. I am testing with simple JFrame and adding draw calls inside overriden paint() method of a panel.</div><div class=""><br class=""></div><div class="">So with current JB changes what parts of primitive and image drawing are expected to work?</div><div class="">Please provide your inputs.</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Jay<br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On 16-May-2019, at 12:47 PM, Ajit Ghaisas <<a href="mailto:ajit.ghaisas@oracle.com" class="">ajit.ghaisas@oracle.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Thanks Alexey.<div class=""><br class=""><div class="">I can see that now you have added the MTLTexturePool.m file. It only partially solves the build failures.</div><div class="">Jay & myself tried building it separately and we do still see the build failures.</div><div class=""><br class=""></div><div class="">Some statements need bracketing & some copy-paste errors need correction.</div><div class="">We could fix these errors and have got a build. We will continue our test experiments with it.</div><div class=""><br class=""></div><div class="">Meanwhile, you may want to update the patch to fix the build errors. </div><div class=""><br class=""></div><div class="">Regards,</div><div class="">Ajit<br class=""><div class=""><br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On 08-May-2019, at 8:56 PM, Alexey Ushakov <<a href="mailto:alexey.ushakov@jetbrains.com" class="">alexey.ushakov@jetbrains.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">FYI, I’ve rebased our work on top of the latest state of <a href="http://hg.openjdk.java.net/jdk/jdk" class="">http://hg.openjdk.java.net/jdk/jdk</a> <div class="">(<a href="http://cr.openjdk.java.net/~avu/JDK-8220154/webrev.01" class="">http://cr.openjdk.java.net/~avu/JDK-8220154/webrev.01</a>)</div><div class=""><br class=""></div><div class="">Best Regards,</div><div class="">Alexey<br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On 8 May 2019, at 16:19, Alexey Ushakov <<a href="mailto:Alexey.Ushakov@jetbrains.com" class="">Alexey.Ushakov@jetbrains.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Thanks for catching it, Ajit!<div class=""><br class=""></div><div class="">Looks like it was a problem with webrev script applied to multiple git commits. I’ve updated the webrev.</div><div class="">Also, we didn’t rebase yet on the latest state of <a href="http://hg.openjdk.java.net/jdk/jdk" class="">http://hg.openjdk.java.net/jdk/jdk</a> (this work is in progress).</div><div class="">I’ll let you know when the rebase is ready.</div><div class=""><br class=""></div><div class="">Best Regards,</div><div class="">Alexey<br class=""><div class=""><br class=""><blockquote type="cite" class=""><div class="">On 7 May 2019, at 21:02, Ajit Ghaisas <<a href="mailto:ajit.ghaisas@oracle.com" class="">ajit.ghaisas@oracle.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div dir="auto" style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">Hi Alexey,<div class=""><br class=""></div><div class="">   I tried building this patch with latest <a href="http://hg.openjdk.java.net/jdk/jdk/" class="">http://hg.openjdk.java.net/jdk/jdk/</a></div><div class=""> </div><div class="">   1. Some basic copy paste errors are resulting in build failures</div><div class="">   2. <span style="white-space: pre-wrap;" class="">MTLTexturePool.m file is missing from the patch</span></div><div class=""><br class=""></div><div class="">   Can you please check & update?</div><div class=""><br class=""></div><div class="">Regards,</div><div class="">Ajit</div><div class=""><br class=""><blockquote type="cite" class=""><div class="">On 30-Apr-2019, at 2:52 PM, Alexey Ushakov <<a href="mailto:alexey.ushakov@jetbrains.com" class="">alexey.ushakov@jetbrains.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><meta http-equiv="Content-Type" content="text/html; charset=utf-8" class=""><div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><div class="">Hello,</div><div class=""><br class=""></div><div class="">Here  is an update on our effort to use Metal framework for java2d rendering.</div><div class=""><br class=""></div><div class="">We’ve added image rendering support and some support for LinearGradient. Also, the code has been refactored.</div><div class=""><br class=""></div><div class="">Please have a look:</div><div class=""><br class=""></div><div class=""><a href="http://cr.openjdk.java.net/~avu/JDK-8220154/webrev.01" class="">http://cr.openjdk.java.net/~avu/JDK-8220154/webrev.01</a></div><div class=""><br class=""></div><div class="">Best Regards,</div><div class="">Alexey</div><div class=""><br class=""></div><br class=""><blockquote type="cite" class=""><span style="caret-color: rgb(0, 0, 0);" class="">Hello,</span><br style="caret-color: rgb(0, 0, 0);" class=""><br style="caret-color: rgb(0, 0, 0);" class=""><span style="caret-color: rgb(0, 0, 0);" class="">As far as we know Apple has deprecated OpenGL on MacOS platform (</span><a href="https://developer.apple.com/macos/whats-new/" class="">https://developer.apple.com/macos/whats-new/</a><span style="caret-color: rgb(0, 0, 0);" class="">).</span><br style="caret-color: rgb(0, 0, 0);" class=""><br style="caret-color: rgb(0, 0, 0);" class=""><span style="caret-color: rgb(0, 0, 0);" class="">Unfortunately, this decision greatly affects our products that based on Java Client technologies. So, we (here at JetBrains) decided to start a project to replace OpenGL rendering on MacOS platform with a new one based on Metal. This is a huge task, so we  decided to leverage current rendering architecture that is used in OpenGL rendering pipeline on Mac.  </span><br style="caret-color: rgb(0, 0, 0);" class=""><br style="caret-color: rgb(0, 0, 0);" class=""><span style="caret-color: rgb(0, 0, 0);" class="">That’s why we didn’t use MTKView for representing AWT windows (that probably would be a better approach in the long term). Currently we're using CAMetalLayer within AWTView. We’ve implemented flat color shape/curve rendering so far and there is a lot of work to do. So, we’re looking forward to any collaboration.</span><br style="caret-color: rgb(0, 0, 0);" class=""><br style="caret-color: rgb(0, 0, 0);" class=""><span style="caret-color: rgb(0, 0, 0);" class="">In the mean time I’d like to share our current work to discuss metal pipeline architecture at the early stage of work.</span><br style="caret-color: rgb(0, 0, 0);" class=""><br style="caret-color: rgb(0, 0, 0);" class=""><span style="caret-color: rgb(0, 0, 0);" class="">Here is the webrev with our on going development:</span><br style="caret-color: rgb(0, 0, 0);" class=""><br style="caret-color: rgb(0, 0, 0);" class=""><a href="http://cr.openjdk.java.net/~avu/JDK-8220154/webrev.00" class="">http://cr.openjdk.java.net/~avu/JDK-8220154/webrev.00</a><br style="caret-color: rgb(0, 0, 0);" class=""><br style="caret-color: rgb(0, 0, 0);" class=""><span style="caret-color: rgb(0, 0, 0);" class="">Best Regards,</span><br style="caret-color: rgb(0, 0, 0);" class=""><span style="caret-color: rgb(0, 0, 0);" class="">Alexey</span></blockquote></div></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></div></div></div></div></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></div></div></div></blockquote></div><br class=""></div></div></body></html>