[OpenJDK Rasterizer] Marlin renderer contribution for review

Jim Graham james.graham at oracle.com
Wed Mar 18 21:24:39 UTC 2015


Hi Laurent,

On 3/18/15 9:17 AM, Laurent Bourgès wrote:
> I advocate I used the "fluent"-like approach to modify less lines and
> avoid too much changes.
> In Pisces, several instances were created like "r = new
> Renderer(params)" then I replaced by "r = rdrCtx.renderer.init(params)":
>
> -            r = new Renderer(3, 3,
> -                             clip.getLoX(), clip.getLoY(),
>
> +            r = rdrCtx.renderer.init(clip.getLoX(), clip.getLoY(),
>                                clip.getWidth(), clip.getHeight(),
>                                pi.getWindingRule());
>
> I could rewrite it like:
> "r = rdrCtx.renderer;
> r.init(params)"

I would have solved this by having a RenderContext.getRenderer(clip, 
rule) method in which case you would write:

r = rdrCtx.getRenderer(clip.getLoX(), ..., pi.getWindingRule());

RenderContext.getRenderer() would initialize the renderer and return it. 
  In the general case, that leaves the RenderContext object open to new 
ways to manage cached instances in the future should our needs change 
since the cache management logic is internal to the object...

			...jim


More information about the graphics-rasterizer-dev mailing list