/*
* 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.
*/
public class D3DGraphicsConfig
extends Win32GraphicsConfig
implements AccelGraphicsConfig
{
super(device, 0);
}
return D3DSurfaceData.createData(this, w, h,
null,
}
public synchronized void displayChanged() {
super.displayChanged();
// the context could hold a reference to a D3DSurfaceData, which in
// turn has a reference back to this D3DGraphicsConfig, so in order
// for this instance to be disposed we need to break the connection
try {
} finally {
}
}
switch (transparency) {
case Transparency.OPAQUE:
// REMIND: once the ColorModel spec is changed, this should be
// an opaque premultiplied DCM...
case Transparency.BITMASK:
case Transparency.TRANSLUCENT:
0xff0000, 0xff00, 0xff, 0xff000000,
true, DataBuffer.TYPE_INT);
default:
return null;
}
}
}
/**
* The following methods are invoked from WComponentPeer.java rather
* than having the Win32-dependent implementations hardcoded in that
* class. This way the appropriate actions are taken based on the peer's
* GraphicsConfig, whether it is a Win32GraphicsConfig or a
* D3DGraphicsConfig.
*/
/**
* Creates a new SurfaceData that will be associated with the given
* WComponentPeer. D3D9 doesn't allow rendering to the screen,
* so a GDI surface will be returned.
*/
int numBackBuffers)
{
}
/**
* The following methods correspond to the multibuffering methods in
* WComponentPeer.java...
*/
/**
* Checks that the requested configuration is natively supported; if not,
* an AWTException is thrown.
*/
int numBuffers,
throws AWTException
{
throw new AWTException("Only 2-4 buffers supported");
}
numBuffers != 2)
{
throw new AWTException("FlipContents.COPIED is only" +
"supported for 2 buffers");
}
}
/**
* Creates a D3D-based backbuffer for the given peer and returns the
* image wrapper.
*/
// it is possible for the component to have size 0x0, adjust it to
// be at least 1x1 to avoid IAE
}
/**
* Performs the native D3D flip operation for the given target Component.
*/
{
// REMIND: we should actually get a surface data for the
// backBuffer's VI
if (sd instanceof D3DSurfaceData) {
} else {
// the surface was likely lost could not have been restored
try {
null);
} finally {
g.dispose();
}
}
try {
backBuffer.getHeight());
} finally {
g.dispose();
}
}
}
public D3DBufferCaps() {
// REMIND: should we indicate that the front-buffer
// (the on-screen rendering) is not accelerated?
}
public boolean isMultiBufferAvailable() {
return true;
}
}
if (bufferCaps == null) {
bufferCaps = new D3DBufferCaps();
}
return bufferCaps;
}
private D3DImageCaps() {
super(true);
}
public boolean isTrueVolatile() {
return true;
}
}
return imageCaps;
}
return device;
}
/**
* {@inheritDoc}
*
* @see sun.java2d.pipe.hw.BufferedContextProvider#getContext
*/
return device.getContext();
}
/**
* {@inheritDoc}
*
* @see sun.java2d.pipe.hw.AccelGraphicsConfig#createCompatibleVolatileImage
*/
public VolatileImage
int transparency, int type)
{
{
return null;
}
if (type == RT_TEXTURE) {
return null;
}
return null;
}
}
transparency, type);
if (!(sd instanceof AccelSurface) ||
{
}
return vi;
}
/**
* {@inheritDoc}
*
* @see sun.java2d.pipe.hw.AccelGraphicsConfig#getContextCapabilities
*/
return device.getContextCapabilities();
}
}
}
}