author | phh |
Sat, 30 Nov 2019 14:33:05 -0800 | |
changeset 59330 | 5b96c12f909d |
parent 47216 | 71c04702a3d5 |
permissions | -rw-r--r-- |
887 | 1 |
/* |
23010
6dadb192ad81
8029235: Update copyright year to match last edit in jdk8 jdk repository for 2013
lana
parents:
14856
diff
changeset
|
2 |
* Copyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. |
887 | 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 |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
887 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
887 | 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 |
* |
|
5506 | 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. |
|
887 | 24 |
*/ |
25 |
||
26 |
package sun.java2d.pipe; |
|
27 |
||
28 |
import sun.java2d.SunGraphics2D; |
|
29 |
||
30 |
/** |
|
31 |
* This interface defines the set of calls that pipeline objects |
|
32 |
* can use to pass on responsibility for drawing arbitrary |
|
33 |
* parallelogram shapes. |
|
34 |
* Six floating point numbers are provided and the parallelogram |
|
35 |
* is defined as the quadrilateral with the following vertices: |
|
36 |
* <pre> |
|
37 |
* origin: (x, y) |
|
38 |
* => (x+dx1, y+dy1) |
|
39 |
* => (x+dx1+dx2, y+dy1+dy2) |
|
40 |
* => (x+dx2, y+dy2) |
|
41 |
* => origin |
|
42 |
* </pre> |
|
9653
6a1eff16874d
7043054: REGRESSION: JDK 7 b126 : Wrong userBounds in Paint.createContext()
flar
parents:
5506
diff
changeset
|
43 |
* The four u[xy][12] parameters are the unsorted extreme coordinates |
6a1eff16874d
7043054: REGRESSION: JDK 7 b126 : Wrong userBounds in Paint.createContext()
flar
parents:
5506
diff
changeset
|
44 |
* of the primitive in user space. They may have been generated by a |
6a1eff16874d
7043054: REGRESSION: JDK 7 b126 : Wrong userBounds in Paint.createContext()
flar
parents:
5506
diff
changeset
|
45 |
* line or a rectangle so they could have u[xy]2 < u[xy]1 in some cases. |
6a1eff16874d
7043054: REGRESSION: JDK 7 b126 : Wrong userBounds in Paint.createContext()
flar
parents:
5506
diff
changeset
|
46 |
* They should be sorted before calculating the bounds of the original |
6a1eff16874d
7043054: REGRESSION: JDK 7 b126 : Wrong userBounds in Paint.createContext()
flar
parents:
5506
diff
changeset
|
47 |
* primitive (such as for calculating the user space bounds for the |
6a1eff16874d
7043054: REGRESSION: JDK 7 b126 : Wrong userBounds in Paint.createContext()
flar
parents:
5506
diff
changeset
|
48 |
* Paint.createContext() method). |
887 | 49 |
*/ |
50 |
public interface ParallelogramPipe { |
|
51 |
public void fillParallelogram(SunGraphics2D sg, |
|
9653
6a1eff16874d
7043054: REGRESSION: JDK 7 b126 : Wrong userBounds in Paint.createContext()
flar
parents:
5506
diff
changeset
|
52 |
double ux1, double uy1, |
6a1eff16874d
7043054: REGRESSION: JDK 7 b126 : Wrong userBounds in Paint.createContext()
flar
parents:
5506
diff
changeset
|
53 |
double ux2, double uy2, |
887 | 54 |
double x, double y, |
55 |
double dx1, double dy1, |
|
56 |
double dx2, double dy2); |
|
57 |
||
58 |
/** |
|
59 |
* Draw a Parallelogram with the indicated line widths |
|
60 |
* assuming a standard BasicStroke with MITER joins. |
|
61 |
* lw1 specifies the width of the stroke along the dx1,dy1 |
|
62 |
* vector and lw2 specifies the width of the stroke along |
|
63 |
* the dx2,dy2 vector. |
|
64 |
* This is equivalent to outsetting the indicated |
|
65 |
* parallelogram by lw/2 pixels, then insetting the |
|
66 |
* same parallelogram by lw/2 pixels and filling the |
|
67 |
* difference between the outer and inner parallelograms. |
|
68 |
*/ |
|
69 |
public void drawParallelogram(SunGraphics2D sg, |
|
9653
6a1eff16874d
7043054: REGRESSION: JDK 7 b126 : Wrong userBounds in Paint.createContext()
flar
parents:
5506
diff
changeset
|
70 |
double ux1, double uy1, |
6a1eff16874d
7043054: REGRESSION: JDK 7 b126 : Wrong userBounds in Paint.createContext()
flar
parents:
5506
diff
changeset
|
71 |
double ux2, double uy2, |
887 | 72 |
double x, double y, |
73 |
double dx1, double dy1, |
|
74 |
double dx2, double dy2, |
|
75 |
double lw1, double lw2); |
|
76 |
} |