mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-10 03:19:40 +01:00
Compare commits
16 Commits
jb17.0.9-b
...
nprovotoro
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a40a99e6c0 | ||
|
|
8e2db04c49 | ||
|
|
b508993b60 | ||
|
|
38b521feac | ||
|
|
f473fa15a1 | ||
|
|
5305726ece | ||
|
|
05a8ff9117 | ||
|
|
57c6cbe325 | ||
|
|
c5ba5ff4c8 | ||
|
|
95ada30c3f | ||
|
|
49b53da483 | ||
|
|
84c635c405 | ||
|
|
2be22e8578 | ||
|
|
74b52f068b | ||
|
|
98b3ac5221 | ||
|
|
5c7ffa6578 |
@@ -1,74 +0,0 @@
|
||||
#
|
||||
# Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
#
|
||||
# Redistribution and use in source and binary forms, with or without
|
||||
# modification, are permitted provided that the following conditions
|
||||
# are met:
|
||||
#
|
||||
# - Redistributions of source code must retain the above copyright
|
||||
# notice, this list of conditions and the following disclaimer.
|
||||
#
|
||||
# - Redistributions in binary form must reproduce the above copyright
|
||||
# notice, this list of conditions and the following disclaimer in the
|
||||
# documentation and/or other materials provided with the distribution.
|
||||
#
|
||||
# - Neither the name of Oracle nor the names of its
|
||||
# contributors may be used to endorse or promote products derived
|
||||
# from this software without specific prior written permission.
|
||||
#
|
||||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
# IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
# PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
# LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
# NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#
|
||||
|
||||
SOURCEPATH=src
|
||||
CLASSES=build
|
||||
DIST=dist
|
||||
RESOURCES=resources
|
||||
|
||||
RENDERPERF_CLASSES = $(CLASSES)/renderperf/RenderPerfTest.class
|
||||
RENDERPERF_SOURCES = $(SOURCEPATH)/renderperf/RenderPerfTest.java
|
||||
|
||||
RENDERPERF_RESOURCES = $(CLASSES)/renderperf/images/duke.png
|
||||
|
||||
all: mkdirs $(DIST)/RenderPerfTest.jar
|
||||
|
||||
run: mkdirs $(DIST)/RenderPerfTest.jar
|
||||
java -jar $(DIST)/RenderPerfTest.jar
|
||||
|
||||
$(DIST)/RenderPerfTest.jar: \
|
||||
$(RENDERPERF_CLASSES) $(RENDERPERF_RESOURCES) \
|
||||
$(CLASSES)/renderperf.manifest
|
||||
jar cvmf $(CLASSES)/renderperf.manifest $(DIST)/RenderPerfTest.jar -C $(CLASSES) .
|
||||
|
||||
|
||||
$(CLASSES)/renderperf/images/%: $(RESOURCES)/images/%
|
||||
cp -r $< $@
|
||||
|
||||
|
||||
$(CLASSES)/renderperf.manifest:
|
||||
echo "Main-Class: renderperf.RenderPerfTest" > $@
|
||||
|
||||
$(DIST):
|
||||
mkdir $(DIST)
|
||||
|
||||
$(CLASSES):
|
||||
mkdir $(CLASSES)
|
||||
mkdir -p $(CLASSES)/renderperf/images
|
||||
|
||||
mkdirs: $(DIST) $(CLASSES)
|
||||
|
||||
$(RENDERPERF_CLASSES): $(RENDERPERF_SOURCES)
|
||||
javac -g:none -d $(CLASSES) -sourcepath $(SOURCEPATH) $<
|
||||
|
||||
clean:
|
||||
rm -rf $(CLASSES)
|
||||
rm -rf $(DIST)
|
||||
@@ -1,34 +0,0 @@
|
||||
-----------------------------------------------------------------------
|
||||
Introduction
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
RenderPerfTest is a set of on-screen rendering microbenchmarks to
|
||||
analyze the performance of Java2D graphical primitives rendering
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
How To Compile
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
#> cd RenderPerfTest
|
||||
|
||||
The benchmark can be compiled by using either ant:
|
||||
|
||||
#> ant
|
||||
|
||||
or gnumake (assuming there's 'javac' in the path):
|
||||
|
||||
#> gnumake
|
||||
|
||||
The jar files will be generated into RenderPerfTest/dist directory.
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
How To Run RenderPerfTest
|
||||
-----------------------------------------------------------------------
|
||||
Run all tests
|
||||
#> ant run
|
||||
or
|
||||
#> java -jar dist/RenderPerfTest.jar
|
||||
|
||||
Run particular test cases
|
||||
|
||||
#> java -jar dist/RenderPerfTest.jar testWhiteTextBubblesGray ...
|
||||
@@ -1,94 +0,0 @@
|
||||
<!--
|
||||
Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name of Oracle nor the names of its
|
||||
contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
||||
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
-->
|
||||
|
||||
<project name="RenderPerfTest" default="dist" basedir=".">
|
||||
<description>
|
||||
simple example build file
|
||||
</description>
|
||||
<!-- set global properties for this build -->
|
||||
<property name="src" location="src"/>
|
||||
<property name="build" location="build"/>
|
||||
<property name="dist" location="dist"/>
|
||||
<property name="resources" location="resources"/>
|
||||
|
||||
<target name="init">
|
||||
<!-- Create the time stamp -->
|
||||
<tstamp/>
|
||||
<!-- Create the build directory structure used by compile -->
|
||||
<mkdir dir="${build}"/>
|
||||
</target>
|
||||
|
||||
<target name="compile" depends="init"
|
||||
description="compile the source " >
|
||||
<!-- Compile the java code from ${src} into ${build} -->
|
||||
<javac includeantruntime="false" debug="off" srcdir="${src}" destdir="${build}"/>
|
||||
</target>
|
||||
|
||||
<target name="run" depends="dist"
|
||||
description="run RenderPerfTest" >
|
||||
<java jar="${dist}/RenderPerfTest.jar"
|
||||
fork="true"
|
||||
>
|
||||
</java>
|
||||
</target>
|
||||
|
||||
<target name="resources" depends="init"
|
||||
description="copy resources into build dir" >
|
||||
<!-- Copy the resource files from ${resources} into ${build}/ -->
|
||||
<mkdir dir="${dist}"/>
|
||||
<mkdir dir="${dist}/renderperf"/>
|
||||
<mkdir dir="${build}/renderperf/images"/>
|
||||
<copy todir="${build}/renderperf/images">
|
||||
<fileset dir="resources/renderperf/images" />
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="dist" depends="compile, resources"
|
||||
description="generate the distribution" >
|
||||
<!-- Create the distribution directory -->
|
||||
<mkdir dir="${dist}"/>
|
||||
|
||||
<!-- Put everything in ${build} into the J2DBench.jar file -->
|
||||
<jar jarfile="${dist}/RenderPerfTest.jar" basedir="${build}">
|
||||
<manifest>
|
||||
<attribute name="Built-By" value="${user.name}"/>
|
||||
<attribute name="Main-Class" value="renderperf.RenderPerfTest"/>
|
||||
</manifest>
|
||||
</jar>
|
||||
</target>
|
||||
|
||||
<target name="clean"
|
||||
description="clean up" >
|
||||
<!-- Delete the ${build} and ${dist} directory trees -->
|
||||
<delete dir="${build}"/>
|
||||
<delete dir="${dist}"/>
|
||||
</target>
|
||||
</project>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 2.1 KiB |
@@ -1,739 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2019, 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
|
||||
* under the terms of the GNU General Public License version 2 only, as
|
||||
* published by the Free Software Foundation. Oracle designates this
|
||||
* particular file as subject to the "Classpath" exception as provided
|
||||
* by Oracle in the LICENSE file that accompanied this code.
|
||||
*
|
||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* version 2 for more details (a copy is included in the LICENSE file that
|
||||
* accompanied this code).
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License version
|
||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
*
|
||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
||||
* or visit www.oracle.com if you need additional information or have any
|
||||
* questions.
|
||||
*/
|
||||
|
||||
package renderperf;
|
||||
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.awt.geom.Point2D;
|
||||
import java.awt.geom.QuadCurve2D;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.HashSet;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
|
||||
public class RenderPerfTest {
|
||||
private static HashSet<String> ignoredTests = new HashSet<>();
|
||||
|
||||
private final static int N = 1000;
|
||||
private final static float WIDTH = 800;
|
||||
private final static float HEIGHT = 800;
|
||||
private final static float R = 25;
|
||||
private final static int BW = 50;
|
||||
private final static int BH = 50;
|
||||
private final static int COUNT = 300;
|
||||
private final static int DELAY = 10;
|
||||
private final static int RESOLUTION = 5;
|
||||
private final static int COLOR_TOLERANCE = 10;
|
||||
private final static int MAX_MEASURE_TIME = 5000;
|
||||
|
||||
|
||||
interface Configurable {
|
||||
void configure(Graphics2D g2d);
|
||||
}
|
||||
|
||||
interface Renderable {
|
||||
void setup(Graphics2D g2d);
|
||||
void render(Graphics2D g2d);
|
||||
void update();
|
||||
}
|
||||
|
||||
static class Particles {
|
||||
private float[] bx;
|
||||
private float[] by;
|
||||
private float[] vx;
|
||||
private float[] vy;
|
||||
private float r;
|
||||
private int n;
|
||||
|
||||
private float x0;
|
||||
private float y0;
|
||||
private float width;
|
||||
private float height;
|
||||
|
||||
Particles(int n, float r, float x0, float y0, float width, float height) {
|
||||
bx = new float[n];
|
||||
by = new float[n];
|
||||
vx = new float[n];
|
||||
vy = new float[n];
|
||||
this.n = n;
|
||||
this.r = r;
|
||||
this.x0 = x0;
|
||||
this.y0 = y0;
|
||||
this.width = width;
|
||||
this.height = height;
|
||||
for (int i = 0; i < n; i++) {
|
||||
bx[i] = (float) (x0 + r + 0.1 + Math.random() * (width - 2 * r - 0.2 - x0));
|
||||
by[i] = (float) (y0 + r + 0.1 + Math.random() * (height - 2 * r - 0.2 - y0));
|
||||
vx[i] = 0.1f * (float) (Math.random() * 2 * r - r);
|
||||
vy[i] = 0.1f * (float) (Math.random() * 2 * r - r);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void render(Graphics2D g2d, ParticleRenderer renderer) {
|
||||
for (int i = 0; i < n; i++) {
|
||||
renderer.render(g2d, i, bx, by, vx, vy);
|
||||
}
|
||||
}
|
||||
|
||||
void update() {
|
||||
for (int i = 0; i < n; i++) {
|
||||
bx[i] += vx[i];
|
||||
if (bx[i] + r > width || bx[i] - r < x0) vx[i] = -vx[i];
|
||||
by[i] += vy[i];
|
||||
if (by[i] + r > height || by[i] - r < y0) vy[i] = -vy[i];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ParticleRenderable createPR(ParticleRenderer renderer) {
|
||||
return new ParticleRenderable(renderer);
|
||||
}
|
||||
|
||||
static class ParticleRenderable implements Renderable {
|
||||
ParticleRenderer renderer;
|
||||
Configurable configure;
|
||||
|
||||
ParticleRenderable(ParticleRenderer renderer, Configurable configure) {
|
||||
this.renderer = renderer;
|
||||
this.configure = configure;
|
||||
}
|
||||
|
||||
ParticleRenderable(ParticleRenderer renderer) {
|
||||
this(renderer, null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setup(Graphics2D g2d) {
|
||||
if (configure != null) configure.configure(g2d);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Graphics2D g2d) {
|
||||
balls.render(g2d, renderer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
balls.update();
|
||||
}
|
||||
|
||||
public ParticleRenderable configure(Configurable configure) {
|
||||
this.configure = configure;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
interface ParticleRenderer {
|
||||
void render(Graphics2D g2d, int id, float[] x, float[] y, float[] vx, float[] vy);
|
||||
|
||||
}
|
||||
|
||||
static class FlatParticleRenderer implements ParticleRenderer {
|
||||
Color[] colors;
|
||||
float r;
|
||||
|
||||
FlatParticleRenderer(int n, float r) {
|
||||
colors = new Color[n];
|
||||
this.r = r;
|
||||
for (int i = 0; i < n; i++) {
|
||||
colors[i] = new Color((float) Math.random(),
|
||||
(float) Math.random(), (float) Math.random());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Graphics2D g2d, int id, float[] x, float[] y, float[] vx, float[] vy) {
|
||||
g2d.setColor(colors[id % colors.length]);
|
||||
g2d.fillOval((int)(x[id] - r), (int)(y[id] - r), (int)(2*r), (int)(2*r));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static class WhiteTextParticleRenderer implements ParticleRenderer {
|
||||
float r;
|
||||
|
||||
WhiteTextParticleRenderer(float r) {
|
||||
this.r = r;
|
||||
}
|
||||
|
||||
void setPaint(Graphics2D g2d, int id) {
|
||||
g2d.setColor(Color.WHITE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Graphics2D g2d, int id, float[] x, float[] y, float[] vx, float[] vy) {
|
||||
setPaint(g2d, id);
|
||||
g2d.drawString("The quick brown fox jumps over the lazy dog",
|
||||
(int)(x[id] - r), (int)(y[id] - r));
|
||||
g2d.drawString("The quick brown fox jumps over the lazy dog",
|
||||
(int)(x[id] - r), (int)y[id]);
|
||||
g2d.drawString("The quick brown fox jumps over the lazy dog",
|
||||
(int)(x[id] - r), (int)(y[id] + r));
|
||||
}
|
||||
}
|
||||
|
||||
static class TextParticleRenderer extends WhiteTextParticleRenderer {
|
||||
Color[] colors;
|
||||
|
||||
float r;
|
||||
|
||||
TextParticleRenderer(int n, float r) {
|
||||
super(r);
|
||||
colors = new Color[n];
|
||||
this.r = r;
|
||||
for (int i = 0; i < n; i++) {
|
||||
colors[i] = new Color((float) Math.random(),
|
||||
(float) Math.random(), (float) Math.random());
|
||||
}
|
||||
}
|
||||
|
||||
void setPaint(Graphics2D g2d, int id) {
|
||||
g2d.setColor(colors[id % colors.length]);
|
||||
}
|
||||
}
|
||||
|
||||
static class LargeTextParticleRenderer extends TextParticleRenderer {
|
||||
|
||||
LargeTextParticleRenderer(int n, float r) {
|
||||
super(n, r);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Graphics2D g2d, int id, float[] x, float[] y, float[] vx, float[] vy) {
|
||||
setPaint(g2d, id);
|
||||
Font font = new Font("LucidaGrande", Font.PLAIN, 32);
|
||||
g2d.setFont(font);
|
||||
g2d.drawString("The quick brown fox jumps over the lazy dog",
|
||||
(int)(x[id] - r), (int)(y[id] - r));
|
||||
g2d.drawString("The quick brown fox jumps over the lazy dog",
|
||||
(int)(x[id] - r), (int)y[id]);
|
||||
g2d.drawString("The quick brown fox jumps over the lazy dog",
|
||||
(int)(x[id] - r), (int)(y[id] + r));
|
||||
}
|
||||
}
|
||||
|
||||
static class FlatOvalRotParticleRenderer extends FlatParticleRenderer {
|
||||
|
||||
|
||||
FlatOvalRotParticleRenderer(int n, float r) {
|
||||
super(n, r);
|
||||
}
|
||||
|
||||
void setPaint(Graphics2D g2d, int id) {
|
||||
g2d.setColor(colors[id % colors.length]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Graphics2D g2d, int id, float[] x, float[] y, float[] vx, float[] vy) {
|
||||
setPaint(g2d, id);
|
||||
if (Math.abs(vx[id] + vy[id]) > 0.001) {
|
||||
AffineTransform t = (AffineTransform) g2d.getTransform().clone();
|
||||
double l = vx[id] / Math.sqrt(vx[id] * vx[id] + vy[id] * vy[id]);
|
||||
if (vy[id] < 0) {
|
||||
l = -l;
|
||||
}
|
||||
g2d.translate(x[id], y[id]);
|
||||
g2d.rotate(Math.acos(l));
|
||||
g2d.fillOval(-(int)r, (int)(-0.5*r), (int) (2 * r), (int)r);
|
||||
g2d.setTransform(t);
|
||||
} else {
|
||||
g2d.fillOval((int)(x[id] - r), (int)(y[id] - 0.5*r),
|
||||
(int) (2 * r), (int) r);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static class LinGradOvalRotParticleRenderer extends FlatOvalRotParticleRenderer {
|
||||
|
||||
|
||||
LinGradOvalRotParticleRenderer(int n, float r) {
|
||||
super(n, r);
|
||||
}
|
||||
|
||||
@Override
|
||||
void setPaint(Graphics2D g2d, int id) {
|
||||
Point2D start = new Point2D.Double(- r, - 0.5*r);
|
||||
Point2D end = new Point2D.Double( 2 * r, r);
|
||||
float[] dist = {0.0f, 1.0f};
|
||||
Color[] cls = {colors[id %colors.length], colors[(colors.length - id) %colors.length]};
|
||||
LinearGradientPaint p =
|
||||
new LinearGradientPaint(start, end, dist, cls);
|
||||
g2d.setPaint(p);
|
||||
}
|
||||
}
|
||||
|
||||
static class FlatBoxParticleRenderer extends FlatParticleRenderer {
|
||||
|
||||
|
||||
FlatBoxParticleRenderer(int n, float r) {
|
||||
super(n, r);
|
||||
}
|
||||
@Override
|
||||
public void render(Graphics2D g2d, int id, float[] x, float[] y, float[] vx, float[] vy) {
|
||||
g2d.setColor(colors[id % colors.length]);
|
||||
g2d.fillRect((int)(x[id] - r), (int)(y[id] - r), (int)(2*r), (int)(2*r));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static class ImgParticleRenderer extends FlatParticleRenderer {
|
||||
BufferedImage dukeImg;
|
||||
|
||||
ImgParticleRenderer(int n, float r) {
|
||||
super(n, r);
|
||||
try {
|
||||
dukeImg = ImageIO.read(
|
||||
Objects.requireNonNull(
|
||||
RenderPerfTest.class.getClassLoader().getResourceAsStream(
|
||||
"renderperf/images/duke.png")));
|
||||
} catch (IOException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Graphics2D g2d, int id, float[] x, float[] y, float[] vx, float[] vy) {
|
||||
g2d.setColor(colors[id % colors.length]);
|
||||
g2d.drawImage(dukeImg, (int)(x[id] - r), (int)(y[id] - r), (int)(2*r), (int)(2*r), null);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static class FlatBoxRotParticleRenderer extends FlatParticleRenderer {
|
||||
|
||||
|
||||
FlatBoxRotParticleRenderer(int n, float r) {
|
||||
super(n, r);
|
||||
}
|
||||
@Override
|
||||
public void render(Graphics2D g2d, int id, float[] x, float[] y, float[] vx, float[] vy) {
|
||||
g2d.setColor(colors[id % colors.length]);
|
||||
if (Math.abs(vx[id] + vy[id]) > 0.001) {
|
||||
AffineTransform t = (AffineTransform) g2d.getTransform().clone();
|
||||
double l = vx[id] / Math.sqrt(vx[id] * vx[id] + vy[id] * vy[id]);
|
||||
if (vy[id] < 0) {
|
||||
l = -l;
|
||||
}
|
||||
g2d.translate(x[id], y[id]);
|
||||
g2d.rotate(Math.acos(l));
|
||||
g2d.fillRect(-(int)r, -(int)r, (int) (2 * r), (int) (2 * r));
|
||||
g2d.setTransform(t);
|
||||
} else {
|
||||
g2d.fillRect((int)(x[id] - r), (int)(y[id] - r),
|
||||
(int) (2 * r), (int) (2 * r));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static class WiredParticleRenderer extends FlatParticleRenderer {
|
||||
|
||||
|
||||
WiredParticleRenderer(int n, float r) {
|
||||
super(n, r);
|
||||
}
|
||||
@Override
|
||||
public void render(Graphics2D g2d, int id, float[] x, float[] y, float[] vx, float[] vy) {
|
||||
g2d.setColor(colors[id % colors.length]);
|
||||
g2d.drawOval((int)(x[id] - r), (int)(y[id] - r), (int)(2*r), (int)(2*r));
|
||||
}
|
||||
|
||||
}
|
||||
static class WiredBoxParticleRenderer extends FlatParticleRenderer {
|
||||
|
||||
WiredBoxParticleRenderer(int n, float r) {
|
||||
super(n, r);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Graphics2D g2d, int id, float[] x, float[] y, float[] vx, float[] vy) {
|
||||
g2d.setColor(colors[id % colors.length]);
|
||||
g2d.drawRect((int)(x[id] - r), (int)(y[id] - r), (int)(2*r), (int)(2*r));
|
||||
}
|
||||
|
||||
}
|
||||
static class SegParticleRenderer extends FlatParticleRenderer {
|
||||
|
||||
SegParticleRenderer(int n, float r) {
|
||||
super(n, r);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Graphics2D g2d, int id, float[] x, float[] y, float[] vx, float[] vy) {
|
||||
double v = Math.sqrt(vx[id]*vx[id]+vy[id]*vy[id]);
|
||||
float nvx = (float) (vx[id]/v);
|
||||
float nvy = (float) (vy[id]/v);
|
||||
g2d.setColor(colors[id % colors.length]);
|
||||
g2d.drawLine((int)(x[id] - r*nvx), (int)(y[id] - r*nvy),
|
||||
(int)(x[id] + 2*r*nvx), (int)(y[id] + 2*r*nvy));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
static class WiredQuadParticleRenderer extends FlatParticleRenderer {
|
||||
|
||||
WiredQuadParticleRenderer(int n, float r) {
|
||||
super(n, r);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Graphics2D g2d, int id, float[] x, float[] y, float[] vx, float[] vy) {
|
||||
if (id > 2 && (id % 3) == 0) {
|
||||
g2d.setColor(colors[id % colors.length]);
|
||||
g2d.draw(new QuadCurve2D.Float(x[id-3], y[id-3], x[id-2], y[id-2], x[id-1], y[id-1]));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
static class FlatQuadParticleRenderer extends FlatParticleRenderer {
|
||||
|
||||
FlatQuadParticleRenderer(int n, float r) {
|
||||
super(n, r);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Graphics2D g2d, int id, float[] x, float[] y, float[] vx, float[] vy) {
|
||||
if (id > 2 && (id % 3) == 0) {
|
||||
g2d.setColor(colors[id % colors.length]);
|
||||
g2d.fill(new QuadCurve2D.Float(x[id-3], y[id-3], x[id-2], y[id-2], x[id-1], y[id-1]));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
static class PerfMeter {
|
||||
private String name;
|
||||
private int frame = 0;
|
||||
|
||||
private JPanel panel;
|
||||
|
||||
private long time;
|
||||
private double execTime = 0;
|
||||
private Color expColor = Color.RED;
|
||||
AtomicBoolean waiting = new AtomicBoolean(false);
|
||||
private double fps;
|
||||
|
||||
PerfMeter(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
PerfMeter exec(final Renderable renderable) throws Exception {
|
||||
final CountDownLatch latch = new CountDownLatch(COUNT);
|
||||
final CountDownLatch latchFrame = new CountDownLatch(1);
|
||||
final long endTime = System.currentTimeMillis() + MAX_MEASURE_TIME;
|
||||
|
||||
final JFrame f = new JFrame();
|
||||
f.addWindowListener(new WindowAdapter() {
|
||||
@Override
|
||||
public void windowClosed(WindowEvent e) {
|
||||
latchFrame.countDown();
|
||||
}
|
||||
});
|
||||
|
||||
SwingUtilities.invokeAndWait(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
panel = new JPanel()
|
||||
{
|
||||
@Override
|
||||
protected void paintComponent(Graphics g) {
|
||||
|
||||
super.paintComponent(g);
|
||||
time = System.nanoTime();
|
||||
Graphics2D g2d = (Graphics2D) g.create();
|
||||
renderable.setup(g2d);
|
||||
renderable.render(g2d);
|
||||
g2d.setColor(expColor);
|
||||
g.fillRect(0, 0, BW, BH);
|
||||
}
|
||||
};
|
||||
|
||||
panel.setPreferredSize(new Dimension((int)(WIDTH + BW), (int)(HEIGHT + BH)));
|
||||
panel.setBackground(Color.BLACK);
|
||||
f.add(panel);
|
||||
f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
|
||||
f.pack();
|
||||
f.setVisible(true);
|
||||
}
|
||||
});
|
||||
Robot robot = new Robot();
|
||||
|
||||
Timer timer = new Timer(DELAY, e -> {
|
||||
|
||||
if (waiting.compareAndSet(false, true)) {
|
||||
Color c = robot.getPixelColor(
|
||||
panel.getTopLevelAncestor().getX() + panel.getTopLevelAncestor().getInsets().left + BW / 2,
|
||||
panel.getTopLevelAncestor().getY() + panel.getTopLevelAncestor().getInsets().top + BW / 2);
|
||||
if (isAlmostEqual(c, Color.BLUE)) {
|
||||
expColor = Color.RED;
|
||||
} else {
|
||||
expColor = Color.BLUE;
|
||||
}
|
||||
renderable.update();
|
||||
panel.getParent().repaint();
|
||||
|
||||
} else {
|
||||
while (!isAlmostEqual(
|
||||
robot.getPixelColor(
|
||||
panel.getTopLevelAncestor().getX() + panel.getTopLevelAncestor().getInsets().left + BW/2,
|
||||
panel.getTopLevelAncestor().getY() + panel.getTopLevelAncestor().getInsets().top + BH/2),
|
||||
expColor))
|
||||
{
|
||||
try {
|
||||
Thread.sleep(RESOLUTION);
|
||||
} catch (InterruptedException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
time = System.nanoTime() - time;
|
||||
execTime += time;
|
||||
frame++;
|
||||
waiting.set(false);
|
||||
}
|
||||
|
||||
if (System.currentTimeMillis() < endTime) {
|
||||
latch.countDown();
|
||||
} else {
|
||||
while(latch.getCount() > 0) latch.countDown();
|
||||
}
|
||||
});
|
||||
timer.start();
|
||||
latch.await();
|
||||
SwingUtilities.invokeAndWait(() -> {
|
||||
timer.stop();
|
||||
f.setVisible(false);
|
||||
f.dispose();
|
||||
});
|
||||
|
||||
latchFrame.await();
|
||||
if (execTime != 0 && frame != 0) {
|
||||
fps = 1e9 / (execTime / frame);
|
||||
} else {
|
||||
fps = 0;
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
private void report() {
|
||||
System.err.println(name + " : " + String.format("%.2f FPS", fps));
|
||||
}
|
||||
|
||||
private boolean isAlmostEqual(Color c1, Color c2) {
|
||||
return Math.abs(c1.getRed() - c2.getRed()) < COLOR_TOLERANCE ||
|
||||
Math.abs(c1.getGreen() - c2.getGreen()) < COLOR_TOLERANCE ||
|
||||
Math.abs(c1.getBlue() - c2.getBlue()) < COLOR_TOLERANCE;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private static final Particles balls = new Particles(N, R, BW, BH, WIDTH, HEIGHT);
|
||||
private static final ParticleRenderer flatRenderer = new FlatParticleRenderer(N, R);
|
||||
private static final ParticleRenderer flatOvalRotRenderer = new FlatOvalRotParticleRenderer(N, R);
|
||||
private static final ParticleRenderer flatBoxRenderer = new FlatBoxParticleRenderer(N, R);
|
||||
private static final ParticleRenderer flatBoxRotRenderer = new FlatBoxRotParticleRenderer(N, R);
|
||||
private static final ParticleRenderer linGradOvalRotRenderer = new LinGradOvalRotParticleRenderer(N, R);
|
||||
private static final ParticleRenderer wiredRenderer = new WiredParticleRenderer(N, R);
|
||||
private static final ParticleRenderer wiredBoxRenderer = new WiredBoxParticleRenderer(N, R);
|
||||
private static final ParticleRenderer segRenderer = new SegParticleRenderer(N, R);
|
||||
private static final ParticleRenderer flatQuadRenderer = new FlatQuadParticleRenderer(N, R);
|
||||
private static final ParticleRenderer wiredQuadRenderer = new WiredQuadParticleRenderer(N, R);
|
||||
private static final ParticleRenderer imgRenderer = new ImgParticleRenderer(N, R);
|
||||
private static final ParticleRenderer textRenderer = new TextParticleRenderer(N, R);
|
||||
private static final ParticleRenderer largeTextRenderer = new LargeTextParticleRenderer(N, R);
|
||||
private static final ParticleRenderer whiteTextRenderer = new WhiteTextParticleRenderer(R);
|
||||
|
||||
private static final Configurable AA = (Graphics2D g2d) ->
|
||||
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
|
||||
RenderingHints.VALUE_ANTIALIAS_ON);
|
||||
|
||||
private static final Configurable TextLCD = (Graphics2D g2d) ->
|
||||
g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
|
||||
RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB);
|
||||
|
||||
private static final Configurable TextAA = (Graphics2D g2d) ->
|
||||
g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
|
||||
RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
|
||||
|
||||
public void testFlatBubbles() throws Exception {
|
||||
(new PerfMeter("FlatOval")).exec(createPR(flatRenderer)).report();
|
||||
}
|
||||
|
||||
public void testFlatBubblesAA() throws Exception {
|
||||
(new PerfMeter("FlatOvalAA")).exec(createPR(flatRenderer).configure(AA)).report();
|
||||
}
|
||||
|
||||
public void testFlatBoxBubbles() throws Exception {
|
||||
(new PerfMeter("FlatBox")).exec(createPR(flatBoxRenderer)).report();
|
||||
}
|
||||
|
||||
public void testFlatBoxBubblesAA() throws Exception {
|
||||
(new PerfMeter("FlatBoxAA")).exec(createPR(flatBoxRenderer).configure(AA)).report();
|
||||
}
|
||||
|
||||
public void testImgBubbles() throws Exception {
|
||||
(new PerfMeter("Image")).exec(createPR(imgRenderer)).report();
|
||||
}
|
||||
|
||||
public void testImgBubblesAA() throws Exception {
|
||||
(new PerfMeter("ImageAA")).exec(createPR(imgRenderer).configure(AA)).report();
|
||||
}
|
||||
|
||||
public void testFlatBoxRotBubbles() throws Exception {
|
||||
(new PerfMeter("RotatedBox")).exec(createPR(flatBoxRotRenderer)).report();
|
||||
}
|
||||
|
||||
public void testFlatBoxRotBubblesAA() throws Exception {
|
||||
(new PerfMeter("RotatedBoxAA")).exec(createPR(flatBoxRotRenderer).configure(AA)).report();
|
||||
}
|
||||
|
||||
public void testFlatOvalRotBubbles() throws Exception {
|
||||
(new PerfMeter("RotatedOval")).exec(createPR(flatOvalRotRenderer)).report();
|
||||
}
|
||||
|
||||
public void testFlatOvalRotBubblesAA() throws Exception {
|
||||
(new PerfMeter("RotatedOvalAA")).exec(createPR(flatOvalRotRenderer).configure(AA)).report();
|
||||
}
|
||||
|
||||
public void testLinGradOvalRotBubbles() throws Exception {
|
||||
(new PerfMeter("LinGradRotatedOval")).exec(createPR(linGradOvalRotRenderer)).report();
|
||||
}
|
||||
|
||||
public void testLinGradOvalRotBubblesAA() throws Exception {
|
||||
(new PerfMeter("LinGradRotatedOvalAA")).exec(createPR(linGradOvalRotRenderer).configure(AA)).report();
|
||||
}
|
||||
|
||||
public void testWiredBubbles() throws Exception {
|
||||
(new PerfMeter("WiredBubbles")).exec(createPR(wiredRenderer)).report();
|
||||
}
|
||||
|
||||
public void testWiredBubblesAA() throws Exception {
|
||||
(new PerfMeter("WiredBubblesAA")).exec(createPR(wiredRenderer).configure(AA)).report();
|
||||
}
|
||||
|
||||
public void testWiredBoxBubbles() throws Exception {
|
||||
(new PerfMeter("WiredBox")).exec(createPR(wiredBoxRenderer)).report();
|
||||
}
|
||||
|
||||
public void testWiredBoxBubblesAA() throws Exception {
|
||||
(new PerfMeter("WiredBoxAA")).exec(createPR(wiredBoxRenderer).configure(AA)).report();
|
||||
}
|
||||
|
||||
public void testLines() throws Exception {
|
||||
(new PerfMeter("Lines")).exec(createPR(segRenderer)).report();
|
||||
}
|
||||
|
||||
public void testLinesAA() throws Exception {
|
||||
(new PerfMeter("LinesAA")).exec(createPR(segRenderer).configure(AA)).report();
|
||||
}
|
||||
|
||||
public void testFlatQuad() throws Exception {
|
||||
(new PerfMeter("FlatQuad")).exec(createPR(flatQuadRenderer)).report();
|
||||
}
|
||||
|
||||
public void testFlatQuadAA() throws Exception {
|
||||
(new PerfMeter("FlatQuadAA")).exec(createPR(flatQuadRenderer).configure(AA)).report();
|
||||
}
|
||||
|
||||
public void testWiredQuad() throws Exception {
|
||||
(new PerfMeter("WiredQuad")).exec(createPR(wiredQuadRenderer)).report();
|
||||
}
|
||||
|
||||
public void testWiredQuadAA() throws Exception {
|
||||
(new PerfMeter("WiredQuadAA")).exec(createPR(wiredQuadRenderer).configure(AA)).report();
|
||||
}
|
||||
|
||||
public void testTextBubblesNoAA() throws Exception {
|
||||
(new PerfMeter("TextNoAA")).exec(createPR(textRenderer)).report();
|
||||
}
|
||||
|
||||
public void testTextBubblesLCD() throws Exception {
|
||||
(new PerfMeter("TextLCD")).exec(createPR(textRenderer).configure(TextLCD)).report();
|
||||
}
|
||||
|
||||
public void testTextBubblesGray() throws Exception {
|
||||
(new PerfMeter("TextGray")).exec(createPR(textRenderer).configure(TextAA)).report();
|
||||
}
|
||||
|
||||
public void testLargeTextBubblesNoAA() throws Exception {
|
||||
(new PerfMeter("LargeTextNoAA")).exec(createPR(largeTextRenderer)).report();
|
||||
}
|
||||
|
||||
public void testLargeTextBubblesLCD() throws Exception {
|
||||
(new PerfMeter("LargeTextLCD")).exec(createPR(largeTextRenderer).configure(TextLCD)).report();
|
||||
}
|
||||
|
||||
public void testLargeTextBubblesGray() throws Exception {
|
||||
(new PerfMeter("LargeTextGray")).exec(createPR(largeTextRenderer).configure(TextAA)).report();
|
||||
}
|
||||
public void testWhiteTextBubblesNoAA() throws Exception {
|
||||
(new PerfMeter("WhiteTextNoAA")).exec(createPR(whiteTextRenderer)).report();
|
||||
}
|
||||
|
||||
public void testWhiteTextBubblesLCD() throws Exception {
|
||||
(new PerfMeter("WhiteTextLCD")).exec(createPR(whiteTextRenderer).configure(TextLCD)).report();
|
||||
}
|
||||
|
||||
public void testWhiteTextBubblesGray() throws Exception {
|
||||
(new PerfMeter("WhiteTextGray")).exec(createPR(whiteTextRenderer).configure(TextAA)).report();
|
||||
}
|
||||
|
||||
public static void main(String[] args)
|
||||
throws InvocationTargetException, IllegalAccessException, NoSuchMethodException
|
||||
{
|
||||
RenderPerfTest test = new RenderPerfTest();
|
||||
|
||||
if (args.length > 0) {
|
||||
for (String testCase : args) {
|
||||
Method m = RenderPerfTest.class.getDeclaredMethod(testCase);
|
||||
m.invoke(test);
|
||||
}
|
||||
} else {
|
||||
Method[] methods = RenderPerfTest.class.getDeclaredMethods();
|
||||
for (Method m : methods) {
|
||||
if (m.getName().startsWith("test") && !ignoredTests.contains(m.getName())) {
|
||||
m.invoke(test);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -640,4 +640,30 @@ public abstract class MTLSurfaceData extends SurfaceData
|
||||
rq.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads native image raster into surface.
|
||||
*
|
||||
* @param pRaster native pointer image raster with 8-bit RGBA color components packed into integer pixels.
|
||||
* Note: The color data in this image is considered to be premultiplied with alpha.
|
||||
* @param width width of image in pixels
|
||||
* @param height height of image in pixels
|
||||
* @param pRects native pointer to array of "dirty" rects, each rect is a sequence of four 32-bit integers: x, y, width, heigth
|
||||
* Note: can be null (then whole image used)
|
||||
* @param rectsCount count of "dirty" rects (if 0 then whole image used)
|
||||
*/
|
||||
@Override
|
||||
protected void loadNativeRaster(long pRaster, int width, int height, long pRects, int rectsCount) {
|
||||
MTLRenderQueue rq = MTLRenderQueue.getInstance();
|
||||
rq.lock();
|
||||
try {
|
||||
MTLContext.setScratchSurface(getMTLGraphicsConfig());
|
||||
rq.flushAndInvokeNow(() -> loadNativeRasterWithRects(getNativeOps(), pRaster, width, height, pRects, rectsCount));
|
||||
} finally {
|
||||
rq.unlock();
|
||||
}
|
||||
markDirty();
|
||||
}
|
||||
|
||||
private static native boolean loadNativeRasterWithRects(long sdops, long pRaster, int width, int height, long pRects, int rectsCount);
|
||||
}
|
||||
|
||||
@@ -235,6 +235,8 @@ public class CInputMethod extends InputMethodAdapter {
|
||||
*/
|
||||
public void activate() {
|
||||
isActive = true;
|
||||
|
||||
enableListening(true);
|
||||
}
|
||||
|
||||
public void deactivate(boolean isTemporary) {
|
||||
@@ -267,6 +269,7 @@ public class CInputMethod extends InputMethodAdapter {
|
||||
if (fAwtFocussedComponentPeer != null) {
|
||||
long modelPtr = getNativeViewPtr(fAwtFocussedComponentPeer);
|
||||
nativeEndComposition(modelPtr, fAwtFocussedComponent);
|
||||
nativeEnableListening(modelPtr, false);
|
||||
nativeNotifyPeer(modelPtr, null);
|
||||
}
|
||||
|
||||
@@ -309,6 +312,11 @@ public class CInputMethod extends InputMethodAdapter {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void stopListening() {
|
||||
enableListening(false);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see java.awt.Toolkit#mapInputMethodHighlight
|
||||
*/
|
||||
@@ -414,6 +422,16 @@ public class CInputMethod extends InputMethodAdapter {
|
||||
return null;
|
||||
}
|
||||
|
||||
private void enableListening(boolean enable) {
|
||||
if (fAwtFocussedComponentPeer != null) {
|
||||
final long modelPtr = getNativeViewPtr(fAwtFocussedComponentPeer);
|
||||
|
||||
if (modelPtr != 0) {
|
||||
nativeEnableListening(modelPtr, enable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// =========================== NSTextInput callbacks ===========================
|
||||
// The 'marked text' that we get from Cocoa. We need to track this separately, since
|
||||
// Java doesn't let us ask the IM context for it.
|
||||
@@ -810,6 +828,13 @@ public class CInputMethod extends InputMethodAdapter {
|
||||
private native void nativeEndComposition(long nativePeer, Component component);
|
||||
private native void nativeHandleEvent(LWComponentPeer<?, ?> peer, AWTEvent event);
|
||||
|
||||
/*
|
||||
* Passing false to the second parameter disables any interaction with
|
||||
* the AppKit text input management subsystem (i.e. input methods, dead keys, maybe smth else)
|
||||
* Passing true there enables it back
|
||||
*/
|
||||
private native void nativeEnableListening(long nativePeerTarget, boolean enable);
|
||||
|
||||
// Returns the locale of the active input method.
|
||||
static native Locale getNativeLocale();
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
|
||||
// Input method data
|
||||
jobject fInputMethodLOCKABLE;
|
||||
BOOL fInputMethodInteractionEnabled;
|
||||
BOOL fKeyEventsNeeded;
|
||||
BOOL fProcessingKeystroke;
|
||||
NSString* actualCharacters;
|
||||
@@ -68,5 +69,6 @@
|
||||
// Input method-related events
|
||||
- (void)setInputMethod:(jobject)inputMethod;
|
||||
- (void)abandonInput:(jobject) component;
|
||||
- (void)enableImInteraction:(BOOL)enabled;
|
||||
|
||||
@end
|
||||
|
||||
@@ -85,6 +85,7 @@ extern bool isSystemShortcut_NextWindowInApplication(NSUInteger modifiersMask, i
|
||||
|
||||
m_cPlatformView = cPlatformView;
|
||||
fInputMethodLOCKABLE = NULL;
|
||||
fInputMethodInteractionEnabled = YES;
|
||||
fKeyEventsNeeded = NO;
|
||||
fProcessingKeystroke = NO;
|
||||
|
||||
@@ -366,7 +367,9 @@ static void debugPrintNSEvent(NSEvent* event, const char* comment) {
|
||||
NSString *eventCharacters = [event characters];
|
||||
|
||||
// Allow TSM to look at the event and potentially send back NSTextInputClient messages.
|
||||
[self interpretKeyEvents:[NSArray arrayWithObject:event]];
|
||||
if (fInputMethodInteractionEnabled == YES) {
|
||||
[self interpretKeyEvents:[NSArray arrayWithObject:event]];
|
||||
}
|
||||
|
||||
if (fEnablePressAndHold && [event willBeHandledByComplexInputMethod] &&
|
||||
fInputMethodLOCKABLE)
|
||||
@@ -1577,6 +1580,17 @@ static jclass jc_CInputMethod = NULL;
|
||||
[self unmarkText:component];
|
||||
}
|
||||
|
||||
-(void)enableImInteraction:(BOOL)enabled
|
||||
{
|
||||
#ifdef IM_DEBUG
|
||||
fprintf(stderr, "AWTView InputMethod Selector Called : [enableImInteraction:%d]\n", enabled);
|
||||
#endif // IM_DEBUG
|
||||
|
||||
AWT_ASSERT_APPKIT_THREAD;
|
||||
|
||||
fInputMethodInteractionEnabled = (enabled == YES) ? YES : NO;
|
||||
}
|
||||
|
||||
/******************************** END NSTextInputClient Protocol ********************************/
|
||||
|
||||
- (void)viewDidChangeBackingProperties {
|
||||
|
||||
@@ -2694,6 +2694,7 @@ void enableFullScreenSpecial(NSWindow *nsWindow) {
|
||||
[nsWindow encodeRestorableStateWithCoder:coder];
|
||||
[coder encodeBool:YES forKey:@"NSIsFullScreen"];
|
||||
NSKeyedUnarchiver *decoder = [[NSKeyedUnarchiver alloc] initForReadingWithData:coder.encodedData];
|
||||
decoder.requiresSecureCoding = YES;
|
||||
[nsWindow restoreStateWithCoder:decoder];
|
||||
[decoder finishDecoding];
|
||||
[decoder release];
|
||||
@@ -2940,6 +2941,7 @@ JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CPlatformWindow_nativeSetRoundedCor
|
||||
w.contentView.wantsLayer = YES;
|
||||
w.contentView.layer.cornerRadius = radius;
|
||||
w.contentView.layer.masksToBounds = YES;
|
||||
w.contentView.layer.opaque = NO;
|
||||
|
||||
if (borderWidth > 0) {
|
||||
CGFloat alpha = (((borderRgb >> 24) & 0xff) / 255.0);
|
||||
|
||||
@@ -199,6 +199,30 @@ JNI_COCOA_ENTER(env);
|
||||
JNI_COCOA_EXIT(env);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: sun_lwawt_macosx_CInputMethod
|
||||
* Method: nativeEnableListening
|
||||
* Signature: (JZ)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL Java_sun_lwawt_macosx_CInputMethod_nativeEnableListening
|
||||
(JNIEnv *env, jobject this, jlong nativePeer, jboolean enable)
|
||||
{
|
||||
|
||||
JNI_COCOA_ENTER(env);
|
||||
|
||||
AWTView * const view = (AWTView *)jlong_to_ptr(nativePeer);
|
||||
if (view == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
[ThreadUtilities performOnMainThreadWaiting:NO block:^(){
|
||||
[view enableImInteraction:(enable == JNI_TRUE ? YES : NO)];
|
||||
}];
|
||||
|
||||
JNI_COCOA_EXIT(env);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: sun_lwawt_macosx_CInputMethod
|
||||
* Method: getNativeLocale
|
||||
|
||||
@@ -240,6 +240,23 @@ replaceTextureRegion(MTLContext *mtlc, id<MTLTexture> dest, const SurfaceDataRas
|
||||
}
|
||||
}
|
||||
|
||||
void replaceTexture(MTLContext *mtlc, id<MTLTexture> dest, void* pRaster, int width, int height, int dx1, int dy1, int dx2, int dy2) {
|
||||
MTLRasterFormatInfo rfi = RasterFormatInfos[0];
|
||||
|
||||
SurfaceDataRasInfo srcInfo;
|
||||
memset(&srcInfo, 0, sizeof(SurfaceDataRasInfo));
|
||||
srcInfo.bounds.x1 = dx1;
|
||||
srcInfo.bounds.y1 = dy1;
|
||||
srcInfo.bounds.x2 = dx2;
|
||||
srcInfo.bounds.y2 = dy2;
|
||||
srcInfo.scanStride = width*4;
|
||||
srcInfo.pixelStride = 4;
|
||||
srcInfo.rasBase = pRaster;
|
||||
srcInfo.pixelBitOffset = 0;
|
||||
|
||||
replaceTextureRegion(mtlc, dest, &srcInfo, &rfi, dx1, dy1, dx2, dy2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Inner loop used for copying a source system memory ("Sw") surface to a
|
||||
* destination MTL "Surface". This method is invoked from
|
||||
|
||||
@@ -348,6 +348,8 @@ Java_sun_java2d_metal_MTLSurfaceData_initOps
|
||||
}
|
||||
}
|
||||
|
||||
extern void replaceTexture(MTLContext *mtlc, id<MTLTexture> dest, void* pRaster, int width, int height, int dx1, int dy1, int dx2, int dy2);
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_sun_java2d_metal_MTLSurfaceData_clearWindow
|
||||
(JNIEnv *env, jobject mtlsd)
|
||||
@@ -362,6 +364,43 @@ Java_sun_java2d_metal_MTLSurfaceData_clearWindow
|
||||
mtlsdo->layer = NULL;
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_sun_java2d_metal_MTLSurfaceData_loadNativeRasterWithRects
|
||||
(JNIEnv *env, jclass clazz,
|
||||
jlong sdops, jlong pRaster, jint width, jint height, jlong pRects, jint rectsCount)
|
||||
{
|
||||
BMTLSDOps *dstOps = (BMTLSDOps *)jlong_to_ptr(sdops);
|
||||
if (dstOps == NULL || pRaster == 0) {
|
||||
J2dRlsTraceLn(J2D_TRACE_ERROR, "MTLSurfaceData_loadNativeRasterWithRects: params are null");
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
id<MTLTexture> dest = dstOps->pTexture;
|
||||
if (dest == NULL) {
|
||||
J2dTraceLn(J2D_TRACE_ERROR, "MTLSurfaceData_loadNativeRasterWithRects: dest is null");
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
MTLSDOps *dstMTLOps = (MTLSDOps *)dstOps->privOps;
|
||||
MTLContext *ctx = dstMTLOps->configInfo->context;
|
||||
if (pRects == 0 || rectsCount < 1) {
|
||||
J2dTraceLn(J2D_TRACE_VERBOSE, "MTLSurfaceData_loadNativeRasterWithRects: do full copy of raster:");
|
||||
replaceTexture(ctx, dest, (void*)pRaster, (int)width, (int)height, 0, 0, (int)width, (int)height);
|
||||
} else {
|
||||
int32_t *pr = (int32_t *) pRects;
|
||||
for (int c = 0; c < rectsCount; ++c) {
|
||||
int32_t x = *(pr++);
|
||||
int32_t y = *(pr++);
|
||||
int32_t w = *(pr++);
|
||||
int32_t h = *(pr++);
|
||||
//fprintf(stderr, "MTLSurfaceData_loadNativeRasterWithRects: process rect %d %d %d %d\n", x, y, w, h);
|
||||
replaceTexture(ctx, dest, (void*)pRaster, (int)width, (int)height, x, y, x + w, y + h);
|
||||
}
|
||||
}
|
||||
|
||||
return JNI_TRUE;
|
||||
}
|
||||
|
||||
NSString * getSurfaceDescription(const BMTLSDOps * bmtlsdOps) {
|
||||
if (bmtlsdOps == NULL)
|
||||
return @"NULL";
|
||||
|
||||
@@ -63,6 +63,9 @@ public class JBRApiModule {
|
||||
.withStatic("getFeaturesAsString", "getFeaturesAsString", "com.jetbrains.desktop.FontExtensions")
|
||||
.clientProxy("java.awt.Font$Features", "com.jetbrains.FontExtensions$Features")
|
||||
.service("com.jetbrains.WindowMove", "java.awt.Window$WindowMoveService")
|
||||
.service("com.jetbrains.NativeRasterLoader")
|
||||
.withStatic("loadNativeRaster", "loadNativeRaster", "com.jetbrains.desktop.NativeRasterLoader")
|
||||
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.jetbrains.desktop;
|
||||
|
||||
import sun.awt.image.SunVolatileImage;
|
||||
|
||||
import java.awt.image.VolatileImage;
|
||||
|
||||
class NativeRasterLoader {
|
||||
/**
|
||||
* Loads native image raster into VolatileImage
|
||||
*
|
||||
* @param pRaster native pointer image raster with 8-bit RGBA color components packed into integer pixels.
|
||||
* Note: The color data in this image is considered to be premultiplied with alpha.
|
||||
* @param width width of image in pixels
|
||||
* @param height height of image in pixels
|
||||
* @param pRects native pointer to array of "dirty" rects, each rect is a sequence of four 32-bit integers: x, y, width, heigth
|
||||
* Note: can be null (then whole image used)
|
||||
* @param rectsCount count of "dirty" rects (if 0 then whole image used)
|
||||
*/
|
||||
static void loadNativeRaster(VolatileImage vi, long pRaster, int width, int height, long pRects, int rectsCount) {
|
||||
if (!(vi instanceof SunVolatileImage)) {
|
||||
System.err.printf("Unsupported type of VolatileImage: %s\n", vi);
|
||||
return;
|
||||
}
|
||||
|
||||
SunVolatileImage svi = (SunVolatileImage)vi;
|
||||
sun.java2d.NativeRasterLoader.loadNativeRaster(svi.getDestSurface(), pRaster, width, height, pRects, rectsCount);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package sun.java2d;
|
||||
|
||||
public class NativeRasterLoader {
|
||||
/**
|
||||
* Loads native image raster into surface.
|
||||
*
|
||||
* @param pRaster native pointer image raster with 8-bit RGBA color components packed into integer pixels.
|
||||
* Note: The color data in this image is considered to be premultiplied with alpha.
|
||||
* @param width width of image in pixels
|
||||
* @param height height of image in pixels
|
||||
* @param pRects native pointer to array of "dirty" rects, each rect is a sequence of four 32-bit integers: x, y, width, heigth
|
||||
* Note: can be null (then whole image used)
|
||||
* @param rectsCount count of "dirty" rects (if 0 then whole image used)
|
||||
*/
|
||||
public static void loadNativeRaster(Surface surface, long pRaster, int width, int height, long pRects, int rectsCount) {
|
||||
if (surface instanceof SurfaceData) {
|
||||
SurfaceData sd = (SurfaceData)surface;
|
||||
sd.loadNativeRaster(pRaster, width, height, pRects, rectsCount);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1091,4 +1091,19 @@ public abstract class SurfaceData
|
||||
public double getDefaultScaleY() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads native image raster into surface.
|
||||
*
|
||||
* @param pRaster native pointer image raster with 8-bit RGBA color components packed into integer pixels.
|
||||
* Note: The color data in this image is considered to be premultiplied with alpha.
|
||||
* @param width width of image in pixels
|
||||
* @param height height of image in pixels
|
||||
* @param pRects native pointer to array of "dirty" rects, each rect is a sequence of four 32-bit integers: x, y, width, heigth
|
||||
* Note: can be null (then whole image used)
|
||||
* @param rectsCount count of "dirty" rects (if 0 then whole image used)
|
||||
*/
|
||||
protected void loadNativeRaster(long pRaster, int width, int height, long pRects, int rectsCount) {
|
||||
System.err.println("ERROR: loadNativeRaster must be overriden.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -654,4 +654,30 @@ public abstract class OGLSurfaceData extends SurfaceData
|
||||
boolean isOnScreen() {
|
||||
return getType() == WINDOW;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads native image raster into surface.
|
||||
*
|
||||
* @param pRaster native pointer image raster with 8-bit RGBA color components packed into integer pixels.
|
||||
* Note: The color data in this image is considered to be premultiplied with alpha.
|
||||
* @param width width of image in pixels
|
||||
* @param height height of image in pixels
|
||||
* @param pRects native pointer to array of "dirty" rects, each rect is a sequence of four 32-bit integers: x, y, width, heigth
|
||||
* Note: can be null (then whole image used)
|
||||
* @param rectsCount count of "dirty" rects (if 0 then whole image used)
|
||||
*/
|
||||
@Override
|
||||
protected void loadNativeRaster(long pRaster, int width, int height, long pRects, int rectsCount) {
|
||||
OGLRenderQueue rq = OGLRenderQueue.getInstance();
|
||||
rq.lock();
|
||||
try {
|
||||
OGLContext.setScratchSurface(getOGLGraphicsConfig());
|
||||
rq.flushAndInvokeNow(() -> loadNativeRasterWithRects(getNativeOps(), pRaster, width, height, pRects, rectsCount));
|
||||
} finally {
|
||||
rq.unlock();
|
||||
}
|
||||
markDirty();
|
||||
}
|
||||
|
||||
private static native boolean loadNativeRasterWithRects(long sdops, long pRaster, int width, int height, long pRects, int rectsCount);
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,4 +1,6 @@
|
||||
Copyright (c) 2016 The Inter Project Authors (https://github.com/rsms/inter)
|
||||
Copyright (c) 2016-2020 The Inter Project Authors.
|
||||
"Inter" is trademark of Rasmus Andersson.
|
||||
https://github.com/rsms/inter
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
|
||||
@@ -238,6 +238,44 @@ OGLBlitSwToSurface(OGLContext *oglc, SurfaceDataRasInfo *srcInfo,
|
||||
}
|
||||
}
|
||||
|
||||
void OGLBlitRasterToSurface(OGLSDOps *dstOps, jlong pRaster, jint width, jint height,
|
||||
OGLPixelFormat *pf,
|
||||
jint sx1, jint sy1, jint sx2, jint sy2,
|
||||
jdouble dx1, jdouble dy1, jdouble dx2, jdouble dy2) {
|
||||
SurfaceDataRasInfo srcInfo;
|
||||
memset(&srcInfo, 0, sizeof(SurfaceDataRasInfo));
|
||||
srcInfo.bounds.x1 = 0;
|
||||
srcInfo.bounds.y1 = 0;
|
||||
srcInfo.bounds.x2 = width;
|
||||
srcInfo.bounds.y2 = height;
|
||||
srcInfo.scanStride = width*4;
|
||||
srcInfo.pixelStride = 4;
|
||||
srcInfo.rasBase = (void*)pRaster;
|
||||
srcInfo.pixelBitOffset = 0;
|
||||
|
||||
unsigned char * r = (unsigned char *)pRaster;
|
||||
//fprintf(stderr, "OGLBlitRasterToSurface:%d,%d,%d,%d,%d,%d,%d,%d....\n", r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7]);
|
||||
|
||||
if (dstOps->drawableType == OGLSD_FBOBJECT) {
|
||||
// Note that we unbind the currently bound texture first; this is
|
||||
// recommended procedure when binding an fbobject
|
||||
j2d_glBindTexture(dstOps->textureTarget, 0);
|
||||
j2d_glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, dstOps->fbobjectID);
|
||||
} else {
|
||||
J2dRlsTraceLn1(J2D_TRACE_ERROR, "Unsupported drawable type %d.", dstOps->drawableType);
|
||||
}
|
||||
|
||||
j2d_glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0);
|
||||
j2d_glPixelStorei(GL_UNPACK_SKIP_ROWS, 0);
|
||||
j2d_glPixelStorei(GL_UNPACK_ROW_LENGTH, srcInfo.scanStride / srcInfo.pixelStride);
|
||||
j2d_glPixelStorei(GL_UNPACK_ALIGNMENT, pf->alignment);
|
||||
|
||||
OGLBlitSwToSurface(OGLRenderQueue_GetCurrentContext(), &srcInfo, pf, sx1, sy1, sx2, sy2, dx1, dy1, dx2, dy2);
|
||||
|
||||
j2d_glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
|
||||
j2d_glPixelStorei(GL_UNPACK_ALIGNMENT, 4);
|
||||
}
|
||||
|
||||
/**
|
||||
* Inner loop used for copying a source system memory ("Sw") surface or
|
||||
* OpenGL "Surface" to a destination OpenGL "Surface", using an OpenGL texture
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#ifndef HEADLESS
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "sun_java2d_opengl_OGLSurfaceData.h"
|
||||
|
||||
@@ -41,6 +42,10 @@ extern jboolean OGLSD_InitOGLWindow(JNIEnv *env, OGLSDOps *oglsdo);
|
||||
extern void OGLSD_DestroyOGLSurface(JNIEnv *env, OGLSDOps *oglsdo);
|
||||
|
||||
void OGLSD_SetNativeDimensions(JNIEnv *env, OGLSDOps *oglsdo, jint w, jint h);
|
||||
extern void OGLBlitRasterToSurface(OGLSDOps *dstOps, jlong pRaster, jint width, jint height,
|
||||
OGLPixelFormat *pf,
|
||||
jint sx1, jint sy1, jint sx2, jint sy2,
|
||||
jdouble dx1, jdouble dy1, jdouble dx2, jdouble dy2);
|
||||
|
||||
/**
|
||||
* This table contains the "pixel formats" for all system memory surfaces
|
||||
@@ -526,6 +531,74 @@ Java_sun_java2d_opengl_OGLSurfaceData_getTextureID
|
||||
return (jint)oglsdo->textureID;
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_sun_java2d_opengl_OGLSurfaceData_loadNativeRasterWithRects
|
||||
(JNIEnv *env, jclass clazz,
|
||||
jlong sdops, jlong pRaster, jint width, jint height, jlong pRects, jint rectsCount)
|
||||
{
|
||||
OGLSDOps *oglsdo = (OGLSDOps *)jlong_to_ptr(sdops);
|
||||
if (oglsdo == NULL || pRaster == 0) {
|
||||
J2dRlsTraceLn(J2D_TRACE_ERROR, "OGLSurfaceData_loadNativeRasterWithRects: params are null");
|
||||
return JNI_FALSE;
|
||||
}
|
||||
//fprintf(stderr, "OGLSurfaceData_loadNativeRasterWithRects: ops=%p r=%p rCount=%d tt=%d texId=%d\n", (void*)sdops, (void*)pRaster, rectsCount, oglsdo->textureTarget, oglsdo->textureID);
|
||||
|
||||
// Set state.
|
||||
OGLPixelFormat pf = PixelFormats[1];
|
||||
const int viaTexSubImage = oglsdo->drawableType != OGLSD_FBOBJECT;
|
||||
// NOTE: both types works correctly under OSX (probably need to choose the fastest one)
|
||||
if (viaTexSubImage) {
|
||||
J2dTraceLn(J2D_TRACE_VERBOSE, "OGLSurfaceData_loadNativeRasterWithRects: via glTexSubImage2D");
|
||||
j2d_glEnable(GL_TEXTURE_2D);
|
||||
j2d_glPixelStorei(GL_UNPACK_ROW_LENGTH, width);
|
||||
j2d_glBindTexture(GL_TEXTURE_2D, oglsdo->textureID);
|
||||
} else {
|
||||
J2dTraceLn(J2D_TRACE_VERBOSE, "OGLSurfaceData_loadNativeRasterWithRects: via glDrawPix (i.e. OGLBlitSwToSurface)");
|
||||
}
|
||||
|
||||
// Render.
|
||||
if (pRects == 0 || rectsCount < 1) {
|
||||
J2dTraceLn(J2D_TRACE_VERBOSE, "OGLSurfaceData_loadNativeRasterWithRects: do full copy of raster:");
|
||||
//unsigned char * r = (unsigned char *)pRaster;
|
||||
//fprintf(stderr, "\t %d,%d,%d,%d,%d,%d,%d,%d....\n", r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7]);
|
||||
if (viaTexSubImage) {
|
||||
j2d_glTexSubImage2D(oglsdo->textureTarget, 0,
|
||||
0, 0, width, height,
|
||||
pf.format, pf.type, (GLvoid*)pRaster);
|
||||
} else {
|
||||
OGLBlitRasterToSurface(oglsdo, pRaster, width, height, &pf,
|
||||
0, 0, width, height,
|
||||
0, 0, width, height); }
|
||||
} else {
|
||||
int32_t *pr = (int32_t *) pRects;
|
||||
for (int c = 0; c < rectsCount; ++c) {
|
||||
int32_t x = *(pr++);
|
||||
int32_t y = *(pr++);
|
||||
int32_t w = *(pr++);
|
||||
int32_t h = *(pr++);
|
||||
if (viaTexSubImage) {
|
||||
const GLvoid *srcBytes = (char *)pRaster + y*width*4 + x*4;
|
||||
//fprintf(stderr, "\t[%d, %d, %d, %d] %d\n", x, y, w, h, (int)((char*)srcBytes - (char*)pRaster));
|
||||
j2d_glTexSubImage2D(oglsdo->textureTarget, 0,
|
||||
x, y, w, h,
|
||||
pf.format, pf.type, srcBytes);
|
||||
} else {
|
||||
OGLBlitRasterToSurface(oglsdo, pRaster, width, height, &pf,
|
||||
x, y, x + w, y + h,
|
||||
x, y, x + w, y + h);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Restore state.
|
||||
if (viaTexSubImage) {
|
||||
j2d_glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
|
||||
}
|
||||
|
||||
return JNI_TRUE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initializes nativeWidth/Height fields of the surfaceData object with
|
||||
* passed arguments.
|
||||
|
||||
@@ -874,33 +874,28 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
||||
|
||||
updateChildrenSizes();
|
||||
|
||||
WindowLocation newLocation = getNewLocation(xe);
|
||||
Dimension newDimension = new Dimension(xe.get_width(), xe.get_height());
|
||||
WindowLocation eventLocation = getNewLocation(xe);
|
||||
Dimension eventDimension = new Dimension(xe.get_width(), xe.get_height());
|
||||
boolean xinerama = XToolkit.localEnv.runningXinerama();
|
||||
|
||||
SunToolkit.executeOnEventHandlerThread(target, () -> {
|
||||
Point newUserLocation = newLocation.getUserLocation();
|
||||
WindowDimensions newDimensions = new WindowDimensions(newUserLocation,
|
||||
new Dimension(scaleDown(newDimension.width), scaleDown(newDimension.height)), getRealInsets(), true);
|
||||
|
||||
Point oldLocation = getLocation();
|
||||
Dimension newSize = xinerama
|
||||
? checkIfOnNewScreen(new Rectangle(eventLocation.getDeviceLocation(), eventDimension))
|
||||
: new Dimension(scaleDown(eventDimension.width), scaleDown(eventDimension.height));
|
||||
Point newUserLocation = eventLocation.getUserLocation();
|
||||
WindowDimensions newDimensions = new WindowDimensions(newUserLocation, newSize, getRealInsets(), true);
|
||||
if (insLog.isLoggable(PlatformLogger.Level.FINER)) {
|
||||
insLog.finer("Insets are {0}, new dimensions {1}",
|
||||
getRealInsets(), newDimensions);
|
||||
}
|
||||
|
||||
Point oldLocation = getLocation();
|
||||
dimensions = newDimensions;
|
||||
if (!newUserLocation.equals(oldLocation)) {
|
||||
handleMoved(newDimensions);
|
||||
}
|
||||
reconfigureContentWindow(newDimensions);
|
||||
updateChildrenSizes();
|
||||
|
||||
repositionSecurityWarning();
|
||||
|
||||
if (xinerama) {
|
||||
checkIfOnNewScreen(new Rectangle(newLocation.getDeviceLocation(), newDimension));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1444,20 +1439,23 @@ abstract class XDecoratedPeer extends XWindowPeer {
|
||||
if (r.width <= ins.left + ins.right || r.height <= ins.top + ins.bottom) {
|
||||
return;
|
||||
}
|
||||
if (syncSizeOnly && dimensions != null) {
|
||||
dimensions.setSize(r.width, r.height);
|
||||
dimensions.setInsets(ins);
|
||||
boolean isMaximized = target instanceof Frame f && (f.getExtendedState() & Frame.MAXIMIZED_BOTH) != 0;
|
||||
// When a window is maximized, affirming its size through an explicit request to the X server
|
||||
// may make the window fullscreen, which has undesirable consequences. Also, when a window
|
||||
// already has the maximized attributes, it is already properly sized, so no need to
|
||||
// resize explicitly.
|
||||
if (!isMaximized) {
|
||||
xSetSize(r.width, r.height);
|
||||
|
||||
if (XWindowPeer.RESIZE_WITH_SCALE) {
|
||||
if (syncSizeOnly && dimensions != null) {
|
||||
dimensions.setSize(r.width, r.height);
|
||||
dimensions.setInsets(ins);
|
||||
boolean isMaximized = target instanceof Frame f && (f.getExtendedState() & Frame.MAXIMIZED_BOTH) != 0;
|
||||
// When a window is maximized, affirming its size through an explicit request to the X server
|
||||
// may make the window fullscreen, which has undesirable consequences. Also, when a window
|
||||
// already has the maximized attributes, it is already properly sized, so no need to
|
||||
// resize explicitly.
|
||||
if (!isMaximized) {
|
||||
xSetSize(r.width, r.height);
|
||||
}
|
||||
} else {
|
||||
dimensions = new WindowDimensions(r, ins, false);
|
||||
xSetBounds(r.x, r.y, r.width, r.height);
|
||||
}
|
||||
} else {
|
||||
dimensions = new WindowDimensions(r, ins, false);
|
||||
xSetBounds(r.x, r.y, r.width, r.height);
|
||||
}
|
||||
reconfigureContentWindow(dimensions);
|
||||
doValidateSurface();
|
||||
|
||||
@@ -143,21 +143,24 @@ public class XEmbeddedFramePeer extends XFramePeer {
|
||||
xembedLog.fine(xe.toString());
|
||||
}
|
||||
|
||||
WindowLocation newLocation = getNewLocation(xe);
|
||||
Dimension newDimension = new Dimension(xe.get_width(), xe.get_height());
|
||||
WindowLocation eventLocation = getNewLocation(xe);
|
||||
Dimension eventDimension = new Dimension(xe.get_width(), xe.get_height());
|
||||
boolean xinerama = XToolkit.localEnv.runningXinerama();
|
||||
// fix for 5063031
|
||||
// if we use super.handleConfigureNotifyEvent() we would get wrong
|
||||
// size and position because embedded frame really is NOT a decorated one
|
||||
SunToolkit.executeOnEventHandlerThread(target, () -> {
|
||||
Point newUserLocation = newLocation.getUserLocation();
|
||||
Point newUserLocation = eventLocation.getUserLocation();
|
||||
Rectangle oldBounds = getBounds();
|
||||
Dimension newSize = xinerama
|
||||
? checkIfOnNewScreen(new Rectangle(eventLocation.getDeviceLocation(), eventDimension))
|
||||
: new Dimension(scaleDown(eventDimension.width), scaleDown(eventDimension.height));
|
||||
|
||||
synchronized (getStateLock()) {
|
||||
x = newUserLocation.x;
|
||||
y = newUserLocation.y;
|
||||
width = scaleDown(newDimension.width);
|
||||
height = scaleDown(newDimension.height);
|
||||
width = newSize.width;
|
||||
height = newSize.height;
|
||||
|
||||
dimensions.setClientSize(width, height);
|
||||
dimensions.setLocation(x, y);
|
||||
@@ -167,10 +170,6 @@ public class XEmbeddedFramePeer extends XFramePeer {
|
||||
handleMoved(dimensions);
|
||||
}
|
||||
reconfigureContentWindow(dimensions);
|
||||
|
||||
if (xinerama) {
|
||||
checkIfOnNewScreen(new Rectangle(newLocation.getDeviceLocation(), newDimension));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1203,15 +1203,25 @@ public final class XToolkit extends UNIXToolkit implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
private final Hashtable<GraphicsConfiguration, Insets> cachedInsets = new Hashtable<>();
|
||||
private final Map<GraphicsConfiguration, Insets> cachedInsets = new HashMap<>();
|
||||
private void resetScreenInsetsCache() {
|
||||
cachedInsets.clear();
|
||||
XToolkit.awtLock();
|
||||
try {
|
||||
cachedInsets.clear();
|
||||
} finally {
|
||||
XToolkit.awtUnlock();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Insets getScreenInsets(final GraphicsConfiguration gc) {
|
||||
if (useCachedInsets) {
|
||||
return (Insets)cachedInsets.computeIfAbsent(gc, this::getScreenInsetsImpl).clone();
|
||||
XToolkit.awtLock();
|
||||
try {
|
||||
return (Insets) cachedInsets.computeIfAbsent(gc, this::getScreenInsetsImpl).clone();
|
||||
} finally {
|
||||
XToolkit.awtUnlock();
|
||||
}
|
||||
} else {
|
||||
return getScreenInsetsImpl(gc);
|
||||
}
|
||||
|
||||
@@ -66,6 +66,8 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
||||
= "true".equals(GetPropertyAction.privilegedGetProperty("transients.desktop.check", "true"));
|
||||
static final boolean FULL_MODAL_TRANSIENTS_CHAIN
|
||||
= "true".equals(GetPropertyAction.privilegedGetProperty("full.modal.transients.chain"));
|
||||
static final boolean RESIZE_WITH_SCALE
|
||||
= "true".equals(GetPropertyAction.privilegedGetProperty("resize.with.scale", "false"));
|
||||
|
||||
// should be synchronized on awtLock
|
||||
private static Set<XWindowPeer> windows = new HashSet<XWindowPeer>();
|
||||
@@ -659,8 +661,9 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
||||
* called to check if we've been moved onto a different screen
|
||||
* Based on checkNewXineramaScreen() in awt_GraphicsEnv.c
|
||||
* newBounds are specified in device space.
|
||||
* Returns the corrected dimension of this window.
|
||||
*/
|
||||
public boolean checkIfOnNewScreen(Rectangle newBounds) {
|
||||
public Dimension checkIfOnNewScreen(Rectangle newBounds) {
|
||||
if (log.isLoggable(PlatformLogger.Level.FINEST)) {
|
||||
log.finest("XWindowPeer: Check if we've been moved to a new screen since we're running in Xinerama mode");
|
||||
}
|
||||
@@ -669,7 +672,7 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
||||
int curScreenNum = ((X11GraphicsDevice)getGraphicsConfiguration().getDevice()).getScreen();
|
||||
int newScreenNum = curScreenNum;
|
||||
GraphicsDevice[] gds = XToolkit.localEnv.getScreenDevices();
|
||||
GraphicsConfiguration newGC = null;
|
||||
GraphicsConfiguration newGC = getGraphicsConfiguration();
|
||||
|
||||
for (int i = 0; i < gds.length; i++) {
|
||||
X11GraphicsDevice device = (X11GraphicsDevice) gds[i];
|
||||
@@ -689,38 +692,47 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
||||
}
|
||||
}
|
||||
}
|
||||
// Ensure that after window will be moved to another monitor and (probably)
|
||||
// resized as a result, majority of its area will stay on the new monitor
|
||||
if (newScreenNum != curScreenNum) {
|
||||
X11GraphicsDevice device = (X11GraphicsDevice) gds[newScreenNum];
|
||||
Rectangle screenBounds = newGC.getBounds();
|
||||
// Rescale screen size to native unscaled coordinates
|
||||
screenBounds.width = device.scaleUp(screenBounds.width);
|
||||
screenBounds.height = device.scaleUp(screenBounds.height);
|
||||
// Rescale window to new screen's scale
|
||||
newBounds.width = newBounds.width * device.getScaleFactor() / graphicsConfig.getScale();
|
||||
newBounds.height = newBounds.height * device.getScaleFactor() / graphicsConfig.getScale();
|
||||
|
||||
Rectangle intersection = screenBounds.intersection(newBounds);
|
||||
if (intersection.isEmpty() ||
|
||||
intersection.width * intersection.height <= newBounds.width * newBounds.height / 2) {
|
||||
newScreenNum = curScreenNum; // Don't move to new screen
|
||||
Rectangle newScaledBounds = newBounds.getBounds();
|
||||
if (XWindowPeer.RESIZE_WITH_SCALE) {
|
||||
// Try to guess that after the window has been moved to another monitor and (probably)
|
||||
// resized as a result, the majority of its area will still be on that new monitor.
|
||||
// This is a guess since we cannot predict the result of the resize operation where
|
||||
// the window manager has the final say.
|
||||
boolean isMaximized = target instanceof Frame f && (f.getExtendedState() & Frame.MAXIMIZED_BOTH) != 0;
|
||||
if (newScreenNum != curScreenNum && !isMaximized) {
|
||||
X11GraphicsDevice device = (X11GraphicsDevice) gds[newScreenNum];
|
||||
Rectangle screenBounds = newGC.getBounds();
|
||||
// Rescale screen size to native unscaled coordinates
|
||||
screenBounds.width = device.scaleUp(screenBounds.width);
|
||||
screenBounds.height = device.scaleUp(screenBounds.height);
|
||||
// Rescale window to new screen's scale
|
||||
newScaledBounds.width = newBounds.width * device.getScaleFactor() / graphicsConfig.getScale();
|
||||
newScaledBounds.height = newBounds.height * device.getScaleFactor() / graphicsConfig.getScale();
|
||||
Rectangle intersection = screenBounds.intersection(newScaledBounds);
|
||||
if (intersection.isEmpty() ||
|
||||
intersection.width * intersection.height <= newScaledBounds.width * newScaledBounds.height / 2) {
|
||||
newScreenNum = curScreenNum; // Don't move to the new screen
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var device = (X11GraphicsDevice) newGC.getDevice();
|
||||
Dimension newSize = newScaledBounds.getSize();
|
||||
newSize.width = device.scaleDown(newSize.width);
|
||||
newSize.height = device.scaleDown(newSize.height);
|
||||
if (newScreenNum != curScreenNum) {
|
||||
if (log.isLoggable(PlatformLogger.Level.FINEST)) {
|
||||
log.finest("XWindowPeer: Moved to a new screen");
|
||||
}
|
||||
var gc = newGC;
|
||||
var device = (X11GraphicsDevice) gc.getDevice();
|
||||
var acc = AWTAccessor.getComponentAccessor();
|
||||
syncSizeOnly = true;
|
||||
acc.setSize(target, device.scaleDown(newBounds.width), device.scaleDown(newBounds.height));
|
||||
acc.setGraphicsConfiguration(target, gc);
|
||||
acc.setSize(target, newSize.width, newSize.height);
|
||||
acc.setGraphicsConfiguration(target, newGC);
|
||||
syncSizeOnly = false;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
||||
return newSize;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -854,18 +866,20 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
||||
insLog.fine(xe.toString());
|
||||
}
|
||||
|
||||
WindowLocation newLocation = getNewLocation(xe);
|
||||
Dimension newDimension = new Dimension(xe.get_width(), xe.get_height());
|
||||
WindowLocation eventLocation = getNewLocation(xe);
|
||||
Dimension eventDimension = new Dimension(xe.get_width(), xe.get_height());
|
||||
boolean xinerama = XToolkit.localEnv.runningXinerama();
|
||||
|
||||
SunToolkit.executeOnEventHandlerThread(target, () -> {
|
||||
Point newUserLocation = newLocation.getUserLocation();
|
||||
Rectangle oldBounds = getBounds();
|
||||
|
||||
Dimension newSize = xinerama
|
||||
? checkIfOnNewScreen(new Rectangle(eventLocation.getDeviceLocation(), eventDimension))
|
||||
: new Dimension(scaleDown(eventDimension.width), scaleDown(eventDimension.height));;
|
||||
Point newUserLocation = eventLocation.getUserLocation();
|
||||
x = newUserLocation.x;
|
||||
y = newUserLocation.y;
|
||||
width = scaleDown(newDimension.width);
|
||||
height = scaleDown(newDimension.height);
|
||||
width = newSize.width;
|
||||
height = newSize.height;
|
||||
|
||||
if (!getBounds().getSize().equals(oldBounds.getSize())) {
|
||||
AWTAccessor.getComponentAccessor().setSize(target, width, height);
|
||||
@@ -876,10 +890,6 @@ class XWindowPeer extends XPanelPeer implements WindowPeer,
|
||||
postEvent(new ComponentEvent(target, ComponentEvent.COMPONENT_MOVED));
|
||||
}
|
||||
repositionSecurityWarning();
|
||||
|
||||
if (xinerama) {
|
||||
checkIfOnNewScreen(new Rectangle(newLocation.getDeviceLocation(), newDimension));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -564,7 +564,9 @@ public abstract class X11InputMethodBase extends InputMethodAdapter {
|
||||
* @see java.awt.im.spi.InputMethod#removeNotify
|
||||
*/
|
||||
public synchronized void removeNotify() {
|
||||
dispose();
|
||||
stopListening();
|
||||
awtFocussedComponent = null;
|
||||
clientComponentWindow = null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -61,4 +61,17 @@ public abstract class XSurfaceData extends SurfaceData {
|
||||
protected native void setInvalid();
|
||||
|
||||
protected static native void XSetGraphicsExposures(long xgc, boolean needExposures);
|
||||
|
||||
/**
|
||||
* Loads native image raster into surface.
|
||||
*
|
||||
* @param pRaster native pointer image raster with 8-bit RGBA color components packed into integer pixels.
|
||||
* Note: The color data in this image is considered to be premultiplied with alpha.
|
||||
* @param width width of image in pixels
|
||||
* @param height height of image in pixels
|
||||
* @param pRects native pointer to array of "dirty" rects, each rect is a sequence of four 32-bit integers: x, y, width, heigth
|
||||
* Note: can be null (then whole image used)
|
||||
* @param rectsCount count of "dirty" rects (if 0 then whole image used)
|
||||
*/
|
||||
protected static native boolean loadNativeRasterWithRects(long sdops, long pRaster, int width, int height, long pRects, int rectsCount);
|
||||
}
|
||||
|
||||
@@ -761,4 +761,20 @@ public abstract class XRSurfaceData extends XSurfaceData {
|
||||
public void setStaticSrcTx(AffineTransform staticSrcTx) {
|
||||
this.staticSrcTx = staticSrcTx;
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads native image raster into surface.
|
||||
*
|
||||
* @param pRaster native pointer image raster with 8-bit RGBA color components packed into integer pixels.
|
||||
* Note: The color data in this image is considered to be premultiplied with alpha.
|
||||
* @param width width of image in pixels
|
||||
* @param height height of image in pixels
|
||||
* @param pRects native pointer to array of "dirty" rects, each rect is a sequence of four 32-bit integers: x, y, width, heigth
|
||||
* Note: can be null (then whole image used)
|
||||
* @param rectsCount count of "dirty" rects (if 0 then whole image used)
|
||||
*/
|
||||
@Override
|
||||
protected void loadNativeRaster(long pRaster, int width, int height, long pRects, int rectsCount) {
|
||||
loadNativeRasterWithRects(getNativeOps(), pRaster, width, height, pRects, rectsCount);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1703,3 +1703,90 @@ Java_sun_java2d_x11_XSurfaceData_XSetGraphicsExposures
|
||||
XSetGraphicsExposures(awt_display, (GC) xgc, needExposures ? True : False);
|
||||
#endif /* !HEADLESS */
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: sun_java2d_x11_X11SurfaceData
|
||||
* Method: loadNativeRasterWithRects
|
||||
* Signature:
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_sun_java2d_x11_XSurfaceData_loadNativeRasterWithRects
|
||||
(JNIEnv *env, jclass clazz,
|
||||
jlong sdops, jlong pRaster, jint width, jint height, jlong pRects, jint rectsCount)
|
||||
{
|
||||
SurfaceDataOps *dstOps = (SurfaceDataOps *)jlong_to_ptr(sdops);
|
||||
if (dstOps == NULL || pRaster == 0) {
|
||||
J2dRlsTraceLn(J2D_TRACE_ERROR, "XSurfaceData_loadNativeRasterWithRects: params are null");
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
if (pRects == 0 || rectsCount < 1) {
|
||||
SurfaceDataRasInfo dstInfo;
|
||||
memset(&dstInfo, 0, sizeof(SurfaceDataRasInfo));
|
||||
dstInfo.bounds.x1 = 0;
|
||||
dstInfo.bounds.y1 = 0;
|
||||
dstInfo.bounds.x2 = width;
|
||||
dstInfo.bounds.y2 = height;
|
||||
|
||||
if (dstOps->Lock(env, dstOps, &dstInfo, SD_LOCK_WRITE) != SD_SUCCESS) {
|
||||
J2dRlsTraceLn(J2D_TRACE_ERROR, "XSurfaceData_loadNativeRasterWithRects: can't lock dest.");
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
dstOps->GetRasInfo(env, dstOps, &dstInfo);
|
||||
if (dstInfo.rasBase) {
|
||||
J2dTraceLn(J2D_TRACE_VERBOSE, "XSurfaceData_loadNativeRasterWithRects: copy whole memory.");
|
||||
memcpy(dstInfo.rasBase, (void *)jlong_to_ptr(pRaster), width * height * 4);
|
||||
} else {
|
||||
J2dRlsTraceLn(J2D_TRACE_ERROR, "XSurfaceData_loadNativeRasterWithRects: can't get pointer of dest raster.");
|
||||
}
|
||||
|
||||
SurfaceData_InvokeRelease(env, dstOps, &dstInfo);
|
||||
SurfaceData_InvokeUnlock(env, dstOps, &dstInfo);
|
||||
} else {
|
||||
int32_t *pr = (int32_t *)jlong_to_ptr(pRects);
|
||||
for (int c = 0; c < rectsCount; ++c) {
|
||||
int32_t x = *(pr++);
|
||||
int32_t y = *(pr++);
|
||||
int32_t w = *(pr++);
|
||||
int32_t h = *(pr++);
|
||||
|
||||
SurfaceDataRasInfo dstInfo;
|
||||
memset(&dstInfo, 0, sizeof(SurfaceDataRasInfo));
|
||||
dstInfo.bounds.x1 = x;
|
||||
dstInfo.bounds.y1 = y;
|
||||
dstInfo.bounds.x2 = x + w;
|
||||
dstInfo.bounds.y2 = y + h;
|
||||
|
||||
if (dstOps->Lock(env, dstOps, &dstInfo, SD_LOCK_WRITE) != SD_SUCCESS) {
|
||||
J2dRlsTraceLn(J2D_TRACE_ERROR, "XSurfaceData_loadNativeRasterWithRects: can't lock dest rect.");
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
dstOps->GetRasInfo(env, dstOps, &dstInfo);
|
||||
if (dstInfo.rasBase) {
|
||||
char* pSrc = (char*)PtrCoord(pRaster, x, 4, y, width*4);
|
||||
char* pDst = (char*)PtrCoord(dstInfo.rasBase, x, dstInfo.pixelStride, y, dstInfo.scanStride);
|
||||
if (dstInfo.scanStride == width*4) {
|
||||
J2dTraceLn4(J2D_TRACE_VERBOSE, "XSurfaceData_loadNativeRasterWithRects: copy rect %d,%d - %d,%d [FAST]", x, y, w, h);
|
||||
memcpy(pDst, pSrc, width*h*4);
|
||||
} else {
|
||||
J2dTraceLn4(J2D_TRACE_VERBOSE, "XSurfaceData_loadNativeRasterWithRects: copy rect %d,%d - %d,%d [line by line]", x, y, w, h);
|
||||
for (int line = 0; line < h; ++line) {
|
||||
memcpy(pDst, pSrc, w*4);
|
||||
pSrc += width*4;
|
||||
pDst += dstInfo.scanStride;
|
||||
}
|
||||
}
|
||||
SurfaceData_InvokeRelease(env, dstOps, &dstInfo);
|
||||
} else {
|
||||
J2dRlsTraceLn(J2D_TRACE_ERROR, "XSurfaceData_loadNativeRasterWithRects: can't get pointer of dest raster (rect).");
|
||||
}
|
||||
|
||||
SurfaceData_InvokeUnlock(env, dstOps, &dstInfo);
|
||||
}
|
||||
}
|
||||
|
||||
return JNI_TRUE;
|
||||
}
|
||||
|
||||
|
||||
@@ -435,6 +435,7 @@ final class WInputMethod extends InputMethodAdapter
|
||||
endCompositionNative(context, DISCARD_INPUT);
|
||||
awtFocussedComponent = null;
|
||||
awtFocussedComponentPeer = null;
|
||||
stopListening();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1023,4 +1023,32 @@ public class D3DSurfaceData extends SurfaceData implements AccelSurface {
|
||||
*/
|
||||
public static native boolean updateWindowAccelImpl(long pd3dsd, long pData,
|
||||
int w, int h);
|
||||
|
||||
/**
|
||||
* Loads native image raster into surface.
|
||||
*
|
||||
* @param pRaster native pointer image raster with 8-bit RGBA color components packed into integer pixels.
|
||||
* Note: The color data in this image is considered to be premultiplied with alpha.
|
||||
* @param width width of image in pixels
|
||||
* @param height height of image in pixels
|
||||
* @param pRects native pointer to array of "dirty" rects, each rect is a sequence of four 32-bit integers: x, y, width, heigth
|
||||
* Note: can be null (then whole image used)
|
||||
* @param rectsCount count of "dirty" rects (if 0 then whole image used)
|
||||
*/
|
||||
@Override
|
||||
protected void loadNativeRaster(long pRaster, int width, int height, long pRects, int rectsCount) {
|
||||
D3DRenderQueue rq = D3DRenderQueue.getInstance();
|
||||
rq.lock();
|
||||
try {
|
||||
// make sure we have a current context before uploading
|
||||
// the sysmem data to the texture object
|
||||
D3DContext.setScratchSurface(getContext());
|
||||
rq.flushAndInvokeNow(() -> loadNativeRasterWithRects(getNativeOps(), pRaster, width, height, pRects, rectsCount));
|
||||
} finally {
|
||||
rq.unlock();
|
||||
}
|
||||
markDirty();
|
||||
}
|
||||
|
||||
private static native boolean loadNativeRasterWithRects(long pData, long pRaster, int width, int height, long pRects, int rectsCount);
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
|
||||
#include "D3DPipeline.h"
|
||||
#include <jlong.h>
|
||||
#include <cstdint>
|
||||
#include "D3DSurfaceData.h"
|
||||
#include "D3DPipelineManager.h"
|
||||
#include "Trace.h"
|
||||
@@ -32,7 +33,18 @@
|
||||
#include "awt_Window.h"
|
||||
#include "awt_BitmapUtil.h"
|
||||
#include "D3DRenderQueue.h"
|
||||
#include "D3DBlitLoops.h"
|
||||
|
||||
#include "GraphicsPrimitiveMgr.h"
|
||||
#include "IntArgb.h"
|
||||
#include "IntArgbPre.h"
|
||||
#include "IntRgb.h"
|
||||
#include "IntBgr.h"
|
||||
|
||||
extern "C" BlitFunc IntArgbToIntArgbPreConvert;
|
||||
extern "C" BlitFunc IntArgbPreToIntArgbConvert;
|
||||
extern "C" BlitFunc IntArgbBmToIntArgbConvert;
|
||||
extern "C" BlitFunc IntRgbToIntArgbConvert;
|
||||
|
||||
// REMIND: move to awt_Component.h
|
||||
extern "C" HWND AwtComponent_GetHWnd(JNIEnv *env, jlong pData);
|
||||
@@ -163,6 +175,134 @@ D3DSD_Unlock(JNIEnv *env,
|
||||
JNU_ThrowInternalError(env, "D3DSD_Unlock not implemented!");
|
||||
}
|
||||
|
||||
#define MAX(a, b) ((a) > (b) ? (a) : (b))
|
||||
#define MIN(a, b) ((a) < (b) ? (a) : (b))
|
||||
|
||||
jboolean loadNativeRasterWithRectsImpl(
|
||||
D3DSDOps * d3dsdo, jlong pRaster, jint width, jint height,
|
||||
jlong pRects, jint rectsCount
|
||||
) {
|
||||
D3DPipelineManager * pMgr = D3DPipelineManager::GetInstance();
|
||||
if (d3dsdo == NULL || d3dsdo->pResource == NULL || pMgr == NULL || pRaster == NULL) {
|
||||
J2dTraceLn(J2D_TRACE_ERROR, "D3DSurfaceData_loadNativeRasterWithRects: null param.");
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
J2dTraceLn3(J2D_TRACE_VERBOSE, "D3DSurfaceData_loadNativeRasterWithRects: ops=%p r=%p rCount=%d\n", (void*)d3dsdo, (void*)pRaster, rectsCount);
|
||||
|
||||
HRESULT res;
|
||||
D3DContext *pCtx;
|
||||
if (FAILED(res = pMgr->GetD3DContext(d3dsdo->adapter, &pCtx))) {
|
||||
J2dTraceLn(J2D_TRACE_ERROR, "D3DSurfaceData_loadNativeRasterWithRects: failed GetD3DContext.");
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
//
|
||||
// Blit via tiles
|
||||
//
|
||||
|
||||
D3DResource *pBlitTextureRes = NULL;
|
||||
res = pCtx->GetResourceManager()->GetBlitTexture(&pBlitTextureRes);
|
||||
if (FAILED(res)) {
|
||||
J2dTraceLn(J2D_TRACE_ERROR, "D3DSurfaceData_loadNativeRasterWithRects: failed GetBlitTexture.");
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
IDirect3DSurface9 *pBlitSurface = pBlitTextureRes->GetSurface();
|
||||
IDirect3DTexture9 *pBlitTexture = pBlitTextureRes->GetTexture();
|
||||
D3DSURFACE_DESC *pBlitDesc = pBlitTextureRes->GetDesc();
|
||||
|
||||
res = pCtx->BeginScene(STATE_TEXTUREOP);
|
||||
if (FAILED(res)) {
|
||||
J2dTraceLn(J2D_TRACE_ERROR, "D3DSurfaceData_loadNativeRasterWithRects: failed BeginScene.");
|
||||
return JNI_FALSE;
|
||||
}
|
||||
res = pCtx->SetTexture(pBlitTexture);
|
||||
if (FAILED(res)) {
|
||||
J2dTraceLn(J2D_TRACE_ERROR, "D3DSurfaceData_loadNativeRasterWithRects: failed SetTexture.");
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
IDirect3DDevice9 *pd3dDevice = pCtx->Get3DDevice();
|
||||
pd3dDevice->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_NONE);
|
||||
pd3dDevice->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_NONE);
|
||||
pd3dDevice->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
|
||||
pd3dDevice->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);
|
||||
|
||||
SurfaceDataRasInfo srcInfo;
|
||||
ZeroMemory(&srcInfo, sizeof(SurfaceDataRasInfo));
|
||||
srcInfo.bounds.x1 = 0;
|
||||
srcInfo.bounds.y1 = 0;
|
||||
srcInfo.bounds.x2 = width;
|
||||
srcInfo.bounds.y2 = height;
|
||||
srcInfo.scanStride = width*4;
|
||||
srcInfo.pixelStride = 4;
|
||||
srcInfo.rasBase = (void*)pRaster;
|
||||
srcInfo.pixelBitOffset = 0;
|
||||
|
||||
const jint tw = pBlitDesc->Width;
|
||||
const jint th = pBlitDesc->Height;
|
||||
jint sy, dy;
|
||||
jint sx, dx;
|
||||
for (sy = 0, dy = 0; sy < height; sy += th, dy += th) {
|
||||
jint sh = ((sy + th) > height) ? (height - sy) : th;
|
||||
jint dh = ((dy + th) > height) ? (height - dy) : th;
|
||||
|
||||
for (sx = 0, dx = 0; sx < width; sx += tw, dx += tw) {
|
||||
jint sw = ((sx + tw) > width) ? (width - sx) : tw;
|
||||
jint dw = ((dx + tw) > width) ? (width - dx) : tw;
|
||||
|
||||
if (pRects == 0 || rectsCount < 1) {
|
||||
//fprintf(stderr, "D3D_loadNativeRasterWithRects: do full copy of tile\n");
|
||||
D3DBL_CopyImageToIntXrgbSurface(&srcInfo, ST_INT_ARGB, pBlitTextureRes, sx, sy, sw, sh, 0, 0);
|
||||
const double tx1 = ((double)sw) / tw;
|
||||
const double ty1 = ((double)sh) / th;
|
||||
res = pCtx->pVCacher->DrawTexture((float)dx, (float)dy, (float)(dx+dw), (float)(dy+dh),
|
||||
0.0f, 0.0f, (float)tx1, (float)ty1);
|
||||
} else {
|
||||
int32_t *pr = (int32_t *) pRects;
|
||||
for (int c = 0; c < rectsCount; ++c) {
|
||||
const int32_t rx = *(pr++);
|
||||
const int32_t ry = *(pr++);
|
||||
const int32_t rw = *(pr++);
|
||||
const int32_t rh = *(pr++);
|
||||
// Check intersection with tile.
|
||||
if (sx + sw <= rx || sy + sh <= ry || rx + rw <= sx || rx + rw <= sx)
|
||||
continue;
|
||||
|
||||
// Calc intersection rect.
|
||||
const int32_t rcX0 = MAX(sx, rx);
|
||||
const int32_t rcY0 = MAX(sy, ry);
|
||||
const int32_t rcX1 = MIN(sx + sw, rx + rw);
|
||||
const int32_t rcY1 = MIN(sy + sh, ry + rh);
|
||||
const int32_t rectW = rcX1 - rcX0;
|
||||
const int32_t rectH = rcY1 - rcY0;
|
||||
const int32_t relX0 = rcX0 - sx;
|
||||
const int32_t relY0 = rcY0 - sy;
|
||||
const int32_t relX1 = rcX1 - sx;
|
||||
const int32_t relY1 = rcY1 - sy;
|
||||
|
||||
// Blit.
|
||||
D3DBL_CopyImageToIntXrgbSurface(&srcInfo, ST_INT_ARGB, pBlitTextureRes, rcX0, rcY0, rectW, rectH, relX0, relY0);
|
||||
|
||||
// Render.
|
||||
const double tx0 = ((double)relX0) / tw;
|
||||
const double ty0 = ((double)relY0) / th;
|
||||
const double tx1 = ((double)relX1) / tw;
|
||||
const double ty1 = ((double)relY1) / th;
|
||||
res = pCtx->pVCacher->DrawTexture(
|
||||
(float)dx + relX0, (float)dy + relY0, (float)(dx + relX1), (float)(dy + relY1),
|
||||
(float)tx0, (float)ty0, (float)tx1, (float)ty1);
|
||||
}
|
||||
}
|
||||
|
||||
res = pCtx->pVCacher->Render();
|
||||
}
|
||||
}
|
||||
|
||||
return JNI_TRUE;
|
||||
}
|
||||
|
||||
// ------------ D3DSurfaceData's JNI methods ----------------
|
||||
|
||||
|
||||
@@ -636,4 +776,17 @@ JNICALL Java_sun_java2d_d3d_D3DSurfaceData_updateWindowAccelImpl
|
||||
|
||||
return JNI_TRUE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Class: sun_java2d_d3d_D3DSurfaceData
|
||||
* Method: loadNativeRasterWithRects
|
||||
* Signature:
|
||||
*/
|
||||
JNIEXPORT
|
||||
jboolean JNICALL Java_sun_java2d_d3d_D3DSurfaceData_loadNativeRasterWithRects
|
||||
(JNIEnv *env, jclass clazz, jlong pData, jlong pRaster, jint width, jint height, jlong pRects,
|
||||
jint rectsCount) {
|
||||
return loadNativeRasterWithRectsImpl((D3DSDOps *) jlong_to_ptr(pData), pRaster, width, height, pRects, rectsCount);
|
||||
}
|
||||
} // namespace extern C
|
||||
18
src/jetbrains.api/src/com/jetbrains/NativeRasterLoader.java
Normal file
18
src/jetbrains.api/src/com/jetbrains/NativeRasterLoader.java
Normal file
@@ -0,0 +1,18 @@
|
||||
package com.jetbrains;
|
||||
|
||||
import java.awt.image.VolatileImage;
|
||||
|
||||
public interface NativeRasterLoader {
|
||||
/**
|
||||
* Loads native image raster into VolatileImage.
|
||||
*
|
||||
* @param pRaster native pointer image raster with 8-bit RGBA color components packed into integer pixels.
|
||||
* Note: The color data in this image is considered to be premultiplied with alpha.
|
||||
* @param width width of image in pixels
|
||||
* @param height height of image in pixels
|
||||
* @param pRects native pointer to array of "dirty" rects, each rect is a sequence of four 32-bit integers: x, y, width, heigth
|
||||
* Note: can be null (then whole image used)
|
||||
* @param rectsCount count of "dirty" rects (if 0 then whole image used)
|
||||
*/
|
||||
void loadNativeRaster(VolatileImage vi, long pRaster, int width, int height, long pRects, int rectsCount);
|
||||
}
|
||||
@@ -6,9 +6,9 @@
|
||||
# 2. When only new API is added, or some existing API was @Deprecated - increment MINOR, reset PATCH to 0
|
||||
# 3. For major backwards incompatible API changes - increment MAJOR, reset MINOR and PATCH to 0
|
||||
|
||||
VERSION = 1.9.0
|
||||
VERSION = 1.10.0
|
||||
|
||||
# Hash is used to track changes to jetbrains.api, so you would not forget to update version when needed.
|
||||
# When you make any changes, "make jbr-api" will fail and ask you to update hash and version number here.
|
||||
|
||||
HASH = 34E293D39C67B301086DDAD59EB9426
|
||||
HASH = 825E9B6832D82F59A0FFEAA4DA6F4A2
|
||||
|
||||
@@ -206,6 +206,7 @@ vmTestbase/nsk/jdi/Value/type/type002/type002.java time_out_intermittent macosx-
|
||||
vmTestbase/nsk/jdi/Value/type/type003/TestDescription.java time_out_intermittent macosx-all
|
||||
vmTestbase/nsk/jdi/VirtualMachine/canGetBytecodes/cangetbytecodes001/TestDescription.java time_out_intermittent macosx-aarch64
|
||||
vmTestbase/nsk/jdi/VirtualMachine/canGetCurrentContendedMonitor/cangccm001/TestDescription.java time_out_intermittent macosx-aarch64
|
||||
vmTestbase/nsk/jdi/VirtualMachine/canGetMonitorInfo/cangetmonitorinfo001/TestDescription.java JBR-6361 macosx-aarch64
|
||||
|
||||
vmTestbase/metaspace/gc/firstGC_10m/TestDescription.java 8208250 generic-all
|
||||
vmTestbase/metaspace/gc/firstGC_50m/TestDescription.java 8208250 generic-all
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
|
||||
import java.awt.Robot;
|
||||
import java.awt.Toolkit;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.SwingUtilities;
|
||||
import javax.swing.WindowConstants;
|
||||
@@ -85,10 +86,17 @@ public class GetScreenInsets468 implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
private void disposeAll() {
|
||||
private void disposeAll() throws InterruptedException, InvocationTargetException {
|
||||
|
||||
for (JFrame frame : frames) {
|
||||
frame.setVisible(false);
|
||||
frame.dispose();
|
||||
SwingUtilities.invokeAndWait(() -> {
|
||||
frame.setVisible(false);
|
||||
});
|
||||
|
||||
SwingUtilities.invokeAndWait(() -> {
|
||||
frame.dispose();
|
||||
});
|
||||
robot.delay(100);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -113,9 +113,8 @@
|
||||
|
||||
java/awt/event/MouseEvent/AcceptExtraButton/AcceptExtraButton.java JBR-6353 linux-x64,windows-aarch64,macosx-all
|
||||
java/awt/Graphics2D/DrawString/DisposerTest.java JBR-6334 macosx-all
|
||||
java/awt/FlowLayout/PreferredLayoutSize.java JBR-6348 windows-aarch64
|
||||
java/awt/FlowLayout/PreferredLayoutSize.java JBR-6348,JBR-6349 windows-aarch64,linux-all
|
||||
java/awt/Focus/RequestFocusByCause/RequestFocusByCauseTest.java JBR-6335,NOBUG linux-all,windows-all #timeout on windows
|
||||
java/awt/Frame/8158918/SetExtendedState.java JBR-6408 linux-x64
|
||||
java/awt/Frame/GetGraphicsStressTest/GetGraphicsStressTest.java NOBUG windows-all timeout
|
||||
java/awt/MenuItem/EnableTest.java NOBUG windows-all timeout
|
||||
java/awt/Robot/NonEmptyErrorStream.java JBR-6275 macosx-all
|
||||
|
||||
@@ -134,7 +134,6 @@ javax/swing/plaf/nimbus/8057791/bug8057791.java 8253184,JBR-5510 windows-all,lin
|
||||
javax/swing/text/html/CSS/4530474/bug4530474.java JBR-5359,JBR-5510,JBR-5951 windows-aarch64,linux-all,windows-x64
|
||||
javax/swing/text/html/StyleSheet/bug4936917.java 8277816,JBR-899,JBR-5510 windows-all,macosx-aarch64,linux-all
|
||||
jb/java/awt/MouseInfo/GetPointerInfoTest.java nobug linux-all
|
||||
sanity/client/SwingSet/src/ButtonDemoScreenshotTest.java 8265770,8273312,JBR-5510 windows-all,macosx-all,linux-all
|
||||
sanity/client/SwingSet/src/EditorPaneDemoTest.java JBR-5359,JBR-5510 windows-aarch64,linux-all
|
||||
sun/java2d/GdiRendering/ClipShapeRendering.java 8285604,JBR-5510 windows-all,linux-all
|
||||
sun/java2d/GdiRendering/InsetClipping.java 7124403,JBR-5359,JBR-5510 windows-x64,macosx-all,windows-aarch64,linux-all
|
||||
|
||||
@@ -254,15 +254,15 @@ java/awt/Frame/FramesGC/FramesGC.java 8079069 macosx-all
|
||||
java/awt/Scrollbar/ScrollbarMouseWheelTest/ScrollbarMouseWheelTest.java 8196018 windows-all,linux-all
|
||||
java/awt/ScrollPane/ScrollPanePreferredSize/ScrollPanePreferredSize.java 8253184 windows-all
|
||||
java/awt/TrayIcon/ActionCommand/ActionCommand.java 8150540 windows-all
|
||||
java/awt/TrayIcon/ActionEventMask/ActionEventMask.java 8150540,8242801,8295300 windows-all,macosx-all,linux-5.15.0-39-generic,linux-5.15.0-33-generic,linux-6.2.0-1016-aws,linux-6.2.0-1014-aws,linux-6.2.0-1015-aws
|
||||
java/awt/TrayIcon/ActionEventMask/ActionEventMask.java 8150540,8242801,8295300 windows-all,macosx-all,linux-all
|
||||
java/awt/TrayIcon/ActionEventTest/ActionEventTest.java 8150540,8242801 windows-all,macosx-all
|
||||
java/awt/TrayIcon/ModalityTest/ModalityTest.java 8150540,8295300 windows-all,macosx-all,linux-5.15.0-39-generic,linux-5.15.0-33-generic,linux-6.2.0-1016-aws,linux-6.2.0-1014-aws,linux-6.2.0-1015-aws
|
||||
java/awt/TrayIcon/MouseEventMask/MouseEventMaskTest.java 8150540,8295300 windows-all,linux-5.15.0-39-generic,linux-5.15.0-33-generic,linux-6.2.0-1016-aws,linux-6.2.0-1014-aws,linux-6.2.0-1015-aws
|
||||
java/awt/TrayIcon/MouseMovedTest/MouseMovedTest.java 8150540,8295300 windows-all,linux-5.15.0-39-generic,linux-5.15.0-33-generic,linux-6.2.0-1016-aws,linux-6.2.0-1014-aws,linux-6.2.0-1015-aws
|
||||
java/awt/TrayIcon/SecurityCheck/FunctionalityCheck/FunctionalityCheck.java 8150540,8295300 windows-all,linux-5.15.0-39-generic,linux-5.15.0-33-generic,linux-6.2.0-1016-aws,linux-6.2.0-1014-aws,linux-6.2.0-1015-aws
|
||||
java/awt/TrayIcon/ModalityTest/ModalityTest.java 8150540,8295300 windows-all,macosx-all,linux-all
|
||||
java/awt/TrayIcon/MouseEventMask/MouseEventMaskTest.java 8150540,8295300 windows-all,linux-all
|
||||
java/awt/TrayIcon/MouseMovedTest/MouseMovedTest.java 8150540,8295300 windows-all,linux-all
|
||||
java/awt/TrayIcon/SecurityCheck/FunctionalityCheck/FunctionalityCheck.java 8150540,8295300 windows-all,linux-all
|
||||
java/awt/TrayIcon/SystemTrayInstance/SystemTrayInstanceTest.java 8193543 linux-all
|
||||
java/awt/TrayIcon/TrayIconEventModifiers/TrayIconEventModifiersTest.java 8150540,8295300 windows-all,linux-5.15.0-39-generic,linux-5.15.0-33-generic,linux-6.2.0-1016-aws,linux-6.2.0-1014-aws,linux-6.2.0-1015-aws
|
||||
java/awt/TrayIcon/TrayIconEvents/TrayIconEventsTest.java 8150540,8295300 windows-all,linux-5.15.0-39-generic,linux-5.15.0-33-generic,linux-6.2.0-1016-aws,linux-6.2.0-1014-aws,linux-6.2.0-1015-aws
|
||||
java/awt/TrayIcon/TrayIconEventModifiers/TrayIconEventModifiersTest.java 8150540,8295300 windows-all,linux-all
|
||||
java/awt/TrayIcon/TrayIconEvents/TrayIconEventsTest.java 8150540,8295300 windows-all,linux-all
|
||||
java/awt/TrayIcon/TrayIconMouseTest/TrayIconMouseTest.java 8150540 windows-all
|
||||
java/awt/TrayIcon/TrayIconPopup/TrayIconPopupClickTest.java 8150540 windows-all,macosx-all
|
||||
java/awt/TrayIcon/TrayIconPopup/TrayIconPopupTest.java 8150540,8314775,8295300 windows-all,linux-6.2.0-1016-aws,linux-6.2.0-1014-aws,linux-6.2.0-1015-aws,linux-5.15.0-39-generic
|
||||
@@ -278,7 +278,7 @@ java/awt/Window/ShapedAndTranslucentWindows/TranslucentChoice.java 8253184 windo
|
||||
java/awt/Window/ShapedAndTranslucentWindows/TranslucentWindowClick.java 8253184 windows-all
|
||||
java/awt/Window/setLocRelativeTo/SetLocationRelativeToTest.java 8253184 windows-all
|
||||
java/awt/Window/MultiWindowApp/ChildAlwaysOnTopTest.java 8222323,JBR-5510 windows-all,linux-5.18.2-arch1-1
|
||||
java/awt/Window/MultiWindowApp/MultiWindowAppTest.java 8253184,JBR-5510 windows-all,linux-5.18.2-arch1-1
|
||||
java/awt/Window/MultiWindowApp/MultiWindowAppTest.java 8253184,JBR-5510,JBR-6463 windows-all,linux-all
|
||||
java/awt/Window/ShapedAndTranslucentWindows/FocusAWTTest.java 8222328 windows-all,linux-all,macosx-all
|
||||
java/awt/Window/ShapedAndTranslucentWindows/Shaped.java 8222328 windows-all,linux-all,macosx-all
|
||||
java/awt/Window/ShapedAndTranslucentWindows/ShapedByAPI.java 8222328 windows-all,linux-all,macosx-all
|
||||
@@ -327,7 +327,7 @@ sun/java2d/X11SurfaceData/SharedMemoryPixmapsTest/SharedMemoryPixmapsTest.sh 822
|
||||
java/awt/hidpi/ClientAreaOriginWindowsTest.java 8303491 windows-all
|
||||
java/awt/hidpi/SetMaximizedBoundsTest.java JBR-5443 windows-all
|
||||
java/awt/hidpi/properties/HiDPIPropertiesUnixTest.java JBR-495 macosx-all
|
||||
java/awt/FullScreen/DisplayChangeVITest/DisplayChangeVITest.java 8169469 windows-all
|
||||
java/awt/FullScreen/DisplayChangeVITest/DisplayChangeVITest.java 8169469,JBR-6476 windows-all,macosx-all
|
||||
java/awt/print/PrinterJob/PSQuestionMark.java 7003378 generic-all
|
||||
java/awt/print/PrinterJob/GlyphPositions.java 7003378 generic-all
|
||||
java/awt/Choice/ChoiceGeneratesItemEvents.java JBR-6284 linux-5.18.2-arch1-1
|
||||
@@ -496,7 +496,7 @@ java/awt/Modal/MultipleDialogs/MultipleDialogs2Test.java 8198665,8253184 macosx-
|
||||
java/awt/Modal/MultipleDialogs/MultipleDialogs3Test.java 8198665,8253184 macosx-all,windows-all
|
||||
java/awt/Modal/MultipleDialogs/MultipleDialogs4Test.java 8198665,8253184,JBR-5510 macosx-all,windows-all,linux-5.18.2-arch1-1
|
||||
java/awt/Modal/MultipleDialogs/MultipleDialogs5Test.java 8198665,8253184 macosx-all,windows-all
|
||||
java/awt/Mouse/EnterExitEvents/DragWindowOutOfFrameTest.java 8177326,8253184 macosx-all,windows-all
|
||||
java/awt/Mouse/EnterExitEvents/DragWindowOutOfFrameTest.java 8177326,8253184,JBR-6305 macosx-all,windows-all,linux-all
|
||||
java/awt/Mouse/EnterExitEvents/DragWindowTest.java 8023562,8253184,JBR-5710 macosx-all,windows-all,linux-all
|
||||
java/awt/Mouse/EnterExitEvents/ModalDialogEnterExitEventsTest.java 8253184,JBR-5811 windows-all,linux-all
|
||||
java/awt/Mouse/EnterExitEvents/ResizingFrameTest.java 8005021,8253184 macosx-all,windows-all
|
||||
@@ -504,7 +504,7 @@ java/awt/Mouse/EnterExitEvents/FullscreenEnterEventTest.java 8051455 macosx-all
|
||||
java/awt/Mouse/ExtraMouseClick/ExtraMouseClick.java 8253184,JBR-5709 windows-all,linux-all
|
||||
java/awt/Mouse/MouseComboBoxTest/MouseComboBoxTest.java 8253184 windows-all
|
||||
java/awt/Mouse/MouseModifiersUnitTest/ExtraButtonDrag.java 8253184,JBR-6407 windows-all,linux-5.4.0-1103-aws # 5.4.0-1103-aws - Ubuntu 18.04
|
||||
java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersUnitTest_Standard.java 7124407,8302787 macosx-all,windows-all
|
||||
java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersUnitTest_Standard.java 7124407,8302787 macosx-all,windows-all
|
||||
java/awt/Mouse/RemovedComponentMouseListener/RemovedComponentMouseListener.java 8157170,8253184 macosx-all,windows-all
|
||||
java/awt/MouseAdapter/MouseAdapterUnitTest/MouseAdapterUnitTest.java 8253184 windows-all
|
||||
java/awt/MouseInfo/ComponentMousePositionTest.java 8253184 windows-all
|
||||
@@ -639,6 +639,7 @@ java/awt/Toolkit/ToolkitPropertyTest/ToolkitPropertyTest_Enable.java 6847163
|
||||
java/awt/xembed/server/RunTestXEmbed.java 7034201 linux-all
|
||||
java/awt/Modal/ModalFocusTransferTests/FocusTransferDialogsDocModalTest.java 8164473 linux-all
|
||||
java/awt/im/memoryleak/InputContextMemoryLeakTest.java 8023814 linux-all,windows-all
|
||||
java/awt/Frame/8158918/SetExtendedState.java JBR-6408 linux-x64
|
||||
java/awt/Frame/DecoratedFrameInsets/DecoratedFrameInsetsTest.java JBR-5205 linux-5.4.0-1103-aws
|
||||
java/awt/Frame/DisposeParentGC/DisposeParentGC.java 8079786 macosx-all
|
||||
|
||||
@@ -918,8 +919,8 @@ javax/swing/JRadioButton/8033699/bug8033699.java 8197552 windows-all
|
||||
javax/swing/JRadioButton/8075609/bug8075609.java 8197552,8266085,JBR-5510 windows-all,linux-5.18.2-arch1-1
|
||||
javax/swing/JRadioButton/ButtonGroupFocus/ButtonGroupFocusTest.java 8197552,8266085 windows-all
|
||||
javax/swing/JRadioButton/FocusTraversal/FocusTraversal.java 8266085 windows-all
|
||||
javax/swing/JWindow/ShapedAndTranslucentWindows/ShapedTranslucentPerPixelTranslucentGradient.java 8233582 linux-all
|
||||
javax/swing/JWindow/ShapedAndTranslucentWindows/ShapedPerPixelTranslucentGradient.java 8233582 linux-all
|
||||
javax/swing/JWindow/ShapedAndTranslucentWindows/ShapedTranslucentPerPixelTranslucentGradient.java 8233582,JBR-6481 linux-all,windows-all
|
||||
javax/swing/JWindow/ShapedAndTranslucentWindows/ShapedPerPixelTranslucentGradient.java 8233582,JBR-6360 linux-all,windows-all
|
||||
javax/swing/JWindow/ShapedAndTranslucentWindows/PerPixelTranslucentCanvas.java 8253184,JBR-5510 windows-all,linux-5.18.2-arch1-1
|
||||
javax/swing/JWindow/ShapedAndTranslucentWindows/PerPixelTranslucentSwing.java 8194128,8253184,JBR-5510 macosx-all,windows-all,linux-5.18.2-arch1-1
|
||||
javax/swing/JWindow/ShapedAndTranslucentWindows/SetShapeAndClickSwing.java 8013450,8253184 macosx-all,windows-all
|
||||
@@ -927,9 +928,9 @@ javax/swing/JWindow/ShapedAndTranslucentWindows/TranslucentJComboBox.java 802462
|
||||
javax/swing/JWindow/ShapedAndTranslucentWindows/TranslucentWindowClickSwing.java 8253184 windows-all
|
||||
# The next test below is an intermittent failure
|
||||
javax/swing/JTree/DnD/LastNodeLowerHalfDrop.java 8159131 linux-all
|
||||
javax/swing/JTree/4330357/bug4330357.java 8253184 windows-all
|
||||
javax/swing/JTree/4330357/bug4330357.java 8253184,JBR-6466 windows-all,linux-all
|
||||
javax/swing/JTree/4633594/JTreeFocusTest.java 8173125,JBR-5210 macosx-all,windows-all
|
||||
javax/swing/AbstractButton/6711682/bug6711682.java 8060765,JBR-6232 windows-all,macosx-all,linux-5.15.0-39-generic,linux-5.15.0-33-generic,linux-6.2.0-1016-aws,linux-6.2.0-1014-aws,linux-6.2.0-1015-aws
|
||||
javax/swing/AbstractButton/6711682/bug6711682.java 8060765,JBR-6232 windows-all,macosx-all,linux-all
|
||||
javax/swing/Action/8133039/bug8133039.java JBR-5210,JBR-6232 windows-all,linux-6.2.0-1014-aws,linux-6.2.0-1015-aws
|
||||
javax/swing/ButtonGroup/TestButtonGroupFocusTraversal.java JBR-5210,JBR-6232 windows-all,linux-6.2.0-1014-aws,linux-6.2.0-1015-aws
|
||||
javax/swing/event/RightAltKeyTest.java JBR-5210 windows-all
|
||||
@@ -1024,7 +1025,7 @@ java/awt/AlphaComposite/WindowAlphaCompositeTest.java 8277816 macosx-aarch64
|
||||
|
||||
native_sanity/simplenativelauncher/ProgramTest.java JBR-5287 windows-all
|
||||
|
||||
sanity/client/SwingSet/src/ButtonDemoScreenshotTest.java 8265770,8273312,JBR-5510 windows-all,macosx-all,linux-5.18.2-arch1-1
|
||||
sanity/client/SwingSet/src/ButtonDemoScreenshotTest.java 8265770,8273312,JBR-5510,JBR-6475 windows-all,macosx-all,linux-all
|
||||
sanity/client/SwingSet/src/ColorChooserDemoTest.java
|
||||
sanity/client/SwingSet/src/DialogDemoTest.java 8253184 windows-all
|
||||
sanity/client/SwingSet/src/FrameDemoTest.java 8253184 windows-all
|
||||
@@ -1162,6 +1163,7 @@ javax/swing/JTableHeader/6889007/bug6889007.java 8253184,8197552,JBR-5387 window
|
||||
javax/swing/JTextField/8036819/bug8036819.java 8197552 windows-all
|
||||
javax/swing/JTree/4908142/bug4908142.java 8197552 windows-all
|
||||
javax/swing/JTree/4927934/bug4927934.java 8197552 windows-all
|
||||
javax/swing/UI/UnninstallUIMemoryLeaks/UnninstallUIMemoryLeaks.java JBR-5952 window-x64
|
||||
java/awt/TrayIcon/DragEventSource/DragEventSource.java 8252242 macosx-all
|
||||
java/awt/FileDialog/DefaultFocusOwner/DefaultFocusOwner.java 7187728 macosx-all,linux-all
|
||||
java/awt/FileDialog/RegexpFilterTest/RegexpFilterTest.html 7187728 macosx-all,linux-all
|
||||
@@ -1173,8 +1175,10 @@ java/awt/TextArea/TextAreaCursorTest/HoveringAndDraggingTest.java 8024986 macosx
|
||||
java/awt/TextArea/TextAreaTwicePack/TextAreaTwicePack.java 8253184 windows-all
|
||||
java/awt/TextField/OverScrollTest/OverScrollTest.java 8253184 windows-all
|
||||
java/awt/event/MouseEvent/SpuriousExitEnter/SpuriousExitEnter.java 8254841 macosx-all
|
||||
java/awt/FlowLayout/PreferredLayoutSize.java JBR-6349 linux-all
|
||||
java/awt/Focus/AppletInitialFocusTest/AppletInitialFocusTest1.java 8256289,JBR-5359 windows-x64,windows-aarch64
|
||||
java/awt/Focus/RemoveAfterRequest/RemoveAfterRequest.java JBR-6052 macosx-all,linux-all
|
||||
java/awt/Focus/RequestFocusByCause/RequestFocusByCauseTest.java JBR-6335 linux-all
|
||||
java/awt/Focus/RowToleranceTransitivityTest.java JBR-5751 windows-all
|
||||
java/awt/FullScreen/TranslucentWindow/TranslucentWindow.java 8258103,8253184 linux-all,windows-all
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
java/awt/Dialog/DialogLocationTest.java JBR-6090 windows-all
|
||||
java/awt/datatransfer/DragUnicodeBetweenJVMTest/DragUnicodeBetweenJVMTest.java JBR-5538 windows-all
|
||||
java/awt/datatransfer/MissedHtmlAndRtfBug/MissedHtmlAndRtfBug.java JBR-6027 windows-all
|
||||
java/awt/dnd/MozillaDnDTest.java JBR-6442 linux-all
|
||||
java/awt/event/MouseEvent/AcceptExtraButton/AcceptExtraButton.java JBR-6353 linux-x64,windows-aarch64,macosx-all
|
||||
java/awt/Focus/6378278/InputVerifierTest.java JBR-5799 windows-all
|
||||
java/awt/Focus/ActualFocusedWindowTest/ActualFocusedWindowBlockingTest.java 8252772,JBR-5799,JBR-6031 linux-all,windows-all
|
||||
@@ -31,7 +32,7 @@ javax/swing/JComponent/7154030/bug7154030.java 8297454,JBR-5359,JBR-5510,JBR-613
|
||||
javax/swing/JEditorPane/8195095/ImageViewTest.java 8253184,JBR-5510,JBR-6283 windows-all,linux-all,macos-all
|
||||
javax/swing/JPopupMenu/6580930/bug6580930.java 7124313,JBR-5071 macosx-all,linux-all
|
||||
javax/swing/JWindow/ShapedAndTranslucentWindows/ShapedPerPixelTranslucentGradient.java 8233582,JBR-6090 linux-all,windows-all
|
||||
javax/swing/JWindow/ShapedAndTranslucentWindows/ShapedTranslucentPerPixelTranslucentGradient.java JBR-6090 windows-all
|
||||
javax/swing/JWindow/ShapedAndTranslucentWindows/ShapedTranslucentPerPixelTranslucentGradient.java 8233582,JBR-6481,JBR-6090 linux-all,windows-all
|
||||
javax/swing/plaf/synth/SynthButtonUI/6276188/bug6276188.java 8274106,JBR-6090,8253184,JBR-5510,JBR-803 windows-all,linux-all,macosx-all
|
||||
|
||||
|
||||
|
||||
@@ -40,7 +40,6 @@ javax/swing/JTable/7124218/SelectEditTableCell.java JBR-4894 windows-all
|
||||
javax/swing/JToolTip/6219960/bug6219960.java nobug windows-all
|
||||
javax/swing/JTree/4633594/JTreeFocusTest.java 8173125 macosx-all,windows-all
|
||||
javax/swing/JTree/DnD/LastNodeLowerHalfDrop.java 8159131 linux-all,windows-all
|
||||
javax/swing/JWindow/ShapedAndTranslucentWindows/ShapedTranslucentPerPixelTranslucentGradient.java 8233582,nobug linux-all,windows-all
|
||||
javax/swing/JWindow/ShapedAndTranslucentWindows/TranslucentJComboBox.java 8024627 macosx-all,windows-all
|
||||
javax/swing/JWindow/ShapedAndTranslucentWindows/TranslucentWindowClickSwing.java nobug windows-all
|
||||
javax/swing/plaf/windows/6921687/bug6921687.java nobug windows-all
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user