Skip to content

Commit c7c77eb

Browse files
committed
8354077: Get rid of offscreenSharingEnabled windows flag
Reviewed-by: prr
1 parent 4f58af0 commit c7c77eb

File tree

3 files changed

+4
-41
lines changed

3 files changed

+4
-41
lines changed

src/java.desktop/windows/classes/sun/java2d/windows/WindowsFlags.java

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -55,16 +55,6 @@ public class WindowsFlags {
5555
* This flag can force us to use d3d
5656
* anyway in these situations. Or, this flag can force us to
5757
* not use d3d in a situation where we would use it otherwise.
58-
* offscreenSharingEnabled: usage: "-Dsun.java2d.offscreenSharing=true"
59-
* Turns on the ability to share a hardware-accelerated
60-
* offscreen surface through the JAWT interface. See
61-
* src/windows/native/sun/windows/awt_DrawingSurface.* for
62-
* more information. This capability is disabled by default
63-
* pending more testing and time to work out the right
64-
* solution; we do not want to expose more public JAWT api
65-
* without being very sure that we will be willing to support
66-
* that API in the future regardless of other native
67-
* rendering pipeline changes.
6858
* magPresent: usage: "-Djavax.accessibility.screen_magnifier_present"
6959
* This flag is set either on the command line or in the
7060
* properties file. It tells Swing whether the user is
@@ -101,7 +91,6 @@ public class WindowsFlags {
10191
private static boolean d3dOnScreenEnabled;
10292
private static boolean oglEnabled;
10393
private static boolean oglVerbose;
104-
private static boolean offscreenSharingEnabled;
10594
private static boolean magPresent;
10695
private static boolean setHighDPIAware;
10796
// TODO: other flags, including nopixfmt
@@ -206,8 +195,6 @@ private static void initJavaFlags() {
206195
if (d3dSet) {
207196
d3dVerbose = isBooleanPropTrueVerbose("sun.java2d.d3d");
208197
}
209-
offscreenSharingEnabled =
210-
getBooleanProp("sun.java2d.offscreenSharing", false);
211198
String dpiOverride = System.getProperty("sun.java2d.dpiaware");
212199
if (dpiOverride != null) {
213200
setHighDPIAware = dpiOverride.equalsIgnoreCase("true");
@@ -217,16 +204,6 @@ private static void initJavaFlags() {
217204
setHighDPIAware =
218205
sunLauncherProperty.equalsIgnoreCase("SUN_STANDARD");
219206
}
220-
/*
221-
// Output info based on some non-default flags:
222-
if (offscreenSharingEnabled) {
223-
System.out.println(
224-
"Warning: offscreenSharing has been enabled. " +
225-
"The use of this capability will change in future " +
226-
"releases and applications that depend on it " +
227-
"may not work correctly");
228-
}
229-
*/
230207
/*
231208
System.out.println("WindowsFlags (Java):");
232209
System.out.println(" ddEnabled: " + ddEnabled + "\n" +
@@ -235,8 +212,7 @@ private static void initJavaFlags() {
235212
" d3dSet: " + d3dSet + "\n" +
236213
" oglEnabled: " + oglEnabled + "\n" +
237214
" oglVerbose: " + oglVerbose + "\n" +
238-
" gdiBlitEnabled: " + gdiBlitEnabled + "\n" +
239-
" offscreenSharingEnabled: " + offscreenSharingEnabled);
215+
" gdiBlitEnabled: " + gdiBlitEnabled);
240216
*/
241217
}
242218

@@ -260,10 +236,6 @@ public static boolean isGdiBlitEnabled() {
260236
return gdiBlitEnabled;
261237
}
262238

263-
public static boolean isOffscreenSharingEnabled() {
264-
return offscreenSharingEnabled;
265-
}
266-
267239
public static boolean isMagPresent() {
268240
return magPresent;
269241
}

src/java.desktop/windows/native/libawt/java2d/windows/WindowsFlags.cpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -30,7 +30,6 @@
3030
BOOL useD3D = TRUE; // d3d enabled flag
3131
// initially is TRUE to allow D3D preloading
3232
BOOL forceD3DUsage; // force d3d on or off
33-
jboolean g_offscreenSharing; // JAWT accelerated surface sharing
3433
BOOL setHighDPIAware; // Whether to set the high-DPI awareness flag
3534

3635
extern WCHAR *j2dAccelKey; // Name of java2d root key
@@ -89,10 +88,6 @@ void GetFlagValues(JNIEnv *env, jclass wFlagsClass)
8988
}
9089
useD3D = d3dEnabled;
9190
forceD3DUsage = d3dSet;
92-
g_offscreenSharing = GetStaticBoolean(env, wFlagsClass,
93-
"offscreenSharingEnabled");
94-
JNU_CHECK_EXCEPTION(env);
95-
9691
setHighDPIAware =
9792
(IS_WINVISTA && GetStaticBoolean(env, wFlagsClass, "setHighDPIAware"));
9893
JNU_CHECK_EXCEPTION(env);
@@ -102,8 +97,6 @@ void GetFlagValues(JNIEnv *env, jclass wFlagsClass)
10297
(useD3D ? "true" : "false"));
10398
J2dTraceLn1(J2D_TRACE_INFO, " d3dSet = %s",
10499
(forceD3DUsage ? "true" : "false"));
105-
J2dTraceLn1(J2D_TRACE_INFO, " offscreenSharing = %s",
106-
(g_offscreenSharing ? "true" : "false"));
107100
J2dTraceLn1(J2D_TRACE_INFO, " setHighDPIAware = %s",
108101
(setHighDPIAware ? "true" : "false"));
109102
}

src/java.desktop/windows/native/libawt/java2d/windows/WindowsFlags.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
21
/*
3-
* Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2003, 2025, Oracle and/or its affiliates. All rights reserved.
43
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
54
*
65
* This code is free software; you can redistribute it and/or modify it
@@ -29,7 +28,6 @@
2928

3029
extern BOOL useD3D; // d3d enabled flag
3130
extern BOOL forceD3DUsage; // force d3d on or off
32-
extern jboolean g_offscreenSharing; // JAWT accelerated surface sharing
3331
extern BOOL setHighDPIAware; // whether to set High DPI Aware flag on Vista
3432

3533
void SetD3DEnabledFlag(JNIEnv *env, BOOL d3dEnabled, BOOL d3dSet);

0 commit comments

Comments
 (0)