/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#include "sun_java2d_x11_X11Renderer.h"
#include "X11SurfaceData.h"
#include "SpanIterator.h"
#include "Trace.h"
#include "ProcessPath.h"
#include "GraphicsPrimitiveMgr.h"
#include <jlong.h>
#ifndef HEADLESS
#define ABS(n) (((n) < 0) ? -(n) : (n))
? MAX_SHORT \
: ((x) < MIN_SHORT) \
? MIN_SHORT \
: (x))
typedef struct {
do { \
} while(0)
do { \
} while(0)
do { \
} else { \
} \
} \
_pnts->x = X; \
_pnts->y = Y; \
} while(0)
do { \
} \
} while(0)
static void
int x, int y, int w, int h,
int startAngle, int endAngle,
int filled)
{
int s, e;
if (w < 0 || h < 0) {
return;
}
s = 0;
e = 360 * 64;
} else {
e = endAngle * 64;
}
if (filled == 0) {
} else {
}
}
/*
* Copy vertices from xcoordsArray and ycoordsArray to a buffer
* of XPoint structures, translating by transx and transy and
* collapsing empty segments out of the list as we go.
* The number of points to be converted should be guaranteed
* to be more than 2 by the caller and is stored at *pNpoints.
* The resulting number of uncollapsed unique translated vertices
* will be stored back into the location *pNpoints.
* The points pointer is guaranteed to be pointing to an area of
* memory large enough for POLYTEMPSIZE points and a larger
* area of memory is allocated (and returned) if that is not enough.
*/
static XPoint *
{
return 0;
}
return 0;
}
if (close) {
if (close) {
npoints++;
}
}
if (npoints > POLYTEMPSIZE) {
}
if (close) {
npoints--;
}
out++;
}
}
if (out == 1) {
out = 2;
} else if (close) {
}
}
return points;
}
#endif /* !HEADLESS */
/*
* Class: sun_java2d_x11_X11Renderer
* Method: XDrawLine
* Signature: (IJIIII)V
*/
{
#ifndef HEADLESS
return;
}
#endif /* !HEADLESS */
}
/*
* Class: sun_java2d_x11_X11Renderer
* Method: XDrawRect
* Signature: (IJIIII)V
*/
{
#ifndef HEADLESS
return;
}
if (w < 2 || h < 2) {
/* REMIND: This optimization assumes thin lines. */
/*
* This optimization not only simplifies the processing
* of a particular degenerate case, but it protects against
* the anomalies of various X11 implementations that draw
* nothing for degenerate Polygons and Rectangles.
*/
CLAMP_TO_SHORT(x), CLAMP_TO_SHORT(y),
} else {
CLAMP_TO_SHORT(x), CLAMP_TO_SHORT(y),
CLAMP_TO_USHORT(w), CLAMP_TO_USHORT(h));
}
#endif /* !HEADLESS */
}
/*
* Class: sun_java2d_x11_X11Renderer
* Method: XDrawRoundRect
* Signature: (IJIIIIII)V
*/
{
#ifndef HEADLESS
return;
}
if (arcW > w) {
arcW = w;
}
if (arcH > h) {
arcH = h;
}
x, y, w, h);
return;
}
/* clamp to short bounding box of round rectangle */
cx = CLAMP_TO_SHORT(x);
cy = CLAMP_TO_SHORT(y);
cxw = CLAMP_TO_SHORT(x + w);
cyh = CLAMP_TO_SHORT(y + h);
/* clamp to short coordinates of lines */
/*
* recalculate heightes and widthes of round parts
* to minimize distortions in visible area
*/
0, 90, JNI_FALSE);
if (h > 0) {
}
}
if (w > 0) {
}
}
#endif /* !HEADLESS */
}
/*
* Class: sun_java2d_x11_X11Renderer
* Method: XDrawOval
* Signature: (IJIIII)V
*/
{
#ifndef HEADLESS
return;
}
if (w < 2 || h < 2) {
/*
* Fix for 4205762 - 1x1 ovals do not draw on Ultra1, Creator3d
* (related to 4411814 on Windows platform)
* Really small ovals degenerate to simple rectangles as they
* have no curvature or enclosed area. Use XFillRectangle
* for speed and to deal better with degenerate sizes.
*/
if (w >= 0 && h >= 0) {
x, y, w+1, h+1);
}
} else {
x, y, w, h, 0, 360, JNI_FALSE);
}
#endif /* !HEADLESS */
}
/*
* Class: sun_java2d_x11_X11Renderer
* Method: XDrawArc
* Signature: (IJIIIIII)V
*/
{
#ifndef HEADLESS
return;
}
#endif /* !HEADLESS */
}
/*
* Class: sun_java2d_x11_X11Renderer
* Method: XDrawPoly
* Signature: (IJII[I[IIZ)V
*/
{
#ifndef HEADLESS
return;
}
return;
}
{
return;
}
if (npoints < 2) {
return;
}
if (points == 0) {
} else {
if (npoints == 2) {
/*
* Some X11 implementations fail to draw anything for
* simple 2 point polygons where the vertices are the
* same point even though this violates the X11
* specification. For simplicity we will dispatch all
* 2 point polygons through XDrawLine even if they are
* non-degenerate as this may invoke less processing
* down the line than a Poly primitive anyway.
*/
} else {
}
}
}
#endif /* !HEADLESS */
}
{
#ifndef HEADLESS
#endif /* !HEADLESS */
}
#ifndef HEADLESS
#endif /* !HEADLESS */
}
#ifndef HEADLESS
case 0:
/* No-op */
break;
case 1:
/* Draw the single pixel */
break;
case 2:
/*
* The XDrawLines method for some X11 implementations
* fails to draw anything for simple 2 point polygons
* where the vertices are the same point even though
* this violates the X11 specification. For simplicity
* we will dispatch all 2 point polygons through XDrawLine
* even if they are non-degenerate as this may invoke
* less processing down the line than a poly primitive anyway.
*/
break;
default:
/* Draw the entire polyline */
break;
}
#endif /* !HEADLESS */
}
{
#ifndef HEADLESS
#endif /* !HEADLESS */
}
/*
* Class: sun_java2d_x11_X11Renderer
* Method: XDoPath
*/
{
#ifndef HEADLESS
0, 0, 0, 0,
};
return;
}
if (isFill) {
}
if (coordsArray == NULL) {
return;
}
return;
}
if (isFill) {
} else {
stroke);
}
if (!ok) {
}
}
}
#endif /* !HEADLESS */
}
/*
* Class: sun_java2d_x11_X11Renderer
* Method: XFillRect
* Signature: (IJIIII)V
*/
{
#ifndef HEADLESS
return;
}
CLAMP_TO_SHORT(x), CLAMP_TO_SHORT(y),
CLAMP_TO_USHORT(w), CLAMP_TO_USHORT(h));
#endif /* !HEADLESS */
}
/*
* Class: sun_java2d_x11_X11Renderer
* Method: XFillRoundRect
* Signature: (IJIIIIII)V
*/
{
#ifndef HEADLESS
return;
}
if (arcW > w) {
arcW = w;
}
if (arcH > h) {
arcH = h;
}
x, y, w, h);
return;
}
/* clamp to short bounding box of round rectangle */
cx = CLAMP_TO_SHORT(x);
cy = CLAMP_TO_SHORT(y);
cxw = CLAMP_TO_SHORT(x + w);
cyh = CLAMP_TO_SHORT(y + h);
/* clamp to short coordinates of lines */
/*
* recalculate heightes and widthes of round parts
* to minimize distortions in visible area
*/
0, 90, JNI_TRUE);
}
}
}
}
#endif /* !HEADLESS */
}
/*
* Class: sun_java2d_x11_X11Renderer
* Method: XFillOval
* Signature: (IJIIII)V
*/
{
#ifndef HEADLESS
return;
}
if (w < 3 || h < 3) {
/*
* Fix for 4205762 - 1x1 ovals do not draw on Ultra1, Creator3d
* (related to 4411814 on Windows platform)
* Most X11 servers drivers have poor rendering
* for thin ellipses and the rendering is most strikingly
* different from our theoretical arcs. Ideally we should
* trap all ovals less than some fairly large size and
* try to draw aesthetically pleasing ellipses, but that
* would require considerably more work to get the corresponding
* drawArc variants to match pixel for pixel.
* Thin ovals of girth 1 pixel are simple rectangles.
* Thin ovals of girth 2 pixels are simple rectangles with
* potentially smaller lengths. Determine the correct length
* by calculating .5*.5 + scaledlen*scaledlen == 1.0 which
* means that scaledlen is the sqrt(0.75). Scaledlen is
* relative to the true length (w or h) and needs to be
* adjusted by half a pixel in different ways for odd or
* even lengths.
*/
if (w > 2 && h > 1) {
x += (w-adjw)/2;
w = adjw;
} else if (h > 2 && w > 1) {
y += (h-adjh)/2;
h = adjh;
}
if (w > 0 && h > 0) {
}
} else {
x, y, w, h, 0, 360, JNI_TRUE);
}
#endif /* !HEADLESS */
}
/*
* Class: sun_java2d_x11_X11Renderer
* Method: XFillArc
* Signature: (IJIIIIII)V
*/
{
#ifndef HEADLESS
return;
}
#endif /* !HEADLESS */
}
/*
* Class: sun_java2d_x11_X11Renderer
* Method: XFillPoly
* Signature: (IJII[I[II)V
*/
{
#ifndef HEADLESS
return;
}
return;
}
{
return;
}
if (npoints < 3) {
return;
}
if (points == 0) {
} else {
if (npoints > 2) {
}
}
}
#endif /* !HEADLESS */
}
/*
* Class: sun_java2d_x11_X11Renderer
* Method: XFillSpans
* Signature: (IJLsun/java2d/pipe/SpanIterator;JII)V
*/
{
#ifndef HEADLESS
void *srData;
jint x, y, w, h;
return;
}
return;
}
return;
}
CLAMP_TO_SHORT(x), CLAMP_TO_SHORT(y),
CLAMP_TO_USHORT(w), CLAMP_TO_USHORT(h));
}
#endif /* !HEADLESS */
}
/*
* Class: sun_java2d_x11_X11Renderer
* Method: devCopyArea
* Signature: (Lsun/java2d/SurfaceData;IIIIII)V
*/
{
#ifndef HEADLESS
return;
}
return;
}
#endif /* !HEADLESS */
}