Path: blob/master/src/java.desktop/macosx/classes/sun/lwawt/LWGraphicsConfig.java
41153 views
/*1* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package sun.lwawt;2627import java.awt.AWTException;28import java.awt.BufferCapabilities;29import java.awt.Component;30import java.awt.Image;3132/**33* As lwawt can be used on different platforms with different graphic34* configurations, the general set of methods is necessary. This interface35* collects the methods that should be provided by GraphicsConfiguration,36* simplifying use by the LWAWT.37*38* @author Sergey Bylokhov39*/40public interface LWGraphicsConfig {4142/*43* A GraphicsConfiguration must implements following methods to indicate44* that it imposes certain limitations on the maximum size of supported45* textures.46*/4748/**49* Returns the maximum width of any texture image. By default return {@code50* Integer.MAX_VALUE}.51*/52int getMaxTextureWidth();5354/**55* Returns the maximum height of any texture image. By default return {@code56* Integer.MAX_VALUE}.57*/58int getMaxTextureHeight();5960/*61* The following methods correspond to the multi-buffering methods in62* LWComponentPeer.java.63*/6465/**66* Checks that the requested configuration is natively supported; if not, an67* AWTException is thrown.68*/69void assertOperationSupported(int numBuffers, BufferCapabilities caps)70throws AWTException;7172/**73* Creates a back buffer for the given peer and returns the image wrapper.74*/75Image createBackBuffer(LWComponentPeer<?, ?> peer);7677/**78* Destroys the back buffer object.79*/80void destroyBackBuffer(Image backBuffer);8182/**83* Performs the native flip operation for the given target Component. Our84* flip is implemented through normal drawImage() to the graphic object,85* because of our components uses a graphic object of the container(in this86* case we also apply necessary constrains)87*/88void flip(LWComponentPeer<?, ?> peer, Image backBuffer, int x1, int y1,89int x2, int y2, BufferCapabilities.FlipContents flipAction);9091/**92* Creates a new hidden-acceleration image of the given width and height93* that is associated with the target Component.94*/95Image createAcceleratedImage(Component target, int width, int height);96}979899