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/DrawParallelogram.java
41159 views
1
/*
2
* Copyright (c) 2008, 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 Jim Graham
28
*/
29
30
package sun.java2d.loops;
31
32
import sun.java2d.SunGraphics2D;
33
import sun.java2d.SurfaceData;
34
35
/**
36
* DrawParallelogram
37
* 1) fill the area between the 4 edges of an outer parallelogram
38
* (as specified by an origin and 2 delta vectors)
39
* but also outside the 4 edges of an inner parallelogram
40
* (as specified by proportional amounts of the outer delta vectors)
41
*/
42
public class DrawParallelogram extends GraphicsPrimitive
43
{
44
public static final String methodSignature =
45
"DrawParallelogram(...)".toString();
46
47
public static final int primTypeID = makePrimTypeID();
48
49
public static DrawParallelogram locate(SurfaceType srctype,
50
CompositeType comptype,
51
SurfaceType dsttype)
52
{
53
return (DrawParallelogram)
54
GraphicsPrimitiveMgr.locate(primTypeID,
55
srctype, comptype, dsttype);
56
}
57
58
protected DrawParallelogram(SurfaceType srctype,
59
CompositeType comptype,
60
SurfaceType dsttype)
61
{
62
super(methodSignature, primTypeID,
63
srctype, comptype, dsttype);
64
}
65
66
public DrawParallelogram(long pNativePrim,
67
SurfaceType srctype,
68
CompositeType comptype,
69
SurfaceType dsttype)
70
{
71
super(pNativePrim, methodSignature, primTypeID,
72
srctype, comptype, dsttype);
73
}
74
75
/**
76
* All DrawParallelogram implementors must have this invoker method
77
*/
78
public native void DrawParallelogram(SunGraphics2D sg, SurfaceData dest,
79
double x, double y,
80
double dx1, double dy1,
81
double dx2, double dy2,
82
double lw1, double lw2);
83
84
public GraphicsPrimitive traceWrap() {
85
return new TraceDrawParallelogram(this);
86
}
87
88
private static class TraceDrawParallelogram extends DrawParallelogram {
89
DrawParallelogram target;
90
91
public TraceDrawParallelogram(DrawParallelogram target) {
92
super(target.getSourceType(),
93
target.getCompositeType(),
94
target.getDestType());
95
this.target = target;
96
}
97
98
public GraphicsPrimitive traceWrap() {
99
return this;
100
}
101
102
public void DrawParallelogram(SunGraphics2D sg2d, SurfaceData dest,
103
double x, double y,
104
double dx1, double dy1,
105
double dx2, double dy2,
106
double lw1, double lw2)
107
{
108
tracePrimitive(target);
109
target.DrawParallelogram(sg2d, dest,
110
x, y, dx1, dy1, dx2, dy2, lw1, lw2);
111
}
112
}
113
}
114
115