src/java.desktop/windows/classes/sun/java2d/d3d/D3DGraphicsDevice.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 2007, 2014, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 2007, 2015, 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
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 35,44 ****
--- 35,47 ----
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.awt.peer.WindowPeer;
import java.util.ArrayList;
+
+ import sun.awt.AWTAccessor;
+ import sun.awt.AWTAccessor.ComponentAccessor;
import sun.awt.Win32GraphicsDevice;
import sun.awt.windows.WWindowPeer;
import sun.java2d.pipe.hw.ContextCapabilities;
import sun.java2d.windows.WindowsFlags;
import static sun.java2d.d3d.D3DContext.D3DContextCaps.*;
*** 174,188 ****
private boolean fsWindowWasAlwaysOnTop;
private static native boolean enterFullScreenExclusiveNative(int screen,
long hwnd);
@Override
- @SuppressWarnings("deprecation")
protected void enterFullScreenExclusive(final int screen, WindowPeer wp)
{
! final WWindowPeer wpeer = (WWindowPeer)realFSWindow.getPeer();
!
D3DRenderQueue rq = D3DRenderQueue.getInstance();
rq.lock();
try {
rq.flushAndInvokeNow(new Runnable() {
public void run() {
--- 177,190 ----
private boolean fsWindowWasAlwaysOnTop;
private static native boolean enterFullScreenExclusiveNative(int screen,
long hwnd);
@Override
protected void enterFullScreenExclusive(final int screen, WindowPeer wp)
{
! final WWindowPeer wpeer = AWTAccessor.getComponentAccessor()
! .getPeer(realFSWindow);
D3DRenderQueue rq = D3DRenderQueue.getInstance();
rq.lock();
try {
rq.flushAndInvokeNow(new Runnable() {
public void run() {
*** 245,264 ****
D3DRenderQueue.getInstance().restoreDevices();
}
}
@Override
- @SuppressWarnings("deprecation")
protected void addFSWindowListener(Window w) {
// if the window is not a toplevel (has an owner) we have to use the
// real toplevel to enter the full-screen mode with (4933099).
if (!(w instanceof Frame) && !(w instanceof Dialog) &&
(realFSWindow = getToplevelOwner(w)) != null)
{
ownerOrigBounds = realFSWindow.getBounds();
! WWindowPeer fp = (WWindowPeer)realFSWindow.getPeer();
!
ownerWasVisible = realFSWindow.isVisible();
Rectangle r = w.getBounds();
// we use operations on peer instead of component because calling
// them on component will take the tree lock
fp.reshape(r.x, r.y, r.width, r.height);
--- 247,265 ----
D3DRenderQueue.getInstance().restoreDevices();
}
}
@Override
protected void addFSWindowListener(Window w) {
// if the window is not a toplevel (has an owner) we have to use the
// real toplevel to enter the full-screen mode with (4933099).
+ final ComponentAccessor acc = AWTAccessor.getComponentAccessor();
if (!(w instanceof Frame) && !(w instanceof Dialog) &&
(realFSWindow = getToplevelOwner(w)) != null)
{
ownerOrigBounds = realFSWindow.getBounds();
! WWindowPeer fp = acc.getPeer(realFSWindow);
ownerWasVisible = realFSWindow.isVisible();
Rectangle r = w.getBounds();
// we use operations on peer instead of component because calling
// them on component will take the tree lock
fp.reshape(r.x, r.y, r.width, r.height);
*** 266,283 ****
} else {
realFSWindow = w;
}
fsWindowWasAlwaysOnTop = realFSWindow.isAlwaysOnTop();
! ((WWindowPeer)realFSWindow.getPeer()).setAlwaysOnTop(true);
fsWindowListener = new D3DFSWindowAdapter();
realFSWindow.addWindowListener(fsWindowListener);
}
@Override
- @SuppressWarnings("deprecation")
protected void removeFSWindowListener(Window w) {
realFSWindow.removeWindowListener(fsWindowListener);
fsWindowListener = null;
/**
--- 267,283 ----
} else {
realFSWindow = w;
}
fsWindowWasAlwaysOnTop = realFSWindow.isAlwaysOnTop();
! ((WWindowPeer) acc.getPeer(realFSWindow)).setAlwaysOnTop(true);
fsWindowListener = new D3DFSWindowAdapter();
realFSWindow.addWindowListener(fsWindowListener);
}
@Override
protected void removeFSWindowListener(Window w) {
realFSWindow.removeWindowListener(fsWindowListener);
fsWindowListener = null;
/**
*** 288,298 ****
* up getting resized during the fullscreen process. When we
* return from fullscreen mode, we should resize the Frame to
* its original size (just like the Window is being resized
* to its original size in GraphicsDevice).
*/
! WWindowPeer wpeer = (WWindowPeer)realFSWindow.getPeer();
if (wpeer != null) {
if (ownerOrigBounds != null) {
// if the window went into fs mode before it was realized it
// could have (0,0) dimensions
if (ownerOrigBounds.width == 0) ownerOrigBounds.width = 1;
--- 288,299 ----
* up getting resized during the fullscreen process. When we
* return from fullscreen mode, we should resize the Frame to
* its original size (just like the Window is being resized
* to its original size in GraphicsDevice).
*/
! final WWindowPeer wpeer = AWTAccessor.getComponentAccessor()
! .getPeer(realFSWindow);
if (wpeer != null) {
if (ownerOrigBounds != null) {
// if the window went into fs mode before it was realized it
// could have (0,0) dimensions
if (ownerOrigBounds.width == 0) ownerOrigBounds.width = 1;
*** 338,360 ****
private static native void configDisplayModeNative(int screen, long hwnd,
int width, int height,
int bitDepth,
int refreshRate);
@Override
- @SuppressWarnings("deprecation")
protected void configDisplayMode(final int screen, final WindowPeer w,
final int width, final int height,
final int bitDepth, final int refreshRate)
{
// we entered fs mode via gdi
if (!fsStatus) {
super.configDisplayMode(screen, w, width, height, bitDepth,
refreshRate);
return;
}
!
! final WWindowPeer wpeer = (WWindowPeer)realFSWindow.getPeer();
// REMIND: we do this before we switch the display mode, so
// the dimensions may be exceeding the dimensions of the screen,
// is this a problem?
--- 339,360 ----
private static native void configDisplayModeNative(int screen, long hwnd,
int width, int height,
int bitDepth,
int refreshRate);
@Override
protected void configDisplayMode(final int screen, final WindowPeer w,
final int width, final int height,
final int bitDepth, final int refreshRate)
{
// we entered fs mode via gdi
if (!fsStatus) {
super.configDisplayMode(screen, w, width, height, bitDepth,
refreshRate);
return;
}
! final WWindowPeer wpeer = AWTAccessor.getComponentAccessor()
! .getPeer(realFSWindow);
// REMIND: we do this before we switch the display mode, so
// the dimensions may be exceeding the dimensions of the screen,
// is this a problem?