Hi again, I know this patch is cumbersome to review, however it would be great if somebody could find the time to take a look at it. Its basically only C-Code ported to java anyway ;)
It would be no problem for me to split the independent performance-improvement for storing rectangles into a seperate patch if it would help. Thanks, Clemens 2013/8/24 Clemens Eisserer <[email protected]>: > Hello, > > Please review my fix for: JDK-7179526 : xrender : > closed/sun/java2d/volatileImage/LineClipTest.java failed since jdk8b36 > at http://cr.openjdk.java.net/~ceisserer/7179526/webrev.00/ > > Problem description: Lines weren't rendered in a consistent way when > they were clipped. > The issue originated from clipping being previously separated from > line rasterization. > > Fix description: > 1. After a few failed attempts, I decided to port the native line > rendering algorithms from sun/java2d/loop/DrawLine.c and > sun/java2d/loop/LoopMacros.h to Java. > The original source consisted of quite a number of interdependent > macros, I tried to split the code into smaller methods in XRDrawLine. > > 2. Also included is a small low-risk micro-optimization, by providing > a GrowableRectArray.pushRectValues()-method, replacing the rather > generically implemented MaskTile.addRect() method. This results in a > 10-20% speedup for workloads consisting of many small rectangles, as > this code is very often called. > > 3. Another change is a clean-up/removal of long-time unused member > variables in MaskTileManager.java, from dates where line rendering was > implemented in a different way. > > I could create separate patch-sets for the clean-up and the > micro-optimization, as you prefer. However, I consider both no-risk. > > > Thanks, Clemens > > PS: Performance for line-rendering workloads improved quite a bit: > > Options common across all tests: > graphics.opts.xormode=false > graphics.render.opts.paint=single > graphics.opts.renderhint=Default > graphics.opts.alpharule=SrcOver > graphics.opts.extraalpha=false > graphics.render.opts.alphacolor=false > global.dest=VolatileImg > graphics.render.opts.antialias=false > graphics.opts.clip=false > graphics.render.opts.stroke=width1 > graphics.opts.transform=ident > graphics.opts.anim=2 > > graphics.render.tests.drawLine,graphics.opts.sizes=20: > baseline: 23234.32805 (var=18.95%) (100.0%) > patch: 26042.31972 (var=6.28%) (112.09%) > graphics.render.tests.drawLine,graphics.opts.sizes=250: > baseline: 27573.53165 (var=30.54%) (100.0%) > patch: 30530.53302 (var=7.46%) (110.72%) > graphics.render.tests.drawLineHoriz,graphics.opts.sizes=20: > baseline: 93574.96039 (var=21.09%) (100.0%) > patch: 103011.66924 (var=3.92%) (110.08%) > graphics.render.tests.drawLineHoriz,graphics.opts.sizes=250: > baseline: 1129462.56050 (var=15.02%) (100.0%) > patch: 1291397.82057 (var=1.53%) (114.34%) > graphics.render.tests.drawOval,graphics.opts.sizes=20: > baseline: 20958.84885 (var=18.79%) (100.0%) > patch: 23018.13843 (var=3.44%) (109.83%) > graphics.render.tests.drawOval,graphics.opts.sizes=250: > baseline: 15263.36513 (var=19.22%) (100.0%) > patch: 33692.11899 (var=1.29%) (220.74%) > graphics.render.tests.drawPoly,graphics.opts.sizes=20: > baseline: 33479.49456 (var=18.25%) (100.0%) > patch: 37251.33485 (var=3.36%) (111.27%) > graphics.render.tests.drawPoly,graphics.opts.sizes=250: > baseline: 28618.54379 (var=22.98%) (100.0%) > patch: 42345.48575 (var=4.03%) (147.97%) > graphics.render.tests.shape.drawCubic,graphics.opts.sizes=20: > baseline: 10687.11472 (var=13.72%) (100.0%) > patch: 10538.90697 (var=33.91%) (98.61%) > graphics.render.tests.shape.drawCubic,graphics.opts.sizes=250: > baseline: 8458.942632 (var=18.26%) (100.0%) > patch: 16690.96833 (var=2.67%) (197.32%) > > Summary: > baseline: > Number of tests: 10 > Overall average: 139131.1690314054 > Best spread: 13.72% variance > Worst spread: 30.54% variance > (Basis for results comparison) > > patch: > Number of tests: 10 > Overall average: 161451.9295901127 > Best spread: 1.29% variance > Worst spread: 33.91% variance > Comparison to basis: > Best result: 220.74% of basis > Worst result: 98.61% of basis > Number of wins: 9 > Number of ties: 1 > Number of losses: 0
