/*
* 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.
*/
/**
* The proxy class contains the logic for when to replace a
* SurfaceData with a cached X11 Pixmap and the code to create
* the accelerated surfaces.
*/
implements Transparency
{
{
if (srcData instanceof X11SurfaceData) {
// srcData must be a VolatileImage which either matches
// our visual or not - either way we do not cache it...
return UNCACHED;
}
// 4673490: updateBitmask() only handles ICMs with 8-bit indices
}
// The only other ColorModel handled by updateBitmask() is
// a DCM where the alpha bit, and only the alpha bit, is in
// the top 8 bits
if (cm instanceof DirectColorModel) {
dcm.getGreenMask() |
dcm.getBlueMask());
{
}
}
}
// For whatever reason, this image is not a good candidate for
// caching in a pixmap so we return the non-caching (non-)proxy.
return UNCACHED;
}
}
int w, int h)
{
if (cachedData == null) {
// Bitmask will be created lazily during the blit phase
}
return cachedData;
}
/**
* Proxy for opaque source images.
* This proxy can accelerate unscaled Src copies.
*/
super(x11gc);
}
public int getTransparency() {
return Transparency.OPAQUE;
}
int txtype,
{
}
}
/**
* Proxy for bitmask transparent source images.
* This proxy can accelerate unscaled Src copies or
* unscaled SrcOver copies that use an opaque bgColor.
*/
super(x11gc);
}
public int getTransparency() {
return Transparency.BITMASK;
}
int txtype,
{
// These could probably be combined into a single
// nested if, but the logic is easier to follow this way.
// we don't have X11 scale loops, so always use
// software surface in case of scaling
return false;
}
{
return false;
}
// for transparent images SrcNoEa+bgColor has the
// same effect as SrcOverNoEa+bgColor, so we allow
// copying from pixmap SD using accelerated blitbg loops:
// SrcOver will be changed to SrcNoEa in DrawImage.blitSD
{
return true;
}
return false;
}
}
}