< prev index next >

modules/javafx.graphics/src/main/java/com/sun/marlin/DRendererContext.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 DRendererContext 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.DTransformingPathConsumer2D.CurveBasicMonotonizer; ! import com.sun.marlin.DTransformingPathConsumer2D.CurveClipSplitter; ! import com.sun.util.reentrant.ReentrantContext; /** * This class is a renderer context dedicated to a single thread */ public final class DRendererContext extends ReentrantContext implements MarlinConst {
*** 60,87 **** final DCurve curve = new DCurve(); // MarlinRenderingEngine.TransformingPathConsumer2D public final DTransformingPathConsumer2D transformerPC2D; // recycled Path2D instance (weak) private WeakReference<Path2D> refPath2D = null; - // shared memory between renderer instances: - final DRendererSharedMemory rdrMem; public final DRenderer renderer; - private DRendererNoAA rendererNoAA = null; public final DStroker stroker; // Simplifies out collinear lines public final DCollinearSimplifier simplifier = new DCollinearSimplifier(); public final DDasher 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 double[] clipRect = new double[4]; // MarlinFX specific: // dirty bbox rectangle public final Rectangle clip = new Rectangle(); // dirty MaskMarlinAlphaConsumer public MaskMarlinAlphaConsumer consumer = null; --- 62,95 ---- final DCurve curve = new DCurve(); // MarlinRenderingEngine.TransformingPathConsumer2D public final DTransformingPathConsumer2D transformerPC2D; // recycled Path2D instance (weak) private WeakReference<Path2D> refPath2D = null; public final DRenderer renderer; public final DStroker stroker; // Simplifies out collinear lines public final DCollinearSimplifier simplifier = new DCollinearSimplifier(); + // Simplifies path + public final DPathSimplifier pathSimplifier = new DPathSimplifier(); public final DDasher 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 double[] clipRect = new double[4]; + // CurveBasicMonotonizer instance + public final CurveBasicMonotonizer monotonizer; + // CurveClipSplitter instance + final CurveClipSplitter curveClipSplitter; // MarlinFX specific: + // shared memory between renderer instances: + final DRendererSharedMemory rdrMem; + private DRendererNoAA 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 DTransformingPathConsumer2D(this); // Renderer shared memory: rdrMem = new DRendererSharedMemory(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 >