Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/openjdk-multiarch-jdk8u
Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/src/macosx/native_NOTIOS/sun/java2d/opengl/CGLGraphicsConfig.h
38829 views
1
/*
2
* Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
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
7
* published by the Free Software Foundation. Oracle designates this
8
* particular file as subject to the "Classpath" exception as provided
9
* by Oracle in the LICENSE file that accompanied this code.
10
*
11
* This code is distributed in the hope that it will be useful, but WITHOUT
12
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14
* version 2 for more details (a copy is included in the LICENSE file that
15
* accompanied this code).
16
*
17
* You should have received a copy of the GNU General Public License version
18
* 2 along with this work; if not, write to the Free Software Foundation,
19
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20
*
21
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22
* or visit www.oracle.com if you need additional information or have any
23
* questions.
24
*/
25
26
#ifndef CGLGraphicsConfig_h_Included
27
#define CGLGraphicsConfig_h_Included
28
29
#import "jni.h"
30
#import "J2D_GL/gl.h"
31
#import "OGLSurfaceData.h"
32
#import "OGLContext.h"
33
#import <Cocoa/Cocoa.h>
34
35
@interface GraphicsConfigUtil : NSObject {}
36
+ (void) _getCGLConfigInfo: (NSMutableArray *)argValue;
37
@end
38
39
// REMIND: Using an NSOpenGLPixelBuffer as the scratch surface has been
40
// problematic thus far (seeing garbage and flickering when switching
41
// between an NSView and the scratch surface), so the following enables
42
// an alternate codepath that uses a hidden NSWindow/NSView as the scratch
43
// surface, for the purposes of making a context current in certain
44
// situations. It appears that calling [NSOpenGLContext setView] too
45
// frequently contributes to the bad behavior, so we should try to avoid
46
// switching to the scratch surface whenever possible.
47
48
/* Do we need this if we are using all off-screen drawing ? */
49
#define USE_NSVIEW_FOR_SCRATCH 1
50
51
/* Uncomment to have an additional CAOGLLayer instance tied to
52
* each instance, which can be used to test remoting the layer
53
* to an out of process window. The additional layer is needed
54
* because a layer can only be attached to one context (view/window).
55
* This is only for testing purposes and can be removed if/when no
56
* longer needed.
57
*/
58
//#define REMOTELAYER 1
59
60
#ifdef REMOTELAYER
61
#import <JavaRuntimeSupport/JRSRemoteLayer.h>
62
#import <pthread.h>
63
#include <unistd.h>
64
#include <stdio.h>
65
#import <sys/socket.h>
66
#import <sys/un.h>
67
68
extern mach_port_t JRSRemotePort;
69
extern int remoteSocketFD;
70
extern void sendLayerID(int layerID);
71
72
#endif /* REMOTELAYER */
73
74
75
/**
76
* The CGLGraphicsConfigInfo structure contains information specific to a
77
* given CGLGraphicsConfig (pixel format).
78
*
79
* jint screen;
80
* The screen and PixelFormat for the associated CGLGraphicsConfig.
81
*
82
* NSOpenGLPixelFormat *pixfmt;
83
* The pixel format of the native NSOpenGL context.
84
*
85
* OGLContext *context;
86
* The context associated with this CGLGraphicsConfig.
87
*/
88
typedef struct _CGLGraphicsConfigInfo {
89
jint screen;
90
NSOpenGLPixelFormat *pixfmt;
91
OGLContext *context;
92
} CGLGraphicsConfigInfo;
93
94
/**
95
* The CGLCtxInfo structure contains the native CGLContext information
96
* required by and is encapsulated by the platform-independent OGLContext
97
* structure.
98
*
99
* NSOpenGLContext *context;
100
* The core native NSOpenGL context. Rendering commands have no effect until
101
* a context is made current (active).
102
*
103
* NSOpenGLPixelBuffer *scratchSurface;
104
* The scratch surface id used to make a context current when we do
105
* not otherwise have a reference to an OpenGL surface for the purposes of
106
* making a context current.
107
*/
108
typedef struct _CGLCtxInfo {
109
NSOpenGLContext *context;
110
#if USE_NSVIEW_FOR_SCRATCH
111
NSView *scratchSurface;
112
#else
113
NSOpenGLPixelBuffer *scratchSurface;
114
#endif
115
} CGLCtxInfo;
116
117
#endif /* CGLGraphicsConfig_h_Included */
118
119