/*
* 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.
*/
protected int depth;
long drawable);
public static final String
public static final String
public static final String
public static final String
"alpha";
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
public static final String
= "Ushort 555 RGB Pixmap with 1-bit transp";
public static final String
= "Ushort 565 RGB Pixmap with 1-bit transp";
public static final String
public static final String
// Bitmap surface types
throw new InternalError("not implemented yet");
}
protected static boolean dgaAvailable;
static {
if (!isX11SurfaceDataInitialized() &&
// If a screen magnifier is present, don't attempt to use DGA
// Only verbose if they use the full string "true"
}
x11textpipe = new X11TextRenderer();
if (GraphicsPrimitive.tracingEnabled()) {
}
} else {
// Only verbose if they use the full string "false"
}
}
if (isAccelerationEnabled()) {
}
}
}
/**
* Returns true if we can use DGA on any of the screens
*/
public static native boolean isDgaAvailable();
/**
* Returns true if shared memory pixmaps are available
*/
private static native boolean isShmPMAvailable();
public static boolean isAccelerationEnabled() {
if (accelerationEnabled == null) {
if (GraphicsEnvironment.isHeadless()) {
} else {
// true iff prop==true, false otherwise
} else {
boolean isDisplayLocal = false;
if (ge instanceof SunGraphicsEnvironment) {
}
// EXA based drivers tend to place pixmaps in VRAM, slowing down readbacks.
// Don't use pixmaps if dga is available,
// or we are local and shared memory Pixmaps are not available.
}
}
}
return accelerationEnabled.booleanValue();
}
}
{
/*
* Note: this is thread-safe since x11txpipe is the
* second of the two pipes constructed in makePipes().
* In the rare case we are racing against another
* thread making new pipes, setting lazypipe is a
* safe alternative to waiting for the other thread.
*/
return;
}
// Do this to init textpipe correctly; we will override the
// other non-text pipes below
// REMIND: we should clean this up eventually instead of
// having this work duplicated.
super.validatePipe(sg2d);
} else {
switch (sg2d.textAntialiasHint) {
/* equating to OFF which it is for us */
// Use X11 pipe even if DGA is available since DGA
// text slows everything down when mixed with X11 calls
} else {
}
break;
// Remind: may use Xrender for these when composite is
// copy as above, or if remote X11.
break;
default:
break;
// Use X11 pipe even if DGA is available since DGA
// text slows everything down when mixed with X11 calls
} else {
}
break;
break;
default:
}
}
}
} else {
}
// This is needed for AA text.
// Note that even an X11TextRenderer can dispatch AA text
// if a GlyphVector overrides the AA setting.
// We use getRenderLoops() rather than setting solidloops
// directly so that we get the appropriate loops in XOR mode.
// assert(some pipe will always be a LoopBasedPipe)
}
} else {
super.validatePipe(sg2d);
}
}
{
return solidloops;
}
return super.getRenderLoops(sg2d);
}
return graphicsConfig;
}
/**
* Method for instantiating a Window SurfaceData
*/
}
/**
* Method for instantiating a Pixmap SurfaceData (offscreen)
*/
long drawable,
int transparency)
{
}
// /**
// * Initializes the native Ops pointer.
// */
// private native void initOps(X11ComponentPeer peer,
// X11GraphicsConfig gc, int depth);
ColorModel cm) {
this.graphicsConfig = gc;
if (isAccelerationEnabled()) {
}
}
} else {
}
}
/**
* Returns a boolean indicating whether or not a copyArea from
* the given rectangle source coordinates might be incomplete
* and result in X11 GraphicsExposure events being generated
* from XCopyArea.
* This method allows the SurfaceData copyArea method to determine
* if it needs to set the GraphicsExposures attribute of the X11 GC
* to True or False to receive or avoid the events.
* @return true if there is any chance that an XCopyArea from the
* given source coordinates could produce any X11
* Exposure events.
*/
public abstract boolean canSourceSendExposures(int x, int y, int w, int h);
{
if (!isDrawableValid()) {
return true;
}
makePipes();
}
{
try {
boolean needExposures = canSourceSendExposures(x, y, w, h);
x, y,
w, h);
} finally {
}
return true;
}
return false;
}
int transparency)
{
}
int transparency,
boolean pixmapSurface)
{
switch (cm.getPixelSize()) {
case 24:
if (cm instanceof DirectColorModel) {
// 4517321: We will always use ThreeByteBgr for 24 bpp
// surfaces, regardless of the pixel masks reported by
// X11. Despite ambiguity in the X11 spec in how 24 bpp
// surfaces are treated, it appears that the best
// SurfaceType for these configurations (including
// some Matrox Millenium and ATI Radeon boards) is
// ThreeByteBgr.
} else {
cm.getPixelSize() +
", " + cm);
}
break;
}
// Fall through for 32 bit case
case 32:
if (cm instanceof DirectColorModel) {
{
} else {
} else {
}
}
} else if (cm instanceof ComponentColorModel) {
} else {
cm.getPixelSize() +
", " + cm);
}
break;
case 15:
break;
case 16:
if ((cm instanceof DirectColorModel) &&
{
// fix for 4352984: Riva128 on Linux
} else {
}
break;
case 12:
if (cm instanceof IndexColorModel) {
sType = transparent ?
} else {
"depth: " +
cm.getPixelSize() +
" cm="+cm);
}
break;
case 8:
cm instanceof ComponentColorModel) {
} else if (cm instanceof IndexColorModel &&
} else {
}
break;
default:
"depth: " +
cm.getPixelSize());
}
return sType;
}
public void invalidate() {
if (isValid()) {
setInvalid();
super.invalidate();
}
}
/**
* The following methods and variables are used to keep the Java-level
* context state in sync with the native X11 GC associated with this
* X11SurfaceData object.
*/
private long xgc;
private int xorpixelmod;
private int validatedPixel;
private boolean validatedExposures = true;
int pixel)
{
}
}
int pixel, boolean needExposures)
{
// assert SunToolkit.isAWTLockHeldByCurrentThread();
if (!isValid()) {
throw new InvalidPipeException("bounds changed");
}
// validate clip
if (clip != validatedClip) {
} else {
}
}
// validate composite
if (validatedXorComp != null) {
xorpixelmod = 0;
}
} else {
if (validatedXorComp != comp) {
}
}
// validate pixel
pixel ^= xorpixelmod;
if (pixel != validatedPixel) {
}
if (validatedExposures != needExposures) {
}
return xgc;
}
public synchronized void makePipes() {
try {
} finally {
}
}
}
SurfaceType sType) {
if (isDrawableValid()) {
makePipes();
}
}
return peer.getSurfaceData();
}
r.x = r.y = 0;
return r;
}
public boolean canSourceSendExposures(int x, int y, int w, int h) {
return true;
}
/**
* Returns destination Component associated with this SurfaceData.
*/
}
}
int width;
int height;
int transparency;
long drawable, int transparency)
{
this.transparency = transparency;
makePipes();
}
return restoreContents(offscreenImage);
}
/**
* Need this since the surface data is created with
* the color model of the target GC, which is always
* opaque. But in SunGraphics2D.blitSD we choose loops
* based on the transparency on the source SD, so
* it could choose wrong loop (blit instead of blitbg,
* for example).
*/
public int getTransparency() {
return transparency;
}
}
public boolean canSourceSendExposures(int x, int y, int w, int h) {
}
public void flush() {
/*
* We need to invalidate the surface before disposing the
* native Drawable and GC. This way if an application tries
* to render to an already flushed X11SurfaceData, we will notice
* in the validate() method above that it has been invalidated,
* and we will avoid using those native resources that have
* already been disposed.
*/
invalidate();
}
/**
* Returns destination Image associated with this SurfaceData.
*/
return offscreenImage;
}
}
if (!xsd.isDrawableValid()) {
return false;
}
}
}
}