Skip to content
Permalink
Browse files
8238075: [OGL] Delete unused properties
Reviewed-by: kizune
  • Loading branch information
mrserb committed Mar 12, 2020
1 parent afe70e6 commit 4f1fabd8d08581bc9e0c4b3cc7dffb7f7cc0d5c8
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -63,7 +63,7 @@

public CGraphicsDevice(final int displayID) {
this.displayID = displayID;
config = CGLGraphicsConfig.getConfig(this, displayID, 0);
config = CGLGraphicsConfig.getConfig(this);
// initializes default device state, might be redundant step since we
// call "displayChanged()" later anyway, but we do not want to leave the
// device in an inconsistent state after construction
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -64,13 +64,9 @@
public final class CGLGraphicsConfig extends CGraphicsConfig
implements OGLGraphicsConfig
{
//private static final int kOpenGLSwapInterval =
// RuntimeOptions.getCurrentOptions().OpenGLSwapInterval;
private static final int kOpenGLSwapInterval = 0; // TODO
private static boolean cglAvailable;
private static ImageCapabilities imageCaps = new CGLImageCaps();

private int pixfmt;
private BufferCapabilities bufferCaps;
private long pConfigInfo;
private ContextCapabilities oglCaps;
@@ -79,8 +75,7 @@
private final int maxTextureSize;

private static native boolean initCGL();
private static native long getCGLConfigInfo(int displayID, int visualnum,
int swapInterval);
private static native long getCGLConfigInfo();
private static native int getOGLCapabilities(long configInfo);

/**
@@ -95,12 +90,9 @@ private static native long getCGLConfigInfo(int displayID, int visualnum,
cglAvailable = initCGL();
}

private CGLGraphicsConfig(CGraphicsDevice device, int pixfmt,
long configInfo, int maxTextureSize,
ContextCapabilities oglCaps) {
private CGLGraphicsConfig(CGraphicsDevice device, long configInfo,
int maxTextureSize, ContextCapabilities oglCaps) {
super(device);

this.pixfmt = pixfmt;
this.pConfigInfo = configInfo;
this.oglCaps = oglCaps;
this.maxTextureSize = maxTextureSize;
@@ -125,8 +117,7 @@ public SurfaceData createManagedSurface(int w, int h, int transparency) {
OGLSurfaceData.TEXTURE);
}

public static CGLGraphicsConfig getConfig(CGraphicsDevice device,
int displayID, int pixfmt)
public static CGLGraphicsConfig getConfig(CGraphicsDevice device)
{
if (!cglAvailable) {
return null;
@@ -142,7 +133,7 @@ public static CGLGraphicsConfig getConfig(CGraphicsDevice device,
// surfaces/contexts, so we should first invalidate the current
// Java-level context and flush the queue...
OGLContext.invalidateCurrentContext();
cfginfo = getCGLConfigInfo(displayID, pixfmt, kOpenGLSwapInterval);
cfginfo = getCGLConfigInfo();
if (cfginfo != 0L) {
textureSize = nativeGetMaxTextureSize();
// 7160609: GL still fails to create a square texture of this
@@ -163,7 +154,7 @@ public static CGLGraphicsConfig getConfig(CGraphicsDevice device,

int oglCaps = getOGLCapabilities(cfginfo);
ContextCapabilities caps = new OGLContextCaps(oglCaps, ids[0]);
return new CGLGraphicsConfig(device, pixfmt, cfginfo, textureSize, caps);
return new CGLGraphicsConfig(device, cfginfo, textureSize, caps);
}

public static boolean isCGLAvailable() {
@@ -253,8 +244,7 @@ public synchronized void displayChanged() {

@Override
public String toString() {
String display = getDevice().getIDstring();
return ("CGLGraphicsConfig[" + display + ", pixfmt=" + pixfmt + "]");
return ("CGLGraphicsConfig[" + getDevice().getIDstring() + "]");
}

@Override
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -32,10 +32,6 @@
#import "OGLContext.h"
#import <Cocoa/Cocoa.h>

@interface GraphicsConfigUtil : NSObject {}
+ (void) _getCGLConfigInfo: (NSMutableArray *)argValue;
@end

// REMIND: Using an NSOpenGLPixelBuffer as the scratch surface has been
// problematic thus far (seeing garbage and flickering when switching
// between an NSView and the scratch surface), so the following enables
@@ -50,20 +46,12 @@

/**
* The CGLGraphicsConfigInfo structure contains information specific to a
* given CGLGraphicsConfig (pixel format).
*
* jint screen;
* The screen and PixelFormat for the associated CGLGraphicsConfig.
*
* NSOpenGLPixelFormat *pixfmt;
* The pixel format of the native NSOpenGL context.
* given CGLGraphicsConfig.
*
* OGLContext *context;
* The context associated with this CGLGraphicsConfig.
*/
typedef struct _CGLGraphicsConfigInfo {
jint screen;
NSOpenGLPixelFormat *pixfmt;
OGLContext *context;
} CGLGraphicsConfigInfo;

0 comments on commit 4f1fabd

Please sign in to comment.