author | lbourges |
Mon, 11 Dec 2017 21:14:43 +0100 | |
changeset 48284 | fd7fbc929001 |
parent 47216 | 71c04702a3d5 |
child 49496 | 1ea202af7a97 |
permissions | -rw-r--r-- |
47126 | 1 |
/* |
2 |
* Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved. |
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. Oracle designates this |
|
8 |
* particular file as subject to the "Classpath" exception as provided |
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
|
10 |
* |
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
24 |
*/ |
|
25 |
||
26 |
package sun.java2d.marlin; |
|
27 |
||
28 |
import java.awt.geom.AffineTransform; |
|
29 |
import java.awt.geom.Path2D; |
|
48284
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
30 |
import sun.java2d.marlin.DHelpers.IndexStack; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
31 |
import sun.java2d.marlin.DHelpers.PolyStack; |
47126 | 32 |
|
33 |
final class DTransformingPathConsumer2D { |
|
34 |
||
48284
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
35 |
private final DRendererContext rdrCtx; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
36 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
37 |
// recycled ClosedPathDetector instance from detectClosedPath() |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
38 |
private final ClosedPathDetector cpDetector; |
47126 | 39 |
|
48284
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
40 |
// recycled PathClipFilter instance from pathClipper() |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
41 |
private final PathClipFilter pathClipper; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
42 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
43 |
// recycled DPathConsumer2D instance from wrapPath2D() |
47126 | 44 |
private final Path2DWrapper wp_Path2DWrapper = new Path2DWrapper(); |
45 |
||
46 |
// recycled DPathConsumer2D instances from deltaTransformConsumer() |
|
47 |
private final DeltaScaleFilter dt_DeltaScaleFilter = new DeltaScaleFilter(); |
|
48 |
private final DeltaTransformFilter dt_DeltaTransformFilter = new DeltaTransformFilter(); |
|
49 |
||
48284
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
50 |
// recycled DPathConsumer2D instances from inverseDeltaTransformConsumer() |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
51 |
private final DeltaScaleFilter iv_DeltaScaleFilter = new DeltaScaleFilter(); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
52 |
private final DeltaTransformFilter iv_DeltaTransformFilter = new DeltaTransformFilter(); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
53 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
54 |
// recycled PathTracer instances from tracer...() methods |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
55 |
private final PathTracer tracerInput = new PathTracer("[Input]"); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
56 |
private final PathTracer tracerCPDetector = new PathTracer("ClosedPathDetector"); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
57 |
private final PathTracer tracerFiller = new PathTracer("Filler"); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
58 |
private final PathTracer tracerStroker = new PathTracer("Stroker"); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
59 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
60 |
DTransformingPathConsumer2D(final DRendererContext rdrCtx) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
61 |
// used by RendererContext |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
62 |
this.rdrCtx = rdrCtx; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
63 |
this.cpDetector = new ClosedPathDetector(rdrCtx); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
64 |
this.pathClipper = new PathClipFilter(rdrCtx); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
65 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
66 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
67 |
DPathConsumer2D wrapPath2D(Path2D.Double p2d) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
68 |
return wp_Path2DWrapper.init(p2d); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
69 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
70 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
71 |
DPathConsumer2D traceInput(DPathConsumer2D out) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
72 |
return tracerInput.init(out); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
73 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
74 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
75 |
DPathConsumer2D traceClosedPathDetector(DPathConsumer2D out) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
76 |
return tracerCPDetector.init(out); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
77 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
78 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
79 |
DPathConsumer2D traceFiller(DPathConsumer2D out) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
80 |
return tracerFiller.init(out); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
81 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
82 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
83 |
DPathConsumer2D traceStroker(DPathConsumer2D out) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
84 |
return tracerStroker.init(out); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
85 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
86 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
87 |
DPathConsumer2D detectClosedPath(DPathConsumer2D out) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
88 |
return cpDetector.init(out); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
89 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
90 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
91 |
DPathConsumer2D pathClipper(DPathConsumer2D out) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
92 |
return pathClipper.init(out); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
93 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
94 |
|
47126 | 95 |
DPathConsumer2D deltaTransformConsumer(DPathConsumer2D out, |
96 |
AffineTransform at) |
|
97 |
{ |
|
98 |
if (at == null) { |
|
99 |
return out; |
|
100 |
} |
|
48284
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
101 |
final double mxx = at.getScaleX(); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
102 |
final double mxy = at.getShearX(); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
103 |
final double myx = at.getShearY(); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
104 |
final double myy = at.getScaleY(); |
47126 | 105 |
|
106 |
if (mxy == 0.0d && myx == 0.0d) { |
|
107 |
if (mxx == 1.0d && myy == 1.0d) { |
|
108 |
return out; |
|
109 |
} else { |
|
48284
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
110 |
// Scale only |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
111 |
if (rdrCtx.doClip) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
112 |
// adjust clip rectangle (ymin, ymax, xmin, xmax): |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
113 |
adjustClipScale(rdrCtx.clipRect, mxx, myy); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
114 |
} |
47126 | 115 |
return dt_DeltaScaleFilter.init(out, mxx, myy); |
116 |
} |
|
117 |
} else { |
|
48284
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
118 |
if (rdrCtx.doClip) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
119 |
// adjust clip rectangle (ymin, ymax, xmin, xmax): |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
120 |
adjustClipInverseDelta(rdrCtx.clipRect, mxx, mxy, myx, myy); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
121 |
} |
47126 | 122 |
return dt_DeltaTransformFilter.init(out, mxx, mxy, myx, myy); |
123 |
} |
|
124 |
} |
|
125 |
||
48284
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
126 |
private static void adjustClipOffset(final double[] clipRect) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
127 |
clipRect[0] += Renderer.RDR_OFFSET_Y; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
128 |
clipRect[1] += Renderer.RDR_OFFSET_Y; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
129 |
clipRect[2] += Renderer.RDR_OFFSET_X; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
130 |
clipRect[3] += Renderer.RDR_OFFSET_X; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
131 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
132 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
133 |
private static void adjustClipScale(final double[] clipRect, |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
134 |
final double mxx, final double myy) |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
135 |
{ |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
136 |
adjustClipOffset(clipRect); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
137 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
138 |
// Adjust the clipping rectangle (iv_DeltaScaleFilter): |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
139 |
clipRect[0] /= myy; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
140 |
clipRect[1] /= myy; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
141 |
clipRect[2] /= mxx; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
142 |
clipRect[3] /= mxx; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
143 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
144 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
145 |
private static void adjustClipInverseDelta(final double[] clipRect, |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
146 |
final double mxx, final double mxy, |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
147 |
final double myx, final double myy) |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
148 |
{ |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
149 |
adjustClipOffset(clipRect); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
150 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
151 |
// Adjust the clipping rectangle (iv_DeltaTransformFilter): |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
152 |
final double det = mxx * myy - mxy * myx; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
153 |
final double imxx = myy / det; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
154 |
final double imxy = -mxy / det; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
155 |
final double imyx = -myx / det; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
156 |
final double imyy = mxx / det; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
157 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
158 |
double xmin, xmax, ymin, ymax; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
159 |
double x, y; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
160 |
// xmin, ymin: |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
161 |
x = clipRect[2] * imxx + clipRect[0] * imxy; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
162 |
y = clipRect[2] * imyx + clipRect[0] * imyy; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
163 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
164 |
xmin = xmax = x; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
165 |
ymin = ymax = y; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
166 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
167 |
// xmax, ymin: |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
168 |
x = clipRect[3] * imxx + clipRect[0] * imxy; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
169 |
y = clipRect[3] * imyx + clipRect[0] * imyy; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
170 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
171 |
if (x < xmin) { xmin = x; } else if (x > xmax) { xmax = x; } |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
172 |
if (y < ymin) { ymin = y; } else if (y > ymax) { ymax = y; } |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
173 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
174 |
// xmin, ymax: |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
175 |
x = clipRect[2] * imxx + clipRect[1] * imxy; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
176 |
y = clipRect[2] * imyx + clipRect[1] * imyy; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
177 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
178 |
if (x < xmin) { xmin = x; } else if (x > xmax) { xmax = x; } |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
179 |
if (y < ymin) { ymin = y; } else if (y > ymax) { ymax = y; } |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
180 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
181 |
// xmax, ymax: |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
182 |
x = clipRect[3] * imxx + clipRect[1] * imxy; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
183 |
y = clipRect[3] * imyx + clipRect[1] * imyy; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
184 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
185 |
if (x < xmin) { xmin = x; } else if (x > xmax) { xmax = x; } |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
186 |
if (y < ymin) { ymin = y; } else if (y > ymax) { ymax = y; } |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
187 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
188 |
clipRect[0] = ymin; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
189 |
clipRect[1] = ymax; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
190 |
clipRect[2] = xmin; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
191 |
clipRect[3] = xmax; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
192 |
} |
47126 | 193 |
|
194 |
DPathConsumer2D inverseDeltaTransformConsumer(DPathConsumer2D out, |
|
195 |
AffineTransform at) |
|
196 |
{ |
|
197 |
if (at == null) { |
|
198 |
return out; |
|
199 |
} |
|
200 |
double mxx = at.getScaleX(); |
|
201 |
double mxy = at.getShearX(); |
|
202 |
double myx = at.getShearY(); |
|
203 |
double myy = at.getScaleY(); |
|
204 |
||
205 |
if (mxy == 0.0d && myx == 0.0d) { |
|
206 |
if (mxx == 1.0d && myy == 1.0d) { |
|
207 |
return out; |
|
208 |
} else { |
|
209 |
return iv_DeltaScaleFilter.init(out, 1.0d/mxx, 1.0d/myy); |
|
210 |
} |
|
211 |
} else { |
|
48284
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
212 |
final double det = mxx * myy - mxy * myx; |
47126 | 213 |
return iv_DeltaTransformFilter.init(out, |
214 |
myy / det, |
|
215 |
-mxy / det, |
|
216 |
-myx / det, |
|
217 |
mxx / det); |
|
218 |
} |
|
219 |
} |
|
220 |
||
221 |
static final class DeltaScaleFilter implements DPathConsumer2D { |
|
222 |
private DPathConsumer2D out; |
|
223 |
private double sx, sy; |
|
224 |
||
225 |
DeltaScaleFilter() {} |
|
226 |
||
227 |
DeltaScaleFilter init(DPathConsumer2D out, |
|
228 |
double mxx, double myy) |
|
229 |
{ |
|
230 |
this.out = out; |
|
231 |
sx = mxx; |
|
232 |
sy = myy; |
|
233 |
return this; // fluent API |
|
234 |
} |
|
235 |
||
236 |
@Override |
|
237 |
public void moveTo(double x0, double y0) { |
|
238 |
out.moveTo(x0 * sx, y0 * sy); |
|
239 |
} |
|
240 |
||
241 |
@Override |
|
242 |
public void lineTo(double x1, double y1) { |
|
243 |
out.lineTo(x1 * sx, y1 * sy); |
|
244 |
} |
|
245 |
||
246 |
@Override |
|
247 |
public void quadTo(double x1, double y1, |
|
248 |
double x2, double y2) |
|
249 |
{ |
|
250 |
out.quadTo(x1 * sx, y1 * sy, |
|
251 |
x2 * sx, y2 * sy); |
|
252 |
} |
|
253 |
||
254 |
@Override |
|
255 |
public void curveTo(double x1, double y1, |
|
256 |
double x2, double y2, |
|
257 |
double x3, double y3) |
|
258 |
{ |
|
259 |
out.curveTo(x1 * sx, y1 * sy, |
|
260 |
x2 * sx, y2 * sy, |
|
261 |
x3 * sx, y3 * sy); |
|
262 |
} |
|
263 |
||
264 |
@Override |
|
265 |
public void closePath() { |
|
266 |
out.closePath(); |
|
267 |
} |
|
268 |
||
269 |
@Override |
|
270 |
public void pathDone() { |
|
271 |
out.pathDone(); |
|
272 |
} |
|
273 |
||
274 |
@Override |
|
275 |
public long getNativeConsumer() { |
|
276 |
return 0; |
|
277 |
} |
|
278 |
} |
|
279 |
||
280 |
static final class DeltaTransformFilter implements DPathConsumer2D { |
|
281 |
private DPathConsumer2D out; |
|
282 |
private double mxx, mxy, myx, myy; |
|
283 |
||
284 |
DeltaTransformFilter() {} |
|
285 |
||
286 |
DeltaTransformFilter init(DPathConsumer2D out, |
|
287 |
double mxx, double mxy, |
|
288 |
double myx, double myy) |
|
289 |
{ |
|
290 |
this.out = out; |
|
291 |
this.mxx = mxx; |
|
292 |
this.mxy = mxy; |
|
293 |
this.myx = myx; |
|
294 |
this.myy = myy; |
|
295 |
return this; // fluent API |
|
296 |
} |
|
297 |
||
298 |
@Override |
|
299 |
public void moveTo(double x0, double y0) { |
|
300 |
out.moveTo(x0 * mxx + y0 * mxy, |
|
301 |
x0 * myx + y0 * myy); |
|
302 |
} |
|
303 |
||
304 |
@Override |
|
305 |
public void lineTo(double x1, double y1) { |
|
306 |
out.lineTo(x1 * mxx + y1 * mxy, |
|
307 |
x1 * myx + y1 * myy); |
|
308 |
} |
|
309 |
||
310 |
@Override |
|
311 |
public void quadTo(double x1, double y1, |
|
312 |
double x2, double y2) |
|
313 |
{ |
|
314 |
out.quadTo(x1 * mxx + y1 * mxy, |
|
315 |
x1 * myx + y1 * myy, |
|
316 |
x2 * mxx + y2 * mxy, |
|
317 |
x2 * myx + y2 * myy); |
|
318 |
} |
|
319 |
||
320 |
@Override |
|
321 |
public void curveTo(double x1, double y1, |
|
322 |
double x2, double y2, |
|
323 |
double x3, double y3) |
|
324 |
{ |
|
325 |
out.curveTo(x1 * mxx + y1 * mxy, |
|
326 |
x1 * myx + y1 * myy, |
|
327 |
x2 * mxx + y2 * mxy, |
|
328 |
x2 * myx + y2 * myy, |
|
329 |
x3 * mxx + y3 * mxy, |
|
330 |
x3 * myx + y3 * myy); |
|
331 |
} |
|
332 |
||
333 |
@Override |
|
334 |
public void closePath() { |
|
335 |
out.closePath(); |
|
336 |
} |
|
337 |
||
338 |
@Override |
|
339 |
public void pathDone() { |
|
340 |
out.pathDone(); |
|
341 |
} |
|
342 |
||
343 |
@Override |
|
344 |
public long getNativeConsumer() { |
|
345 |
return 0; |
|
346 |
} |
|
347 |
} |
|
348 |
||
349 |
static final class Path2DWrapper implements DPathConsumer2D { |
|
350 |
private Path2D.Double p2d; |
|
351 |
||
352 |
Path2DWrapper() {} |
|
353 |
||
354 |
Path2DWrapper init(Path2D.Double p2d) { |
|
355 |
this.p2d = p2d; |
|
356 |
return this; |
|
357 |
} |
|
358 |
||
359 |
@Override |
|
360 |
public void moveTo(double x0, double y0) { |
|
361 |
p2d.moveTo(x0, y0); |
|
362 |
} |
|
363 |
||
364 |
@Override |
|
365 |
public void lineTo(double x1, double y1) { |
|
366 |
p2d.lineTo(x1, y1); |
|
367 |
} |
|
368 |
||
369 |
@Override |
|
370 |
public void closePath() { |
|
371 |
p2d.closePath(); |
|
372 |
} |
|
373 |
||
374 |
@Override |
|
375 |
public void pathDone() {} |
|
376 |
||
377 |
@Override |
|
378 |
public void curveTo(double x1, double y1, |
|
379 |
double x2, double y2, |
|
380 |
double x3, double y3) |
|
381 |
{ |
|
382 |
p2d.curveTo(x1, y1, x2, y2, x3, y3); |
|
383 |
} |
|
384 |
||
385 |
@Override |
|
386 |
public void quadTo(double x1, double y1, double x2, double y2) { |
|
387 |
p2d.quadTo(x1, y1, x2, y2); |
|
388 |
} |
|
389 |
||
390 |
@Override |
|
391 |
public long getNativeConsumer() { |
|
392 |
throw new InternalError("Not using a native peer"); |
|
393 |
} |
|
394 |
} |
|
48284
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
395 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
396 |
static final class ClosedPathDetector implements DPathConsumer2D { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
397 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
398 |
private final DRendererContext rdrCtx; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
399 |
private final PolyStack stack; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
400 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
401 |
private DPathConsumer2D out; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
402 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
403 |
ClosedPathDetector(final DRendererContext rdrCtx) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
404 |
this.rdrCtx = rdrCtx; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
405 |
this.stack = (rdrCtx.stats != null) ? |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
406 |
new PolyStack(rdrCtx, |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
407 |
rdrCtx.stats.stat_cpd_polystack_types, |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
408 |
rdrCtx.stats.stat_cpd_polystack_curves, |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
409 |
rdrCtx.stats.hist_cpd_polystack_curves, |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
410 |
rdrCtx.stats.stat_array_cpd_polystack_curves, |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
411 |
rdrCtx.stats.stat_array_cpd_polystack_types) |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
412 |
: new PolyStack(rdrCtx); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
413 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
414 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
415 |
ClosedPathDetector init(DPathConsumer2D out) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
416 |
this.out = out; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
417 |
return this; // fluent API |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
418 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
419 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
420 |
/** |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
421 |
* Disposes this instance: |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
422 |
* clean up before reusing this instance |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
423 |
*/ |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
424 |
void dispose() { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
425 |
stack.dispose(); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
426 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
427 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
428 |
@Override |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
429 |
public void pathDone() { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
430 |
// previous path is not closed: |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
431 |
finish(false); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
432 |
out.pathDone(); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
433 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
434 |
// TODO: fix possible leak if exception happened |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
435 |
// Dispose this instance: |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
436 |
dispose(); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
437 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
438 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
439 |
@Override |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
440 |
public void closePath() { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
441 |
// path is closed |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
442 |
finish(true); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
443 |
out.closePath(); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
444 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
445 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
446 |
@Override |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
447 |
public void moveTo(double x0, double y0) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
448 |
// previous path is not closed: |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
449 |
finish(false); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
450 |
out.moveTo(x0, y0); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
451 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
452 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
453 |
private void finish(final boolean closed) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
454 |
rdrCtx.closedPath = closed; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
455 |
stack.pullAll(out); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
456 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
457 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
458 |
@Override |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
459 |
public void lineTo(double x1, double y1) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
460 |
stack.pushLine(x1, y1); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
461 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
462 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
463 |
@Override |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
464 |
public void curveTo(double x3, double y3, |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
465 |
double x2, double y2, |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
466 |
double x1, double y1) |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
467 |
{ |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
468 |
stack.pushCubic(x1, y1, x2, y2, x3, y3); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
469 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
470 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
471 |
@Override |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
472 |
public void quadTo(double x2, double y2, double x1, double y1) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
473 |
stack.pushQuad(x1, y1, x2, y2); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
474 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
475 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
476 |
@Override |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
477 |
public long getNativeConsumer() { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
478 |
throw new InternalError("Not using a native peer"); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
479 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
480 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
481 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
482 |
static final class PathClipFilter implements DPathConsumer2D { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
483 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
484 |
private DPathConsumer2D out; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
485 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
486 |
// Bounds of the drawing region, at pixel precision. |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
487 |
private final double[] clipRect; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
488 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
489 |
private final double[] corners = new double[8]; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
490 |
private boolean init_corners = false; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
491 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
492 |
private final IndexStack stack; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
493 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
494 |
// the current outcode of the current sub path |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
495 |
private int cOutCode = 0; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
496 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
497 |
// the cumulated (and) outcode of the complete path |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
498 |
private int gOutCode = MarlinConst.OUTCODE_MASK_T_B_L_R; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
499 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
500 |
private boolean outside = false; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
501 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
502 |
// The current point OUTSIDE |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
503 |
private double cx0, cy0; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
504 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
505 |
PathClipFilter(final DRendererContext rdrCtx) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
506 |
this.clipRect = rdrCtx.clipRect; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
507 |
this.stack = (rdrCtx.stats != null) ? |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
508 |
new IndexStack(rdrCtx, |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
509 |
rdrCtx.stats.stat_pcf_idxstack_indices, |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
510 |
rdrCtx.stats.hist_pcf_idxstack_indices, |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
511 |
rdrCtx.stats.stat_array_pcf_idxstack_indices) |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
512 |
: new IndexStack(rdrCtx); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
513 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
514 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
515 |
PathClipFilter init(final DPathConsumer2D out) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
516 |
this.out = out; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
517 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
518 |
// Adjust the clipping rectangle with the renderer offsets |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
519 |
final double rdrOffX = DRenderer.RDR_OFFSET_X; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
520 |
final double rdrOffY = DRenderer.RDR_OFFSET_Y; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
521 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
522 |
// add a small rounding error: |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
523 |
final double margin = 1e-3d; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
524 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
525 |
final double[] _clipRect = this.clipRect; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
526 |
_clipRect[0] -= margin - rdrOffY; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
527 |
_clipRect[1] += margin + rdrOffY; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
528 |
_clipRect[2] -= margin - rdrOffX; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
529 |
_clipRect[3] += margin + rdrOffX; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
530 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
531 |
this.init_corners = true; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
532 |
this.gOutCode = MarlinConst.OUTCODE_MASK_T_B_L_R; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
533 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
534 |
return this; // fluent API |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
535 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
536 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
537 |
/** |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
538 |
* Disposes this instance: |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
539 |
* clean up before reusing this instance |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
540 |
*/ |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
541 |
void dispose() { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
542 |
stack.dispose(); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
543 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
544 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
545 |
private void finishPath() { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
546 |
if (outside) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
547 |
// criteria: inside or totally outside ? |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
548 |
if (gOutCode == 0) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
549 |
finish(); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
550 |
} else { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
551 |
this.outside = false; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
552 |
stack.reset(); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
553 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
554 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
555 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
556 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
557 |
private void finish() { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
558 |
this.outside = false; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
559 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
560 |
if (!stack.isEmpty()) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
561 |
if (init_corners) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
562 |
init_corners = false; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
563 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
564 |
final double[] _corners = corners; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
565 |
final double[] _clipRect = clipRect; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
566 |
// Top Left (0): |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
567 |
_corners[0] = _clipRect[2]; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
568 |
_corners[1] = _clipRect[0]; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
569 |
// Bottom Left (1): |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
570 |
_corners[2] = _clipRect[2]; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
571 |
_corners[3] = _clipRect[1]; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
572 |
// Top right (2): |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
573 |
_corners[4] = _clipRect[3]; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
574 |
_corners[5] = _clipRect[0]; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
575 |
// Bottom Right (3): |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
576 |
_corners[6] = _clipRect[3]; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
577 |
_corners[7] = _clipRect[1]; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
578 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
579 |
stack.pullAll(corners, out); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
580 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
581 |
out.lineTo(cx0, cy0); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
582 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
583 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
584 |
@Override |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
585 |
public void pathDone() { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
586 |
finishPath(); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
587 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
588 |
out.pathDone(); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
589 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
590 |
// TODO: fix possible leak if exception happened |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
591 |
// Dispose this instance: |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
592 |
dispose(); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
593 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
594 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
595 |
@Override |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
596 |
public void closePath() { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
597 |
finishPath(); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
598 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
599 |
out.closePath(); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
600 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
601 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
602 |
@Override |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
603 |
public void moveTo(final double x0, final double y0) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
604 |
finishPath(); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
605 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
606 |
final int outcode = DHelpers.outcode(x0, y0, clipRect); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
607 |
this.cOutCode = outcode; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
608 |
this.outside = false; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
609 |
out.moveTo(x0, y0); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
610 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
611 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
612 |
@Override |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
613 |
public void lineTo(final double xe, final double ye) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
614 |
final int outcode0 = this.cOutCode; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
615 |
final int outcode1 = DHelpers.outcode(xe, ye, clipRect); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
616 |
this.cOutCode = outcode1; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
617 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
618 |
final int sideCode = (outcode0 & outcode1); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
619 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
620 |
// basic rejection criteria: |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
621 |
if (sideCode == 0) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
622 |
this.gOutCode = 0; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
623 |
} else { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
624 |
this.gOutCode &= sideCode; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
625 |
// keep last point coordinate before entering the clip again: |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
626 |
this.outside = true; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
627 |
this.cx0 = xe; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
628 |
this.cy0 = ye; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
629 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
630 |
clip(sideCode, outcode0, outcode1); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
631 |
return; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
632 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
633 |
if (outside) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
634 |
finish(); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
635 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
636 |
// clipping disabled: |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
637 |
out.lineTo(xe, ye); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
638 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
639 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
640 |
private void clip(final int sideCode, |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
641 |
final int outcode0, |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
642 |
final int outcode1) |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
643 |
{ |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
644 |
// corner or cross-boundary on left or right side: |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
645 |
if ((outcode0 != outcode1) |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
646 |
&& ((sideCode & MarlinConst.OUTCODE_MASK_L_R) != 0)) |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
647 |
{ |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
648 |
// combine outcodes: |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
649 |
final int mergeCode = (outcode0 | outcode1); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
650 |
final int tbCode = mergeCode & MarlinConst.OUTCODE_MASK_T_B; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
651 |
final int lrCode = mergeCode & MarlinConst.OUTCODE_MASK_L_R; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
652 |
final int off = (lrCode == MarlinConst.OUTCODE_LEFT) ? 0 : 2; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
653 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
654 |
// add corners to outside stack: |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
655 |
switch (tbCode) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
656 |
case MarlinConst.OUTCODE_TOP: |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
657 |
// System.out.println("TOP "+ ((off == 0) ? "LEFT" : "RIGHT")); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
658 |
stack.push(off); // top |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
659 |
return; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
660 |
case MarlinConst.OUTCODE_BOTTOM: |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
661 |
// System.out.println("BOTTOM "+ ((off == 0) ? "LEFT" : "RIGHT")); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
662 |
stack.push(off + 1); // bottom |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
663 |
return; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
664 |
default: |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
665 |
// both TOP / BOTTOM: |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
666 |
if ((outcode0 & MarlinConst.OUTCODE_TOP) != 0) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
667 |
// System.out.println("TOP + BOTTOM "+ ((off == 0) ? "LEFT" : "RIGHT")); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
668 |
// top to bottom |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
669 |
stack.push(off); // top |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
670 |
stack.push(off + 1); // bottom |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
671 |
} else { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
672 |
// System.out.println("BOTTOM + TOP "+ ((off == 0) ? "LEFT" : "RIGHT")); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
673 |
// bottom to top |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
674 |
stack.push(off + 1); // bottom |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
675 |
stack.push(off); // top |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
676 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
677 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
678 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
679 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
680 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
681 |
@Override |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
682 |
public void curveTo(final double x1, final double y1, |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
683 |
final double x2, final double y2, |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
684 |
final double xe, final double ye) |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
685 |
{ |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
686 |
final int outcode0 = this.cOutCode; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
687 |
final int outcode3 = DHelpers.outcode(xe, ye, clipRect); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
688 |
this.cOutCode = outcode3; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
689 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
690 |
int sideCode = outcode0 & outcode3; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
691 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
692 |
if (sideCode == 0) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
693 |
this.gOutCode = 0; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
694 |
} else { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
695 |
sideCode &= DHelpers.outcode(x1, y1, clipRect); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
696 |
sideCode &= DHelpers.outcode(x2, y2, clipRect); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
697 |
this.gOutCode &= sideCode; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
698 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
699 |
// basic rejection criteria: |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
700 |
if (sideCode != 0) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
701 |
// keep last point coordinate before entering the clip again: |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
702 |
this.outside = true; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
703 |
this.cx0 = xe; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
704 |
this.cy0 = ye; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
705 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
706 |
clip(sideCode, outcode0, outcode3); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
707 |
return; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
708 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
709 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
710 |
if (outside) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
711 |
finish(); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
712 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
713 |
// clipping disabled: |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
714 |
out.curveTo(x1, y1, x2, y2, xe, ye); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
715 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
716 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
717 |
@Override |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
718 |
public void quadTo(final double x1, final double y1, |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
719 |
final double xe, final double ye) |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
720 |
{ |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
721 |
final int outcode0 = this.cOutCode; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
722 |
final int outcode2 = DHelpers.outcode(xe, ye, clipRect); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
723 |
this.cOutCode = outcode2; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
724 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
725 |
int sideCode = outcode0 & outcode2; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
726 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
727 |
if (sideCode == 0) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
728 |
this.gOutCode = 0; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
729 |
} else { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
730 |
sideCode &= DHelpers.outcode(x1, y1, clipRect); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
731 |
this.gOutCode &= sideCode; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
732 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
733 |
// basic rejection criteria: |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
734 |
if (sideCode != 0) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
735 |
// keep last point coordinate before entering the clip again: |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
736 |
this.outside = true; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
737 |
this.cx0 = xe; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
738 |
this.cy0 = ye; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
739 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
740 |
clip(sideCode, outcode0, outcode2); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
741 |
return; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
742 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
743 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
744 |
if (outside) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
745 |
finish(); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
746 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
747 |
// clipping disabled: |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
748 |
out.quadTo(x1, y1, xe, ye); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
749 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
750 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
751 |
@Override |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
752 |
public long getNativeConsumer() { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
753 |
throw new InternalError("Not using a native peer"); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
754 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
755 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
756 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
757 |
static final class PathTracer implements DPathConsumer2D { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
758 |
private final String prefix; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
759 |
private DPathConsumer2D out; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
760 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
761 |
PathTracer(String name) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
762 |
this.prefix = name + ": "; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
763 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
764 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
765 |
PathTracer init(DPathConsumer2D out) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
766 |
this.out = out; |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
767 |
return this; // fluent API |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
768 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
769 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
770 |
@Override |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
771 |
public void moveTo(double x0, double y0) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
772 |
log("moveTo (" + x0 + ", " + y0 + ')'); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
773 |
out.moveTo(x0, y0); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
774 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
775 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
776 |
@Override |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
777 |
public void lineTo(double x1, double y1) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
778 |
log("lineTo (" + x1 + ", " + y1 + ')'); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
779 |
out.lineTo(x1, y1); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
780 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
781 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
782 |
@Override |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
783 |
public void curveTo(double x1, double y1, |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
784 |
double x2, double y2, |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
785 |
double x3, double y3) |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
786 |
{ |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
787 |
log("curveTo P1(" + x1 + ", " + y1 + ") P2(" + x2 + ", " + y2 + ") P3(" + x3 + ", " + y3 + ')'); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
788 |
out.curveTo(x1, y1, x2, y2, x3, y3); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
789 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
790 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
791 |
@Override |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
792 |
public void quadTo(double x1, double y1, double x2, double y2) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
793 |
log("quadTo P1(" + x1 + ", " + y1 + ") P2(" + x2 + ", " + y2 + ')'); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
794 |
out.quadTo(x1, y1, x2, y2); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
795 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
796 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
797 |
@Override |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
798 |
public void closePath() { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
799 |
log("closePath"); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
800 |
out.closePath(); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
801 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
802 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
803 |
@Override |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
804 |
public void pathDone() { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
805 |
log("pathDone"); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
806 |
out.pathDone(); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
807 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
808 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
809 |
private void log(final String message) { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
810 |
System.out.println(prefix + message); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
811 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
812 |
|
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
813 |
@Override |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
814 |
public long getNativeConsumer() { |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
815 |
throw new InternalError("Not using a native peer"); |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
816 |
} |
fd7fbc929001
8191814: Marlin rasterizer spends time computing geometry for stroked segments that do not intersect the clip
lbourges
parents:
47216
diff
changeset
|
817 |
} |
47126 | 818 |
} |