< prev index next >
src/java.desktop/share/classes/sun/java2d/marlin/RendererContext.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -29,10 +29,12 @@
import java.lang.ref.WeakReference;
import java.util.concurrent.atomic.AtomicInteger;
import sun.java2d.ReentrantContext;
import sun.java2d.marlin.ArrayCacheConst.CacheStats;
import sun.java2d.marlin.MarlinRenderingEngine.NormalizingPathIterator;
+import sun.java2d.marlin.TransformingPathConsumer2D.CurveBasicMonotonizer;
+import sun.java2d.marlin.TransformingPathConsumer2D.CurveClipSplitter;
/**
* This class is a renderer context dedicated to a single thread
*/
final class RendererContext extends ReentrantContext implements IRendererContext {
@@ -68,10 +70,12 @@
private WeakReference<Path2D.Float> refPath2D = null;
final Renderer renderer;
final Stroker stroker;
// Simplifies out collinear lines
final CollinearSimplifier simplifier = new CollinearSimplifier();
+ // Simplifies path
+ final PathSimplifier pathSimplifier = new PathSimplifier();
final Dasher dasher;
final MarlinTileGenerator ptg;
final MarlinCache cache;
// flag indicating the shape is stroked (1) or filled (0)
int stroking = 0;
@@ -79,10 +83,14 @@
boolean doClip = false;
// flag indicating if the path is closed or not (in advance) to handle properly caps
boolean closedPath = false;
// clip rectangle (ymin, ymax, xmin, xmax):
final float[] clipRect = new float[4];
+ // CurveBasicMonotonizer instance
+ final CurveBasicMonotonizer monotonizer;
+ // CurveClipSplitter instance
+ final CurveClipSplitter curveClipSplitter;
// Array caches:
/* clean int[] cache (zero-filled) = 5 refs */
private final IntArrayCache cleanIntCache = new IntArrayCache(true, 5);
/* dirty int[] cache = 5 refs */
@@ -119,10 +127,14 @@
// NormalizingPathIterator instances:
nPCPathIterator = new NormalizingPathIterator.NearestPixelCenter(float6);
nPQPathIterator = new NormalizingPathIterator.NearestPixelQuarter(float6);
+ // curve monotonizer & clip subdivider (before transformerPC2D init)
+ monotonizer = new CurveBasicMonotonizer(this);
+ curveClipSplitter = new CurveClipSplitter(this);
+
// MarlinRenderingEngine.TransformingPathConsumer2D
transformerPC2D = new TransformingPathConsumer2D(this);
// Renderer:
cache = new MarlinCache(this);
< prev index next >