author | serb |
Wed, 21 Nov 2012 15:50:34 +0400 | |
changeset 14647 | bacc2d4f4b27 |
permissions | -rw-r--r-- |
14647
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
1 |
/* |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
2 |
* Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
4 |
* |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. Oracle designates this |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
8 |
* particular file as subject to the "Classpath" exception as provided |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
9 |
* by Oracle in the LICENSE file that accompanied this code. |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
10 |
* |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
15 |
* accompanied this code). |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
16 |
* |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
17 |
* You should have received a copy of the GNU General Public License version |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
20 |
* |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
22 |
* or visit www.oracle.com if you need additional information or have any |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
23 |
* questions. |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
24 |
*/ |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
25 |
|
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
26 |
package sun.lwawt; |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
27 |
|
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
28 |
import java.awt.AWTException; |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
29 |
import java.awt.BufferCapabilities; |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
30 |
import java.awt.Component; |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
31 |
import java.awt.Image; |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
32 |
|
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
33 |
/** |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
34 |
* As lwawt can be used on different platforms with different graphic |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
35 |
* configurations, the general set of methods is necessary. This interface |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
36 |
* collects the methods that should be provided by GraphicsConfiguration, |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
37 |
* simplifying use by the LWAWT. |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
38 |
* |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
39 |
* @author Sergey Bylokhov |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
40 |
*/ |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
41 |
public interface LWGraphicsConfig { |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
42 |
|
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
43 |
/* |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
44 |
* A GraphicsConfiguration must implements following methods to indicate |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
45 |
* that it imposes certain limitations on the maximum size of supported |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
46 |
* textures. |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
47 |
*/ |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
48 |
|
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
49 |
/** |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
50 |
* Returns the maximum width of any texture image. By default return {@code |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
51 |
* Integer.MAX_VALUE}. |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
52 |
*/ |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
53 |
int getMaxTextureWidth(); |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
54 |
|
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
55 |
/** |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
56 |
* Returns the maximum height of any texture image. By default return {@code |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
57 |
* Integer.MAX_VALUE}. |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
58 |
*/ |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
59 |
int getMaxTextureHeight(); |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
60 |
|
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
61 |
/* |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
62 |
* The following methods correspond to the multi-buffering methods in |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
63 |
* LWComponentPeer.java. |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
64 |
*/ |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
65 |
|
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
66 |
/** |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
67 |
* Checks that the requested configuration is natively supported; if not, an |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
68 |
* AWTException is thrown. |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
69 |
*/ |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
70 |
void assertOperationSupported(int numBuffers, BufferCapabilities caps) |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
71 |
throws AWTException; |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
72 |
|
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
73 |
/** |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
74 |
* Creates a back buffer for the given peer and returns the image wrapper. |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
75 |
*/ |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
76 |
Image createBackBuffer(LWComponentPeer<?, ?> peer); |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
77 |
|
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
78 |
/** |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
79 |
* Destroys the back buffer object. |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
80 |
*/ |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
81 |
void destroyBackBuffer(Image backBuffer); |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
82 |
|
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
83 |
/** |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
84 |
* Performs the native flip operation for the given target Component. Our |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
85 |
* flip is implemented through normal drawImage() to the graphic object, |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
86 |
* because of our components uses a graphic object of the container(in this |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
87 |
* case we also apply necessary constrains) |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
88 |
*/ |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
89 |
void flip(LWComponentPeer<?, ?> peer, Image backBuffer, int x1, int y1, |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
90 |
int x2, int y2, BufferCapabilities.FlipContents flipAction); |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
91 |
|
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
92 |
/** |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
93 |
* Creates a new hidden-acceleration image of the given width and height |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
94 |
* that is associated with the target Component. |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
95 |
*/ |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
96 |
Image createAcceleratedImage(Component target, int width, int height); |
bacc2d4f4b27
7124552: [macosx] NullPointerException in getBufferStrategy()
serb
parents:
diff
changeset
|
97 |
} |