Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/src/java.desktop/share/classes/sun/java2d/loops/DrawPath.java
41159 views
1
/*
2
* Copyright (c) 2005, 2021, 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.loops;
27
28
import java.awt.geom.Path2D;
29
30
import sun.java2d.SunGraphics2D;
31
import sun.java2d.SurfaceData;
32
33
/**
34
* DrawPath
35
* 1. draw single-width line path onto destination surface
36
* 2. must accept output area [x, y, dx, dy]
37
* from within the surface description data for clip rect
38
*/
39
public class DrawPath extends GraphicsPrimitive {
40
41
public static final String methodSignature =
42
"DrawPath(...)".toString();
43
44
public static final int primTypeID = makePrimTypeID();
45
46
public static DrawPath locate(SurfaceType srctype,
47
CompositeType comptype,
48
SurfaceType dsttype)
49
{
50
return (DrawPath)
51
GraphicsPrimitiveMgr.locate(primTypeID,
52
srctype, comptype, dsttype);
53
}
54
55
protected DrawPath(SurfaceType srctype,
56
CompositeType comptype,
57
SurfaceType dsttype)
58
{
59
super(methodSignature, primTypeID,
60
srctype, comptype, dsttype);
61
}
62
63
public DrawPath(long pNativePrim,
64
SurfaceType srctype,
65
CompositeType comptype,
66
SurfaceType dsttype)
67
{
68
super(pNativePrim, methodSignature, primTypeID,
69
srctype, comptype, dsttype);
70
}
71
72
73
/**
74
* All DrawPath implementors must have this invoker method
75
*/
76
public native void DrawPath(SunGraphics2D sg2d, SurfaceData sData,
77
int transX, int transY,
78
Path2D.Float p2df);
79
80
public GraphicsPrimitive traceWrap() {
81
return new TraceDrawPath(this);
82
}
83
84
private static class TraceDrawPath extends DrawPath {
85
DrawPath target;
86
87
public TraceDrawPath(DrawPath target) {
88
super(target.getSourceType(),
89
target.getCompositeType(),
90
target.getDestType());
91
this.target = target;
92
}
93
94
public GraphicsPrimitive traceWrap() {
95
return this;
96
}
97
98
public void DrawPath(SunGraphics2D sg2d, SurfaceData sData,
99
int transX, int transY,
100
Path2D.Float p2df)
101
{
102
tracePrimitive(target);
103
target.DrawPath(sg2d, sData, transX, transY, p2df);
104
}
105
}
106
}
107
108