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/DrawPolygons.java
41159 views
1
/*
2
* Copyright (c) 1997, 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
/*
27
* @author Charlton Innovations, Inc.
28
*/
29
30
package sun.java2d.loops;
31
32
import sun.java2d.SunGraphics2D;
33
import sun.java2d.SurfaceData;
34
35
/**
36
* DrawPolygons
37
* 1) draw single-width line polygons onto destination surface
38
* 2) must accept output area [x, y, dx, dy]
39
* from within the surface description data for clip rect
40
*/
41
public class DrawPolygons extends GraphicsPrimitive
42
{
43
public static final String methodSignature = "DrawPolygons(...)".toString();
44
45
public static final int primTypeID = makePrimTypeID();
46
47
public static DrawPolygons locate(SurfaceType srctype,
48
CompositeType comptype,
49
SurfaceType dsttype)
50
{
51
return (DrawPolygons)
52
GraphicsPrimitiveMgr.locate(primTypeID,
53
srctype, comptype, dsttype);
54
}
55
56
protected DrawPolygons(SurfaceType srctype,
57
CompositeType comptype,
58
SurfaceType dsttype)
59
{
60
super(methodSignature, primTypeID, srctype, comptype, dsttype);
61
}
62
63
public DrawPolygons(long pNativePrim,
64
SurfaceType srctype,
65
CompositeType comptype,
66
SurfaceType dsttype)
67
{
68
super(pNativePrim, methodSignature, primTypeID, srctype, comptype, dsttype);
69
}
70
71
/**
72
* All DrawPolygon implementors must have this invoker method
73
*/
74
public native void DrawPolygons(SunGraphics2D sg2d, SurfaceData sData,
75
int[] xPoints, int[] yPoints,
76
int[] nPoints, int numPolys,
77
int transX, int transY,
78
boolean close);
79
80
public GraphicsPrimitive traceWrap() {
81
return new TraceDrawPolygons(this);
82
}
83
84
private static class TraceDrawPolygons extends DrawPolygons {
85
DrawPolygons target;
86
87
public TraceDrawPolygons(DrawPolygons 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 DrawPolygons(SunGraphics2D sg2d, SurfaceData sData,
99
int[] xPoints, int[] yPoints,
100
int[] nPoints, int numPolys,
101
int transX, int transY,
102
boolean close)
103
{
104
tracePrimitive(target);
105
target.DrawPolygons(sg2d, sData,
106
xPoints, yPoints, nPoints, numPolys,
107
transX, transY, close);
108
}
109
}
110
}
111
112