/*
* 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.
*/
abstract class XRPaints {
}
switch (sg2d.paintState) {
case SunGraphics2D.PAINT_GRADIENT:
return xrGradient;
return xrLinearGradient;
return xrRadialGradient;
case SunGraphics2D.PAINT_TEXTURE:
return xrTexture;
default:
return null;
}
}
/**
* Attempts to locate an implementation corresponding to the paint state of
* the provided SunGraphics2D object. If no implementation can be found, or
* if the paint cannot be accelerated under the conditions of the
* SunGraphics2D, this method returns false; otherwise, returns true.
*/
}
}
}
/**
* Returns true if this implementation is able to accelerate the Paint
* object associated with, and under the conditions of, the provided
* SunGraphics2D instance; otherwise returns false.
*/
private XRGradient() {
}
/**
* There are no restrictions for accelerating GradientPaint, so this
* method always returns true.
*/
return true;
}
float fractions[] = new float[2];
try {
} catch (NoninvertibleTransformException ex) {
at.setToIdentity();
}
}
}
}
return true;
}
try {
} catch (NoninvertibleTransformException ex) {
}
}
}
}
// save original (untransformed) center and focus points
// transform unit circle to gradient coords; we start with the
// unit circle (center=(0,0), focus on positive x-axis, radius=1)
// and then transform into gradient space
// at.scale(radius, radius);
// invert to get mapping from device coords to unit circle
try {
} catch (Exception e) {
}
// clamp the focus point so that it does not rest on, or outside
// of, the circumference of the gradient circle
int gradient = con.createRadialGradient(new Point2D.Float(0, 0), new Point2D.Float(0, 0), 0, radius, fractions, pixels, repeat, at);
}
}
SurfaceData srcData = dstData.getSourceSurfaceData(bi, SunGraphics2D.TRANSFORM_ISIDENT, CompositeType.SrcOver, null);
if (!(srcData instanceof XRSurfaceData)) {
// REMIND: this is a hack that attempts to cache the system
// memory image from the TexturePaint instance into an
// OpenGL texture...
srcData = dstData.getSourceSurfaceData(bi, SunGraphics2D.TRANSFORM_ISIDENT, CompositeType.SrcOver, null);
if (!(srcData instanceof XRSurfaceData)) {
return false;
}
}
return true;
}
SurfaceData srcData = dstData.getSourceSurfaceData(bi, SunGraphics2D.TRANSFORM_ISIDENT, CompositeType.SrcOver, null);
// REMIND: this hack tries to ensure that we have a cached texture
if (!(srcData instanceof XRSurfaceData)) {
srcData = dstData.getSourceSurfaceData(paint.getImage(), SunGraphics2D.TRANSFORM_ISIDENT, CompositeType.SrcOver, null);
if (!(srcData instanceof XRSurfaceData)) {
throw new InternalError("Surface not cachable");
}
}
at.scale(anchor.getWidth() / ((double) bi.getWidth()), anchor.getHeight() / ((double) bi.getHeight()));
try {
} catch (NoninvertibleTransformException ex) {
}
x11SrcData.validateAsSource(at, XRUtils.RepeatNormal, XRUtils.ATransOpToXRQuality(sg2d.interpolationType));
}
}
}
return pixels;
}
int a = rgb >>> 24;
int b = (rgb) & 0xff;
if (linear) {
r = BufferedPaints.convertSRGBtoLinearRGB(r);
g = BufferedPaints.convertSRGBtoLinearRGB(g);
b = BufferedPaints.convertSRGBtoLinearRGB(b);
}
a *= xrCompMan.getExtraAlpha();
return ((a << 24) | (r << 16) | (g << 8) | (b));
}
}