1 /* |
1 /* |
2 * Copyright (c) 2007, 2008, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
26 package sun.java2d.pipe.hw; |
26 package sun.java2d.pipe.hw; |
27 |
27 |
28 import java.awt.Rectangle; |
28 import java.awt.Rectangle; |
29 import sun.java2d.Surface; |
29 import sun.java2d.Surface; |
30 |
30 |
31 import javax.tools.annotation.GenerateNativeHeader; |
31 import java.lang.annotation.Native; |
32 |
32 |
33 /** |
33 /** |
34 * Abstraction for a hardware accelerated surface. |
34 * Abstraction for a hardware accelerated surface. |
35 */ |
35 */ |
36 /* No native methods here, but the constants are needed in the supporting JNI code */ |
|
37 @GenerateNativeHeader |
|
38 public interface AccelSurface extends BufferedContextProvider, Surface { |
36 public interface AccelSurface extends BufferedContextProvider, Surface { |
39 /** |
37 /** |
40 * Undefined |
38 * Undefined |
41 */ |
39 */ |
42 public static final int UNDEFINED = 0; |
40 @Native public static final int UNDEFINED = 0; |
43 /** |
41 /** |
44 * Window (or window substitute) surface |
42 * Window (or window substitute) surface |
45 */ |
43 */ |
46 public static final int WINDOW = 1; |
44 @Native public static final int WINDOW = 1; |
47 /** |
45 /** |
48 * Render-To Plain surface (pbuffer for OpenGL, Render Target surface |
46 * Render-To Plain surface (pbuffer for OpenGL, Render Target surface |
49 * for Direct3D) |
47 * for Direct3D) |
50 */ |
48 */ |
51 public static final int RT_PLAIN = 2; |
49 @Native public static final int RT_PLAIN = 2; |
52 /** |
50 /** |
53 * Texture surface |
51 * Texture surface |
54 */ |
52 */ |
55 public static final int TEXTURE = 3; |
53 @Native public static final int TEXTURE = 3; |
56 /** |
54 /** |
57 * A back-buffer surface (SwapChain surface for Direct3D, backbuffer for |
55 * A back-buffer surface (SwapChain surface for Direct3D, backbuffer for |
58 * OpenGL) |
56 * OpenGL) |
59 */ |
57 */ |
60 public static final int FLIP_BACKBUFFER = 4; |
58 @Native public static final int FLIP_BACKBUFFER = 4; |
61 /** |
59 /** |
62 * Render-To Texture surface (fbobject for OpenGL, texture with render-to |
60 * Render-To Texture surface (fbobject for OpenGL, texture with render-to |
63 * attribute for Direct3D) |
61 * attribute for Direct3D) |
64 */ |
62 */ |
65 public static final int RT_TEXTURE = 5; |
63 @Native public static final int RT_TEXTURE = 5; |
66 |
64 |
67 /** |
65 /** |
68 * Returns {@code int} representing surface's type as defined by constants |
66 * Returns {@code int} representing surface's type as defined by constants |
69 * in this interface. |
67 * in this interface. |
70 * |
68 * |