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/FillParallelogram.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
* FillParallelogram
37
* 1) fill the area between the 4 edges of a parallelogram
38
* (as specified by an origin and 2 delta vectors)
39
*/
40
public class FillParallelogram extends GraphicsPrimitive
41
{
42
public static final String methodSignature =
43
"FillParallelogram(...)".toString();
44
45
public static final int primTypeID = makePrimTypeID();
46
47
public static FillParallelogram locate(SurfaceType srctype,
48
CompositeType comptype,
49
SurfaceType dsttype)
50
{
51
return (FillParallelogram)
52
GraphicsPrimitiveMgr.locate(primTypeID,
53
srctype, comptype, dsttype);
54
}
55
56
protected FillParallelogram(SurfaceType srctype,
57
CompositeType comptype,
58
SurfaceType dsttype)
59
{
60
super(methodSignature, primTypeID,
61
srctype, comptype, dsttype);
62
}
63
64
public FillParallelogram(long pNativePrim,
65
SurfaceType srctype,
66
CompositeType comptype,
67
SurfaceType dsttype)
68
{
69
super(pNativePrim, methodSignature, primTypeID,
70
srctype, comptype, dsttype);
71
}
72
73
/**
74
* All FillParallelogram implementors must have this invoker method
75
*/
76
public native void FillParallelogram(SunGraphics2D sg2d, SurfaceData dest,
77
double x0, double y0,
78
double dx1, double dy1,
79
double dx2, double dy2);
80
81
public GraphicsPrimitive traceWrap() {
82
return new TraceFillParallelogram(this);
83
}
84
85
private static class TraceFillParallelogram extends FillParallelogram {
86
FillParallelogram target;
87
88
public TraceFillParallelogram(FillParallelogram target) {
89
super(target.getSourceType(),
90
target.getCompositeType(),
91
target.getDestType());
92
this.target = target;
93
}
94
95
public GraphicsPrimitive traceWrap() {
96
return this;
97
}
98
99
public void FillParallelogram(SunGraphics2D sg2d, SurfaceData dest,
100
double x0, double y0,
101
double dx1, double dy1,
102
double dx2, double dy2)
103
{
104
tracePrimitive(target);
105
target.FillParallelogram(sg2d, dest, x0, y0, dx1, dy1, dx2, dy2);
106
}
107
}
108
}
109
110