430N/A/*
2362N/A * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved.
430N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
430N/A *
430N/A * This code is free software; you can redistribute it and/or modify it
430N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
430N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
430N/A *
430N/A * This code is distributed in the hope that it will be useful, but WITHOUT
430N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
430N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
430N/A * version 2 for more details (a copy is included in the LICENSE file that
430N/A * accompanied this code).
430N/A *
430N/A * You should have received a copy of the GNU General Public License version
430N/A * 2 along with this work; if not, write to the Free Software Foundation,
430N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
430N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
430N/A */
430N/A
430N/Apackage sun.java2d.pipe.hw;
430N/A
430N/Aimport java.awt.image.VolatileImage;
430N/A
430N/A/**
430N/A * Implementors of this interface provida a way to create a
430N/A * {@code VolatileImage} whose destination surface is an
430N/A * {@link AccelSurface} of specified type.
430N/A *
430N/A * @see AccelSurface
430N/A */
430N/Apublic interface AccelGraphicsConfig extends BufferedContextProvider {
430N/A /**
430N/A * Returns a VolatileImage with specified width, height, transparency
430N/A * and guaranteed accelerated surface type. If such image can not be created
430N/A * (out of vram error, specific surface type is not supported) null
430N/A * is returned.
430N/A *
430N/A * Note: if {@link AccelSurface#TEXTURE} type is requested, rendering
430N/A * to the image will be denied by throwing
430N/A * {@code UnsupportedOperationException }
430N/A * from {@link java.awt.image.VolatileImage#getGraphics} and
430N/A * {@link java.awt.image.VolatileImage#createGraphics}
430N/A *
430N/A * @param width the width of the returned {@code VolatileImage}
430N/A * @param height the height of the returned {@code VolatileImage}
430N/A * @param transparency the specified transparency mode
430N/A * @param type requested accelerated surface type as specified by constants
430N/A * in AccelSurface interface
430N/A * @return a {@code VolatileImage} backed up by requested accelerated
430N/A * surface type or null
430N/A * @throws IllegalArgumentException if the transparency is not a valid value
430N/A * @see AccelSurface#TEXTURE
430N/A * @see AccelSurface#RT_PLAIN
430N/A * @see AccelSurface#RT_TEXTURE
430N/A */
430N/A public VolatileImage createCompatibleVolatileImage(int width, int height,
430N/A int transparency,
430N/A int type);
430N/A /**
430N/A * Returns object representing capabilities of the context associated
430N/A * with this {@code AccelGraphicsConfig}.
430N/A *
430N/A * @return ContextCapabilities object representing caps
430N/A * @see ContextCapabilities
430N/A */
430N/A public ContextCapabilities getContextCapabilities();
430N/A
430N/A /**
430N/A * Adds an {@code AccelDeviceEventListener} to listen to accelerated
430N/A * device's (which is associated with this {@code AccelGraphicsConfig})
430N/A * events.
430N/A *
430N/A * Note: a hard link to the listener may be kept so it must be explicitly
430N/A * removed via {@link #removeDeviceEventListener()}.
430N/A *
430N/A * @param l the listener
430N/A * @see AccelDeviceEventListener
430N/A */
430N/A public void addDeviceEventListener(AccelDeviceEventListener l);
430N/A
430N/A /**
430N/A * Removes an {@code AccelDeviceEventListener} from the list of listeners
430N/A * for this device's events.
430N/A *
430N/A * @param l the listener
430N/A * @see AccelDeviceEventListener
430N/A */
430N/A public void removeDeviceEventListener(AccelDeviceEventListener l);
430N/A}