< prev index next >
modules/javafx.graphics/src/main/java/com/sun/marlin/RendererContext.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2015, 2017, 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
--- 1,7 ----
/*
! * 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
*** 23,38 ****
* questions.
*/
package com.sun.marlin;
! import com.sun.javafx.geom.Path2D;
import java.util.concurrent.atomic.AtomicInteger;
! import com.sun.util.reentrant.ReentrantContext;
import com.sun.javafx.geom.Rectangle;
import com.sun.marlin.ArrayCacheConst.CacheStats;
! import java.lang.ref.WeakReference;
/**
* This class is a renderer context dedicated to a single thread
*/
public final class RendererContext extends ReentrantContext implements MarlinConst {
--- 23,40 ----
* questions.
*/
package com.sun.marlin;
! import java.lang.ref.WeakReference;
import java.util.concurrent.atomic.AtomicInteger;
! import com.sun.javafx.geom.Path2D;
import com.sun.javafx.geom.Rectangle;
import com.sun.marlin.ArrayCacheConst.CacheStats;
! import com.sun.marlin.TransformingPathConsumer2D.CurveBasicMonotonizer;
! import com.sun.marlin.TransformingPathConsumer2D.CurveClipSplitter;
! import com.sun.util.reentrant.ReentrantContext;
/**
* This class is a renderer context dedicated to a single thread
*/
public final class RendererContext extends ReentrantContext implements MarlinConst {
*** 60,87 ****
final Curve curve = new Curve();
// MarlinRenderingEngine.TransformingPathConsumer2D
public final TransformingPathConsumer2D transformerPC2D;
// recycled Path2D instance (weak)
private WeakReference<Path2D> refPath2D = null;
- // shared memory between renderer instances:
- final RendererSharedMemory rdrMem;
public final Renderer renderer;
- private RendererNoAA rendererNoAA = null;
public final Stroker stroker;
// Simplifies out collinear lines
public final CollinearSimplifier simplifier = new CollinearSimplifier();
public final Dasher dasher;
// flag indicating the shape is stroked (1) or filled (0)
int stroking = 0;
// flag indicating to clip the shape
public 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):
public final float[] clipRect = new float[4];
// MarlinFX specific:
// dirty bbox rectangle
public final Rectangle clip = new Rectangle();
// dirty MaskMarlinAlphaConsumer
public MaskMarlinAlphaConsumer consumer = null;
--- 62,95 ----
final Curve curve = new Curve();
// MarlinRenderingEngine.TransformingPathConsumer2D
public final TransformingPathConsumer2D transformerPC2D;
// recycled Path2D instance (weak)
private WeakReference<Path2D> refPath2D = null;
public final Renderer renderer;
public final Stroker stroker;
// Simplifies out collinear lines
public final CollinearSimplifier simplifier = new CollinearSimplifier();
+ // Simplifies path
+ public final PathSimplifier pathSimplifier = new PathSimplifier();
public final Dasher dasher;
// flag indicating the shape is stroked (1) or filled (0)
int stroking = 0;
// flag indicating to clip the shape
public 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):
public final float[] clipRect = new float[4];
+ // CurveBasicMonotonizer instance
+ public final CurveBasicMonotonizer monotonizer;
+ // CurveClipSplitter instance
+ final CurveClipSplitter curveClipSplitter;
// MarlinFX specific:
+ // shared memory between renderer instances:
+ final RendererSharedMemory rdrMem;
+ private RendererNoAA rendererNoAA = null;
// dirty bbox rectangle
public final Rectangle clip = new Rectangle();
// dirty MaskMarlinAlphaConsumer
public MaskMarlinAlphaConsumer consumer = null;
*** 118,127 ****
--- 126,139 ----
};
} else {
stats = null;
}
+ // curve monotonizer & clip subdivider (before transformerPC2D init)
+ monotonizer = new CurveBasicMonotonizer(this);
+ curveClipSplitter = new CurveClipSplitter(this);
+
// MarlinRenderingEngine.TransformingPathConsumer2D
transformerPC2D = new TransformingPathConsumer2D(this);
// Renderer shared memory:
rdrMem = new RendererSharedMemory(this);
*** 239,250 ****
edges = rdrCtx.newOffHeapArray(INITIAL_EDGES_CAPACITY); // 96K
edgeBuckets_ref = rdrCtx.newCleanIntArrayRef(INITIAL_BUCKET_ARRAY); // 64K
edgeBucketCounts_ref = rdrCtx.newCleanIntArrayRef(INITIAL_BUCKET_ARRAY); // 64K
! // 2048 (pixelsize) pixel large
! alphaLine_ref = rdrCtx.newCleanIntArrayRef(INITIAL_AA_ARRAY); // 8K
crossings_ref = rdrCtx.newDirtyIntArrayRef(INITIAL_CROSSING_COUNT); // 2K
aux_crossings_ref = rdrCtx.newDirtyIntArrayRef(INITIAL_CROSSING_COUNT); // 2K
edgePtrs_ref = rdrCtx.newDirtyIntArrayRef(INITIAL_CROSSING_COUNT); // 2K
aux_edgePtrs_ref = rdrCtx.newDirtyIntArrayRef(INITIAL_CROSSING_COUNT); // 2K
--- 251,262 ----
edges = rdrCtx.newOffHeapArray(INITIAL_EDGES_CAPACITY); // 96K
edgeBuckets_ref = rdrCtx.newCleanIntArrayRef(INITIAL_BUCKET_ARRAY); // 64K
edgeBucketCounts_ref = rdrCtx.newCleanIntArrayRef(INITIAL_BUCKET_ARRAY); // 64K
! // 4096 pixels large
! alphaLine_ref = rdrCtx.newCleanIntArrayRef(INITIAL_AA_ARRAY); // 16K
crossings_ref = rdrCtx.newDirtyIntArrayRef(INITIAL_CROSSING_COUNT); // 2K
aux_crossings_ref = rdrCtx.newDirtyIntArrayRef(INITIAL_CROSSING_COUNT); // 2K
edgePtrs_ref = rdrCtx.newDirtyIntArrayRef(INITIAL_CROSSING_COUNT); // 2K
aux_edgePtrs_ref = rdrCtx.newDirtyIntArrayRef(INITIAL_CROSSING_COUNT); // 2K
< prev index next >