[Git][java-team/openjfx][master] 5 commits: New upstream version 11.0.1+0
Emmanuel Bourg
gitlab at salsa.debian.org
Tue Dec 4 18:14:34 GMT 2018
Emmanuel Bourg pushed to branch master at Debian Java Maintainers / openjfx
Commits:
150b7c78 by Emmanuel Bourg at 2018-12-04T16:18:43Z
New upstream version 11.0.1+0
- - - - -
1f5482e7 by Emmanuel Bourg at 2018-12-04T16:26:25Z
New upstream version 11.0.1+1
- - - - -
a3484c5e by Emmanuel Bourg at 2018-12-04T17:19:16Z
Fixed the watch file to track the 11.x updates
- - - - -
bdf61bbf by Emmanuel Bourg at 2018-12-04T17:19:21Z
Update upstream source from tag 'upstream/11.0.1+1'
Update to upstream version '11.0.1+1'
with Debian dir 17665b63fa44da14cef41cd4b91ff7ffe3fcb8d5
- - - - -
3f40fca1 by Emmanuel Bourg at 2018-12-04T17:19:55Z
New upstream release (11.0.1+1)
- - - - -
25 changed files:
- build.properties
- debian/changelog
- debian/watch
- + doc-files/release-notes-11.md
- modules/javafx.graphics/src/main/java/com/sun/marlin/DRendererContext.java
- modules/javafx.graphics/src/main/java/com/sun/marlin/DStroker.java
- modules/javafx.graphics/src/main/java/com/sun/marlin/DTransformingPathConsumer2D.java
- modules/javafx.graphics/src/main/java/com/sun/marlin/MarlinConst.java
- modules/javafx.graphics/src/main/java/com/sun/marlin/RendererContext.java
- modules/javafx.graphics/src/main/java/com/sun/marlin/Stroker.java
- modules/javafx.graphics/src/main/java/com/sun/marlin/TransformingPathConsumer2D.java
- modules/javafx.graphics/src/main/java/com/sun/marlin/Version.java
- modules/javafx.graphics/src/main/java/com/sun/prism/impl/shape/DMarlinPrismUtils.java
- modules/javafx.graphics/src/main/java/com/sun/prism/impl/shape/MarlinPrismUtils.java
- modules/javafx.media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-bad/gst/aiff/aiffparse.c
- modules/javafx.media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/wavparse/gstwavparse.c
- modules/javafx.web/src/main/java/com/sun/javafx/webkit/theme/RenderThemeImpl.java
- modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/java/ImageBufferJava.cpp
- modules/javafx.web/src/main/native/Source/WebCore/platform/java/RenderThemeJava.cpp
- + modules/javafx.web/src/shims/java/com/sun/javafx/webkit/prism/PrismInvokerShim.java
- modules/jdk.packager/src/main/java/com/sun/javafx/tools/packager/DeployParams.java
- modules/jdk.packager/src/main/java/com/sun/javafx/tools/packager/MakeAllParams.java
- modules/jdk.packager/src/main/resources/com/sun/javafx/tools/packager/Bundle.properties
- + modules/jdk.packager/src/test/java/com/sun/javafx/tools/packager/DeployParamsTest.java
- + tests/system/src/test/java/test/com/sun/marlin/ScaleClipTest.java
Changes:
=====================================
build.properties
=====================================
@@ -41,7 +41,7 @@ jfx.release.suffix=-ea
# UPDATE THE FOLLOWING VALUES FOR A NEW RELEASE
jfx.release.major.version=11
jfx.release.minor.version=0
-jfx.release.security.version=0
+jfx.release.security.version=1
jfx.release.patch.version=0
# Note: The release version is now calculated in build.gradle as the
=====================================
debian/changelog
=====================================
@@ -1,3 +1,10 @@
+openjfx (11.0.1+1-1) unstable; urgency=medium
+
+ * New upstream release
+ * Fixed the watch file to track the 11.x updates
+
+ -- Emmanuel Bourg <ebourg at apache.org> Tue, 04 Dec 2018 18:10:06 +0100
+
openjfx (11+26-5) unstable; urgency=medium
* Tentatively fix FTBFS on big endian architectures (Closes: #880359)
=====================================
debian/watch
=====================================
@@ -1,3 +1,3 @@
version=3
opts="repack,compression=xz" \
-https://github.com/javafxports/openjdk-jfx/tags .*/(?:jdk-)?(11\+\d+).zip
+https://github.com/javafxports/openjdk-jfx/tags .*/(?:jdk-)?(11[\.\+\d]+).zip
=====================================
doc-files/release-notes-11.md
=====================================
@@ -0,0 +1,221 @@
+# Release Notes for JavaFX 11
+
+## Introduction
+
+The following notes describe important changes and information about this release. In some cases, the descriptions provide links to additional detailed information about an issue or a change.
+
+As of JDK 11 the JavaFX modules are delivered separately from the JDK. These release notes cover the standalone JavaFX 11 release. JavaFX 11 requires either JDK 10 (which must be an OpenJDK build) or JDK 11. JDK 11 is recommended.
+
+## Important Changes
+
+### Running JavaFX applications
+
+Now that the JDK no longer includes JavaFX, it is necessary to explicitly include the JavaFX modules that your application uses. Please refer to the [Getting Started with JavaFX 11](https://openjfx.io/openjfx-docs/) page for instructions.
+
+
+### Add APIs to customize step repeat timing for Spinner control
+
+The default duration that the mouse has to be pressed on a Spinner control arrow button before the value steps is modified in JavaFX 11. Two new properties, "initialDelay" and "repeatDelay", have been added to configure this behavior.
+
+ initialDelay: The duration that the mouse has to be pressed on an arrow button before the next value steps. The default is now 300 msec.
+
+ repeatDelay: The duration that the mouse has to be pressed for each successive step after the first value steps. The default is now 60 msec.
+
+See [JDK-8167096](https://bugs.openjdk.java.net/browse/JDK-8167096) for more information.
+
+
+### Standalone javafx modules no longer have permissions by default
+
+The javafx.* modules are now loaded by the application class loader and no longer have permissions by default. Applications that want to run with a security manager enabled will need to specify a custom policy file, using "-Djava.security.policy", granting all permissions to each of the javafx.* modules.
+See [JDK-8210617](https://bugs.openjdk.java.net/browse/JDK-8210617) for more information.
+
+
+### Switch default GTK version to 3
+
+JavaFX will now use GTK 3 by default on Linux platforms where the gtk3 library is present. Prior to JavaFX 11, the GTK 2 library was the default. This matches the default for AWT in JDK 11. See [JDK-8198654](https://bugs.openjdk.java.net/browse/JDK-8198654) for more information.
+
+
+## New Features
+
+The following notes describe some of the enhancements in JavaFX 11. See the table at the end of the release notes for a complete list.
+
+### FX Robot API
+
+Public FX Robot API was added to support simulating user interaction such as typing keys on the keyboard and using the mouse as well as capturing graphical information. See [JDK-8090763](https://bugs.openjdk.java.net/browse/JDK-8090763) for more information.
+
+## Removed Features and Options
+
+### Remove support for libavcodec 53 and 55
+
+FX Media support for libavcodec 53 and 55 was removed. These libraries are not present on supported Linux platforms by default, and are no longer needed. See [JDK-8194062](https://bugs.openjdk.java.net/browse/JDK-8194062) for more information.
+
+
+## Known Issues
+
+### JavaFX crashes with OpenJDK 11 on Ubuntu 18.04 with Wayland
+
+JavaFX crashes on Ubuntu 18.04 Linux machines when the XWayland window server is enabled. This happens whenever the FX window toolkit code uses GTK 3 on Linux, which is the default as of JavaFX 11.
+
+The recommended workaround is to use the Xorg server instead of the Wayland server when running JavaFX applications. Note that Wayland is not supported by JDK 10 or JDK 11.
+
+An alternative workaround is to explicitly force GTK 2 by passing the following system property on the command line:
+
+```
+ java -Djdk.gtk.version=2 ...
+```
+
+See [JDK-8210411](https://bugs.openjdk.java.net/browse/JDK-8210411) for more information.
+
+### Swing interop requires qualified exports when run with JDK 10
+
+To run FX / Swing interop applications using JavaFX 11 with an OpenJDK 10 release, the following four qualified exports must be added to the `java` command line.
+
+```
+--add-exports=java.desktop/java.awt.dnd.peer=javafx.swing
+--add-exports=java.desktop/sun.awt=javafx.swing
+--add-exports=java.desktop/sun.awt.dnd=javafx.swing
+--add-exports=java.desktop/sun.swing=javafx.swing
+```
+
+See [JDK-8210615](https://bugs.openjdk.java.net/browse/JDK-8210615) for more information.
+
+
+### Swing interop fails when run with a security manager with standalone SDK
+
+FX / Swing interop applications will fail when run with a security manager enabled. An application that uses either JFXPanel or SwingNode must run without a security manager enabled.
+See [JDK-8202451](https://bugs.openjdk.java.net/browse/JDK-8202451) for more information.
+
+
+### Swing interop fails when using a minimal jdk image created with jlink
+
+A minimal Java image created using jlink that includes the javafx.swing module from the JavaFX 11 jmods bundle will fail to run FX / Swing interop applications. For example, an image created as follows will not work:
+
+```
+ jlink --output myjdk --module-path javafx-jmods-11 \
+ --add-modules java.desktop,javafx.swing,javafx.controls
+```
+
+The javafx.swing module depends on a new jdk.unsupported.desktop module in JDK 11 that must either be explicitly added or included via the `--bind-services` option.
+
+Workaround: create your image using one of the following two methods:
+
+```
+ jlink --output myjdk --module-path javafx-jmods-11 \
+ --add-modules java.desktop,javafx.swing,javafx.controls,jdk.unsupported.desktop
+
+ jlink --output myjdk --bind-services --module-path javafx-jmods-11 \
+ --add-modules java.desktop,javafx.swing,javafx.controls
+```
+
+See [JDK-8210759](https://bugs.openjdk.java.net/browse/JDK-8210759) for more information.
+
+
+## List of Fixed Bugs
+
+Issue key|Summary|Subcomponent
+---------|-------|------------
+[JDK-8203345](https://bugs.openjdk.java.net/browse/JDK-8203345)|Memory leak in VirtualFlow when screen reader is enabled|accessibility
+[JDK-8204336](https://bugs.openjdk.java.net/browse/JDK-8204336)|Platform.exit() throws ISE when a nested event loop is active|application-lifecycle
+[JDK-8089454](https://bugs.openjdk.java.net/browse/JDK-8089454)|[HTMLEditor] selection removes CENTER alignment|controls
+[JDK-8154039](https://bugs.openjdk.java.net/browse/JDK-8154039)|Memory leak when selecting a tab which is not contained in TabPane::getTabs()|controls
+[JDK-8157690](https://bugs.openjdk.java.net/browse/JDK-8157690)|[TabPane] Sorting tabs makes tab selection menu empty|controls
+[JDK-8165459](https://bugs.openjdk.java.net/browse/JDK-8165459)|HTMLEditor: clipboard toolbar buttons are disabled unexpectedly|controls
+[JDK-8185854](https://bugs.openjdk.java.net/browse/JDK-8185854)|NPE on non-editable ComboBox in TabPane with custom Skin|controls
+[JDK-8187432](https://bugs.openjdk.java.net/browse/JDK-8187432)|ListView: EditEvent on start has incorrect index|controls
+[JDK-8192800](https://bugs.openjdk.java.net/browse/JDK-8192800)|Table auto resize ignores column resize policy|controls
+[JDK-8193311](https://bugs.openjdk.java.net/browse/JDK-8193311)|[Spinner] Default button not activated on ENTER|controls
+[JDK-8193495](https://bugs.openjdk.java.net/browse/JDK-8193495)|TabPane does not update correctly tab positions in the header area after a quick remove and add operations|controls
+[JDK-8194913](https://bugs.openjdk.java.net/browse/JDK-8194913)|Focus traversal is broken if a Pane is added to a ToolBar|controls
+[JDK-8196827](https://bugs.openjdk.java.net/browse/JDK-8196827)|test.javafx.scene.control.ComboBoxTest - generates NullPointerException|controls
+[JDK-8197846](https://bugs.openjdk.java.net/browse/JDK-8197846)|ComboBox: becomes unclickable after removal and re-adding|controls
+[JDK-8197985](https://bugs.openjdk.java.net/browse/JDK-8197985)|Pressing Shift + DOWN in ListView causes Exception to be thrown|controls
+[JDK-8200285](https://bugs.openjdk.java.net/browse/JDK-8200285)|TabDragPolicy.REORDER prevents ContextMenu from showing|controls
+[JDK-8201285](https://bugs.openjdk.java.net/browse/JDK-8201285)|DateCell text color are not updated correctly when DateCell with disable = true is reused|controls
+[JDK-8208610](https://bugs.openjdk.java.net/browse/JDK-8208610)|Incorrect check for calling class in FXMLLoader::getDefaultClassLoader|fxml
+[JDK-8129582](https://bugs.openjdk.java.net/browse/JDK-8129582)|Controls slow considerably when displaying RTL-languages text on Linux|graphics
+[JDK-8195801](https://bugs.openjdk.java.net/browse/JDK-8195801)|Replace jdk.internal.misc.Unsafe with sun.misc.Unsafe in MarlinFX|graphics
+[JDK-8195802](https://bugs.openjdk.java.net/browse/JDK-8195802)|Eliminate use of jdk.internal.misc security utilities in javafx.graphics|graphics
+[JDK-8195806](https://bugs.openjdk.java.net/browse/JDK-8195806)|Eliminate dependency on sun.font.lookup in javafx.graphics|graphics
+[JDK-8195808](https://bugs.openjdk.java.net/browse/JDK-8195808)|Eliminate dependency on sun.print in javafx.graphics|graphics
+[JDK-8196617](https://bugs.openjdk.java.net/browse/JDK-8196617)|FX print tests fail with NPE in some environments|graphics
+[JDK-8198354](https://bugs.openjdk.java.net/browse/JDK-8198354)|[macOS] Corrupt Thai characters displayed in word wrapped label |graphics
+[JDK-8201231](https://bugs.openjdk.java.net/browse/JDK-8201231)|java.lang.NullPointerException at WindowStage.setPlatformEnabled|graphics
+[JDK-8202396](https://bugs.openjdk.java.net/browse/JDK-8202396)|memory leak in ios native imageloader|graphics
+[JDK-8202743](https://bugs.openjdk.java.net/browse/JDK-8202743)|Dashed Stroke randomly painted incorrectly, may freeze application|graphics
+[JDK-8203378](https://bugs.openjdk.java.net/browse/JDK-8203378)|JDK build fails to compile javafx.graphics module-info.java if FX was built with OpenJDK|graphics
+[JDK-8203801](https://bugs.openjdk.java.net/browse/JDK-8203801)|Missing Classpath exception in PrismLoaderGlue.stg file|graphics
+[JDK-8207328](https://bugs.openjdk.java.net/browse/JDK-8207328)|API docs for javafx.css.Stylesheet are inaccurate / wrong|graphics
+[JDK-8209191](https://bugs.openjdk.java.net/browse/JDK-8209191)|[macOS] Distorted complex text rendering|graphics
+[JDK-8088722](https://bugs.openjdk.java.net/browse/JDK-8088722)|GSTPlatform cannot play MP4 files with multiple audio tracks|media
+[JDK-8191446](https://bugs.openjdk.java.net/browse/JDK-8191446)|[Linux] Build and deliver the libav media stubs for openjfx build|media
+[JDK-8193313](https://bugs.openjdk.java.net/browse/JDK-8193313)|MediaPlayer Leaking Native Memory|media
+[JDK-8195803](https://bugs.openjdk.java.net/browse/JDK-8195803)|Eliminate use of sun.nio.ch.DirectBuffer in javafx.media|media
+[JDK-8198316](https://bugs.openjdk.java.net/browse/JDK-8198316)|MediaPlayer crashes when playing m3u8 files on macOS High Sierra 10.13.2|media
+[JDK-8199008](https://bugs.openjdk.java.net/browse/JDK-8199008)|[macOS, Linux] Instantiating MediaPlayer causes CPU usage to be over 100%|media
+[JDK-8199527](https://bugs.openjdk.java.net/browse/JDK-8199527)|Upgrade GStreamer to 1.14|media
+[JDK-8202393](https://bugs.openjdk.java.net/browse/JDK-8202393)|App Transport Security blocks http media on macOS with JDK build using new compilers|media
+[JDK-8191661](https://bugs.openjdk.java.net/browse/JDK-8191661)|FXCanvas on Win32 HiDPI produces wrong results|other
+[JDK-8193910](https://bugs.openjdk.java.net/browse/JDK-8193910)|Version number in cssref.html and introduction_to_fxml.html is wrong|other
+[JDK-8195799](https://bugs.openjdk.java.net/browse/JDK-8195799)|Use System logger instead of platform logger in javafx modules|other
+[JDK-8195800](https://bugs.openjdk.java.net/browse/JDK-8195800)|Eliminate dependency on sun.reflect.misc in javafx modules|other
+[JDK-8195974](https://bugs.openjdk.java.net/browse/JDK-8195974)|Replace use of java.util.logging in javafx with System logger|other
+[JDK-8196297](https://bugs.openjdk.java.net/browse/JDK-8196297)|Remove obsolete JFR logger code|other
+[JDK-8199357](https://bugs.openjdk.java.net/browse/JDK-8199357)|Remove references to applets and Java Web Start from FX|other
+[JDK-8200587](https://bugs.openjdk.java.net/browse/JDK-8200587)|Fix mistakes in FX API docs|other
+[JDK-8202036](https://bugs.openjdk.java.net/browse/JDK-8202036)|Update OpenJFX license files to match OpenJDK|other
+[JDK-8202357](https://bugs.openjdk.java.net/browse/JDK-8202357)|Extra chars in copyright header in ModuleHelper.java|other
+[JDK-8204653](https://bugs.openjdk.java.net/browse/JDK-8204653)|Fix mistakes in FX API docs|other
+[JDK-8204956](https://bugs.openjdk.java.net/browse/JDK-8204956)|Cleanup whitespace after fix for JDK-8200285|other
+[JDK-8207794](https://bugs.openjdk.java.net/browse/JDK-8207794)|FXCanvas does not update x/y of EmbeddedStageInterface when FXCanvas is reparented|other
+[JDK-8208294](https://bugs.openjdk.java.net/browse/JDK-8208294)|install native library fails when jrt protocol is used|other
+[JDK-8180151](https://bugs.openjdk.java.net/browse/JDK-8180151)|JavaFX incorrectly renders scenegraph with two 3D boxes with certain dimensions|scenegraph
+[JDK-8192056](https://bugs.openjdk.java.net/browse/JDK-8192056)|Memory leak when removing javafx.scene.shape.Sphere-objects from a group or container|scenegraph
+[JDK-8205008](https://bugs.openjdk.java.net/browse/JDK-8205008)|GeneralTransform3D transform function with single Vec3d argument wrong results|scenegraph
+[JDK-8207377](https://bugs.openjdk.java.net/browse/JDK-8207377)|Document the behavior of Robot::getPixelColor with HiDPI|scenegraph
+[JDK-8201291](https://bugs.openjdk.java.net/browse/JDK-8201291)|Clicking a JFXPanel having setFocusable(false) causes its processMouseEvent method to loop forever|swing
+[JDK-8088769](https://bugs.openjdk.java.net/browse/JDK-8088769)|Alphachannel for transparent colors is not shown in HtmlEditor|web
+[JDK-8088925](https://bugs.openjdk.java.net/browse/JDK-8088925)|Non opaque background cause NumberFormatException|web
+[JDK-8089375](https://bugs.openjdk.java.net/browse/JDK-8089375)|When WebWorker file is unaccessible, script should fail silently or post meaningful exception|web
+[JDK-8147476](https://bugs.openjdk.java.net/browse/JDK-8147476)|Rendering issues with MathML token elements|web
+[JDK-8193368](https://bugs.openjdk.java.net/browse/JDK-8193368)|[OS X] Remove redundant files|web
+[JDK-8193590](https://bugs.openjdk.java.net/browse/JDK-8193590)|Memory leak when using WebView with Tooltip|web
+[JDK-8194265](https://bugs.openjdk.java.net/browse/JDK-8194265)|Webengine (webkit) crash when reading files using FileReader|web
+[JDK-8194935](https://bugs.openjdk.java.net/browse/JDK-8194935)|Cherry pick GTK WebKit 2.18.5 changes|web
+[JDK-8195804](https://bugs.openjdk.java.net/browse/JDK-8195804)|Remove unused qualified export of sun.net.www from java.base to javafx.web|web
+[JDK-8196011](https://bugs.openjdk.java.net/browse/JDK-8196011)|Intermittent crash when using WebView from JFXPanel application|web
+[JDK-8196374](https://bugs.openjdk.java.net/browse/JDK-8196374)|windows x86 webview-icu isAlphaNumericString crash |web
+[JDK-8196677](https://bugs.openjdk.java.net/browse/JDK-8196677)|Cherry pick GTK WebKit 2.18.6 changes|web
+[JDK-8196968](https://bugs.openjdk.java.net/browse/JDK-8196968)|One time crash on exit in JNIEnv_::CallObjectMethod|web
+[JDK-8197987](https://bugs.openjdk.java.net/browse/JDK-8197987)|Update libxslt to version 1.1.32|web
+[JDK-8199474](https://bugs.openjdk.java.net/browse/JDK-8199474)|Update to 606.1 version of WebKit|web
+[JDK-8200418](https://bugs.openjdk.java.net/browse/JDK-8200418)|"webPage.executeCommand(""removeFormat"", null) removes the style of the body element"|web
+[JDK-8200629](https://bugs.openjdk.java.net/browse/JDK-8200629)|Update SQLite to version 3.23.0|web
+[JDK-8202277](https://bugs.openjdk.java.net/browse/JDK-8202277)|WebView image capture fails with standalone FX due to dependency on javafx.swing|web
+[JDK-8203698](https://bugs.openjdk.java.net/browse/JDK-8203698)|JavaFX WebView crashes when visiting certain web sites|web
+[JDK-8204856](https://bugs.openjdk.java.net/browse/JDK-8204856)|WebEngine document becomes null after PAGE_REPLACED event|web
+[JDK-8206899](https://bugs.openjdk.java.net/browse/JDK-8206899)|DRT crashes randomly when running 'dom/html/level2/html/AppletsCollection.html'|web
+[JDK-8206995](https://bugs.openjdk.java.net/browse/JDK-8206995)|Remove unused WebKit files|web
+[JDK-8208114](https://bugs.openjdk.java.net/browse/JDK-8208114)|Drag and drop of text contents and URL links functionalities are broken in Webview|web
+[JDK-8208622](https://bugs.openjdk.java.net/browse/JDK-8208622)|[WebView] IllegalStateException when invoking print API with html form controls|web
+[JDK-8209049](https://bugs.openjdk.java.net/browse/JDK-8209049)|Cherry pick GTK WebKit 2.20.4 changes|web
+[JDK-8163795](https://bugs.openjdk.java.net/browse/JDK-8163795)|[Windows] Remove call to StretchBlt in native GetScreenCapture method|window-toolkit
+[JDK-8191885](https://bugs.openjdk.java.net/browse/JDK-8191885)|[MacOS] JavaFX main window not resizable coming back from full screen mode in MacOS|window-toolkit
+[JDK-8196031](https://bugs.openjdk.java.net/browse/JDK-8196031)|FX Robot mouseMove fails on Windows 10 1709 with HiDPI|window-toolkit
+[JDK-8199614](https://bugs.openjdk.java.net/browse/JDK-8199614)|[macos] ImageCursor.getBestSize() throws NullPointerException|window-toolkit
+[JDK-8204635](https://bugs.openjdk.java.net/browse/JDK-8204635)|[Linux] getMouseX, getMouseY in gtk GlassRobot.cpp ignore the HiDPI scale|window-toolkit
+[JDK-8207372](https://bugs.openjdk.java.net/browse/JDK-8207372)|Robot.mouseWheel not implemented correctly on Linux, Mac|window-toolkit
+
+
+## List of Enhancements
+
+Issue key|Summary|Subcomponent
+---------|-------|------------
+[JDK-8205919](https://bugs.openjdk.java.net/browse/JDK-8205919)|Create artifacts and functionality to upload them to Maven Central|build
+[JDK-8167096](https://bugs.openjdk.java.net/browse/JDK-8167096)|Add APIs to customize step repeat timing for Spinner control|controls
+[JDK-8177380](https://bugs.openjdk.java.net/browse/JDK-8177380)|Add standard colors in ColorPicker color palette|controls
+[JDK-8186187](https://bugs.openjdk.java.net/browse/JDK-8186187)|Modify return type of public API StyleConverter.getEnumConverter()|controls
+[JDK-8204621](https://bugs.openjdk.java.net/browse/JDK-8204621)|Upgrade MarlinFX to 0.9.2|graphics
+[JDK-8090763](https://bugs.openjdk.java.net/browse/JDK-8090763)|FX Robot API|scenegraph
+[JDK-8130379](https://bugs.openjdk.java.net/browse/JDK-8130379)|Enhance the Bounds class with getCenter method|scenegraph
+[JDK-8195811](https://bugs.openjdk.java.net/browse/JDK-8195811)|Support FX Swing interop using public API|swing
+[JDK-8198654](https://bugs.openjdk.java.net/browse/JDK-8198654)|Switch FX's default GTK version to 3|window-toolkit
=====================================
modules/javafx.graphics/src/main/java/com/sun/marlin/DRendererContext.java
=====================================
@@ -79,6 +79,8 @@ public final class DRendererContext extends ReentrantContext implements MarlinCo
boolean closedPath = false;
// clip rectangle (ymin, ymax, xmin, xmax):
public final double[] clipRect = new double[4];
+ // clip inverse scale (mean) to adjust length checks
+ public double clipInvScale = 0.0d;
// CurveBasicMonotonizer instance
public final CurveBasicMonotonizer monotonizer;
// CurveClipSplitter instance
@@ -159,6 +161,7 @@ public final class DRendererContext extends ReentrantContext implements MarlinCo
stroking = 0;
doClip = false;
closedPath = false;
+ clipInvScale = 0.0d;
// if context is maked as DIRTY:
if (dirty) {
=====================================
modules/javafx.graphics/src/main/java/com/sun/marlin/DStroker.java
=====================================
@@ -139,9 +139,6 @@ public final class DStroker implements DPathConsumer2D, MarlinConst {
* <code>JOIN_MITER</code>, <code>JOIN_ROUND</code> or
* <code>JOIN_BEVEL</code>.
* @param miterLimit the desired miter limit
- * @param scale scaling factor applied to clip boundaries
- * @param rdrOffX renderer's coordinate offset on X axis
- * @param rdrOffY renderer's coordinate offset on Y axis
* @param subdivideCurves true to indicate to subdivide curves, false if dasher does
* @return this instance
*/
@@ -150,9 +147,6 @@ public final class DStroker implements DPathConsumer2D, MarlinConst {
final int capStyle,
final int joinStyle,
final double miterLimit,
- final double scale,
- double rdrOffX,
- double rdrOffY,
final boolean subdivideCurves)
{
this.out = pc2d;
@@ -181,23 +175,21 @@ public final class DStroker implements DPathConsumer2D, MarlinConst {
if ((joinStyle == JOIN_MITER) && (margin < limit)) {
margin = limit;
}
- if (scale != 1.0d) {
- margin *= scale;
- rdrOffX *= scale;
- rdrOffY *= scale;
- }
- // add a small rounding error:
- margin += 1e-3d;
// bounds as half-open intervals: minX <= x < maxX and minY <= y < maxY
// adjust clip rectangle (ymin, ymax, xmin, xmax):
final double[] _clipRect = rdrCtx.clipRect;
- _clipRect[0] -= margin - rdrOffY;
- _clipRect[1] += margin + rdrOffY;
- _clipRect[2] -= margin - rdrOffX;
- _clipRect[3] += margin + rdrOffX;
+ _clipRect[0] -= margin;
+ _clipRect[1] += margin;
+ _clipRect[2] -= margin;
+ _clipRect[3] += margin;
this.clipRect = _clipRect;
+ if (MarlinConst.DO_LOG_CLIP) {
+ MarlinUtils.logInfo("clipRect (stroker): "
+ + Arrays.toString(rdrCtx.clipRect));
+ }
+
// initialize curve splitter here for stroker & dasher:
if (DO_CLIP_SUBDIVIDER) {
subdivide = subdivideCurves;
=====================================
modules/javafx.graphics/src/main/java/com/sun/marlin/DTransformingPathConsumer2D.java
=====================================
@@ -97,17 +97,13 @@ public final class DTransformingPathConsumer2D {
return cpDetector.init(out);
}
- public DPathConsumer2D pathClipper(DPathConsumer2D out,
- final double rdrOffX,
- final double rdrOffY)
+ public DPathConsumer2D pathClipper(DPathConsumer2D out)
{
- return pathClipper.init(out, rdrOffX, rdrOffY);
+ return pathClipper.init(out);
}
public DPathConsumer2D deltaTransformConsumer(DPathConsumer2D out,
- BaseTransform at,
- final double rdrOffX,
- final double rdrOffY)
+ BaseTransform at)
{
if (at == null) {
return out;
@@ -124,44 +120,55 @@ public final class DTransformingPathConsumer2D {
// Scale only
if (rdrCtx.doClip) {
// adjust clip rectangle (ymin, ymax, xmin, xmax):
- adjustClipOffset(rdrCtx.clipRect, rdrOffX, rdrOffY);
- adjustClipScale(rdrCtx.clipRect, mxx, myy);
+ rdrCtx.clipInvScale = adjustClipScale(rdrCtx.clipRect,
+ mxx, myy);
}
return dt_DeltaScaleFilter.init(out, mxx, myy);
}
} else {
if (rdrCtx.doClip) {
// adjust clip rectangle (ymin, ymax, xmin, xmax):
- adjustClipOffset(rdrCtx.clipRect, rdrOffX, rdrOffY);
- adjustClipInverseDelta(rdrCtx.clipRect, mxx, mxy, myx, myy);
+ rdrCtx.clipInvScale = adjustClipInverseDelta(rdrCtx.clipRect,
+ mxx, mxy, myx, myy);
}
return dt_DeltaTransformFilter.init(out, mxx, mxy, myx, myy);
}
}
- private static void adjustClipOffset(final double[] clipRect,
- final double rdrOffX,
- final double rdrOffY)
- {
- clipRect[0] += rdrOffY;
- clipRect[1] += rdrOffY;
- clipRect[2] += rdrOffX;
- clipRect[3] += rdrOffX;
- }
-
- private static void adjustClipScale(final double[] clipRect,
- final double mxx, final double myy)
+ private static double adjustClipScale(final double[] clipRect,
+ final double mxx, final double myy)
{
// Adjust the clipping rectangle (iv_DeltaScaleFilter):
- clipRect[0] /= myy;
- clipRect[1] /= myy;
- clipRect[2] /= mxx;
- clipRect[3] /= mxx;
+ final double scaleY = 1.0d / myy;
+ clipRect[0] *= scaleY;
+ clipRect[1] *= scaleY;
+
+ if (clipRect[1] < clipRect[0]) {
+ double tmp = clipRect[0];
+ clipRect[0] = clipRect[1];
+ clipRect[1] = tmp;
+ }
+
+ final double scaleX = 1.0d / mxx;
+ clipRect[2] *= scaleX;
+ clipRect[3] *= scaleX;
+
+ if (clipRect[3] < clipRect[2]) {
+ double tmp = clipRect[2];
+ clipRect[2] = clipRect[3];
+ clipRect[3] = tmp;
+ }
+
+ if (MarlinConst.DO_LOG_CLIP) {
+ MarlinUtils.logInfo("clipRect (ClipScale): "
+ + Arrays.toString(clipRect));
+ }
+ return 0.5d * (Math.abs(scaleX) + Math.abs(scaleY));
}
- private static void adjustClipInverseDelta(final double[] clipRect,
- final double mxx, final double mxy,
- final double myx, final double myy)
+ private static double adjustClipInverseDelta(final double[] clipRect,
+ final double mxx, final double mxy,
+ final double myx, final double myy)
{
// Adjust the clipping rectangle (iv_DeltaTransformFilter):
final double det = mxx * myy - mxy * myx;
@@ -204,6 +211,16 @@ public final class DTransformingPathConsumer2D {
clipRect[1] = ymax;
clipRect[2] = xmin;
clipRect[3] = xmax;
+
+ if (MarlinConst.DO_LOG_CLIP) {
+ MarlinUtils.logInfo("clipRect (ClipInverseDelta): "
+ + Arrays.toString(clipRect));
+ }
+
+ final double scaleX = Math.sqrt(imxx * imxx + imxy * imxy);
+ final double scaleY = Math.sqrt(imyx * imyx + imyy * imyy);
+
+ return 0.5d * (scaleX + scaleY);
}
public DPathConsumer2D inverseDeltaTransformConsumer(DPathConsumer2D out,
@@ -221,7 +238,7 @@ public final class DTransformingPathConsumer2D {
if (mxx == 1.0d && myy == 1.0d) {
return out;
} else {
- return iv_DeltaScaleFilter.init(out, 1.0d/mxx, 1.0d/myy);
+ return iv_DeltaScaleFilter.init(out, 1.0d / mxx, 1.0d / myy);
}
} else {
final double det = mxx * myy - mxy * myx;
@@ -516,22 +533,9 @@ public final class DTransformingPathConsumer2D {
: new IndexStack(rdrCtx);
}
- PathClipFilter init(final DPathConsumer2D out,
- final double rdrOffX,
- final double rdrOffY)
- {
+ PathClipFilter init(final DPathConsumer2D out) {
this.out = out;
- // add a small rounding error:
- final double margin = 1e-3d;
-
- final double[] _clipRect = this.clipRect;
- // Adjust the clipping rectangle with the renderer offsets
- _clipRect[0] -= margin - rdrOffY;
- _clipRect[1] += margin + rdrOffY;
- _clipRect[2] -= margin - rdrOffX;
- _clipRect[3] += margin + rdrOffX;
-
if (MarlinConst.DO_CLIP_SUBDIVIDER) {
// adjust padded clip rectangle:
curveSplitter.init();
@@ -849,6 +853,11 @@ public final class DTransformingPathConsumer2D {
private static final int MAX_N_CURVES = 3 * 4;
+ private final DRendererContext rdrCtx;
+
+ // scaled length threshold:
+ private double minLength;
+
// clip rectangle (ymin, ymax, xmin, xmax):
final double[] clipRect;
@@ -866,12 +875,23 @@ public final class DTransformingPathConsumer2D {
private final DCurve curve;
CurveClipSplitter(final DRendererContext rdrCtx) {
+ this.rdrCtx = rdrCtx;
this.clipRect = rdrCtx.clipRect;
this.curve = rdrCtx.curve;
}
void init() {
this.init_clipRectPad = true;
+
+ if (DO_CHECK_LENGTH) {
+ this.minLength = (this.rdrCtx.clipInvScale == 0.0d) ? LEN_TH
+ : (LEN_TH * this.rdrCtx.clipInvScale);
+
+ if (MarlinConst.DO_LOG_CLIP) {
+ MarlinUtils.logInfo("CurveClipSplitter.minLength = "
+ + minLength);
+ }
+ }
}
private void initPaddedClip() {
@@ -888,7 +908,7 @@ public final class DTransformingPathConsumer2D {
if (TRACE) {
MarlinUtils.logInfo("clip: X [" + _clipRectPad[2] + " .. " + _clipRectPad[3] +"] "
- + "Y ["+ _clipRectPad[0] + " .. " + _clipRectPad[1] +"]");
+ + "Y [" + _clipRectPad[0] + " .. " + _clipRectPad[1] +"]");
}
}
@@ -901,7 +921,7 @@ public final class DTransformingPathConsumer2D {
MarlinUtils.logInfo("divLine P0(" + x0 + ", " + y0 + ") P1(" + x1 + ", " + y1 + ")");
}
- if (DO_CHECK_LENGTH && DHelpers.fastLineLen(x0, y0, x1, y1) <= LEN_TH) {
+ if (DO_CHECK_LENGTH && DHelpers.fastLineLen(x0, y0, x1, y1) <= minLength) {
return false;
}
@@ -922,7 +942,7 @@ public final class DTransformingPathConsumer2D {
MarlinUtils.logInfo("divQuad P0(" + x0 + ", " + y0 + ") P1(" + x1 + ", " + y1 + ") P2(" + x2 + ", " + y2 + ")");
}
- if (DO_CHECK_LENGTH && DHelpers.fastQuadLen(x0, y0, x1, y1, x2, y2) <= LEN_TH) {
+ if (DO_CHECK_LENGTH && DHelpers.fastQuadLen(x0, y0, x1, y1, x2, y2) <= minLength) {
return false;
}
@@ -945,7 +965,7 @@ public final class DTransformingPathConsumer2D {
MarlinUtils.logInfo("divCurve P0(" + x0 + ", " + y0 + ") P1(" + x1 + ", " + y1 + ") P2(" + x2 + ", " + y2 + ") P3(" + x3 + ", " + y3 + ")");
}
- if (DO_CHECK_LENGTH && DHelpers.fastCurvelen(x0, y0, x1, y1, x2, y2, x3, y3) <= LEN_TH) {
+ if (DO_CHECK_LENGTH && DHelpers.fastCurvelen(x0, y0, x1, y1, x2, y2, x3, y3) <= minLength) {
return false;
}
@@ -973,7 +993,7 @@ public final class DTransformingPathConsumer2D {
outCodeOR, clipRectPad);
if (TRACE) {
- MarlinUtils.logInfo("nSplits: "+ nSplits);
+ MarlinUtils.logInfo("nSplits: " + nSplits);
MarlinUtils.logInfo("subTs: " + Arrays.toString(Arrays.copyOfRange(subTs, 0, nSplits)));
}
if (nSplits == 0) {
=====================================
modules/javafx.graphics/src/main/java/com/sun/marlin/MarlinConst.java
=====================================
@@ -82,9 +82,12 @@ public interface MarlinConst {
static final boolean DO_CLIP_SUBDIVIDER = MarlinProperties.isDoClipSubdivider();
- // flag to enable logs related bounds checks
+ // flag to enable logs related to bounds checks
static final boolean DO_LOG_BOUNDS = ENABLE_LOGS && false;
+ // flag to enable logs related to clip rect
+ static final boolean DO_LOG_CLIP = ENABLE_LOGS && false;
+
// Initial Array sizing (initial context capacity) ~ 450K
// 4096 pixels (width) for initial capacity
=====================================
modules/javafx.graphics/src/main/java/com/sun/marlin/RendererContext.java
=====================================
@@ -79,6 +79,8 @@ public final class RendererContext extends ReentrantContext implements MarlinCon
boolean closedPath = false;
// clip rectangle (ymin, ymax, xmin, xmax):
public final float[] clipRect = new float[4];
+ // clip inverse scale (mean) to adjust length checks
+ public float clipInvScale = 0.0f;
// CurveBasicMonotonizer instance
public final CurveBasicMonotonizer monotonizer;
// CurveClipSplitter instance
@@ -159,6 +161,7 @@ public final class RendererContext extends ReentrantContext implements MarlinCon
stroking = 0;
doClip = false;
closedPath = false;
+ clipInvScale = 0.0f;
// if context is maked as DIRTY:
if (dirty) {
=====================================
modules/javafx.graphics/src/main/java/com/sun/marlin/Stroker.java
=====================================
@@ -141,9 +141,6 @@ public final class Stroker implements PathConsumer2D, MarlinConst {
* <code>JOIN_MITER</code>, <code>JOIN_ROUND</code> or
* <code>JOIN_BEVEL</code>.
* @param miterLimit the desired miter limit
- * @param scale scaling factor applied to clip boundaries
- * @param rdrOffX renderer's coordinate offset on X axis
- * @param rdrOffY renderer's coordinate offset on Y axis
* @param subdivideCurves true to indicate to subdivide curves, false if dasher does
* @return this instance
*/
@@ -152,9 +149,6 @@ public final class Stroker implements PathConsumer2D, MarlinConst {
final int capStyle,
final int joinStyle,
final float miterLimit,
- final float scale,
- double rdrOffX,
- double rdrOffY,
final boolean subdivideCurves)
{
this.out = pc2d;
@@ -183,23 +177,21 @@ public final class Stroker implements PathConsumer2D, MarlinConst {
if ((joinStyle == JOIN_MITER) && (margin < limit)) {
margin = limit;
}
- if (scale != 1.0f) {
- margin *= scale;
- rdrOffX *= scale;
- rdrOffY *= scale;
- }
- // add a small rounding error:
- margin += 1e-3f;
// bounds as half-open intervals: minX <= x < maxX and minY <= y < maxY
// adjust clip rectangle (ymin, ymax, xmin, xmax):
final float[] _clipRect = rdrCtx.clipRect;
- _clipRect[0] -= margin - rdrOffY;
- _clipRect[1] += margin + rdrOffY;
- _clipRect[2] -= margin - rdrOffX;
- _clipRect[3] += margin + rdrOffX;
+ _clipRect[0] -= margin;
+ _clipRect[1] += margin;
+ _clipRect[2] -= margin;
+ _clipRect[3] += margin;
this.clipRect = _clipRect;
+ if (MarlinConst.DO_LOG_CLIP) {
+ MarlinUtils.logInfo("clipRect (stroker): "
+ + Arrays.toString(rdrCtx.clipRect));
+ }
+
// initialize curve splitter here for stroker & dasher:
if (DO_CLIP_SUBDIVIDER) {
subdivide = subdivideCurves;
=====================================
modules/javafx.graphics/src/main/java/com/sun/marlin/TransformingPathConsumer2D.java
=====================================
@@ -98,17 +98,12 @@ public final class TransformingPathConsumer2D {
return cpDetector.init(out);
}
- public PathConsumer2D pathClipper(PathConsumer2D out,
- final float rdrOffX,
- final float rdrOffY)
- {
- return pathClipper.init(out, rdrOffX, rdrOffY);
+ public PathConsumer2D pathClipper(PathConsumer2D out) {
+ return pathClipper.init(out);
}
public PathConsumer2D deltaTransformConsumer(PathConsumer2D out,
- BaseTransform at,
- final float rdrOffX,
- final float rdrOffY)
+ BaseTransform at)
{
if (at == null) {
return out;
@@ -125,44 +120,55 @@ public final class TransformingPathConsumer2D {
// Scale only
if (rdrCtx.doClip) {
// adjust clip rectangle (ymin, ymax, xmin, xmax):
- adjustClipOffset(rdrCtx.clipRect, rdrOffX, rdrOffY);
- adjustClipScale(rdrCtx.clipRect, mxx, myy);
+ rdrCtx.clipInvScale = adjustClipScale(rdrCtx.clipRect,
+ mxx, myy);
}
return dt_DeltaScaleFilter.init(out, mxx, myy);
}
} else {
if (rdrCtx.doClip) {
// adjust clip rectangle (ymin, ymax, xmin, xmax):
- adjustClipOffset(rdrCtx.clipRect, rdrOffX, rdrOffY);
- adjustClipInverseDelta(rdrCtx.clipRect, mxx, mxy, myx, myy);
+ rdrCtx.clipInvScale = adjustClipInverseDelta(rdrCtx.clipRect,
+ mxx, mxy, myx, myy);
}
return dt_DeltaTransformFilter.init(out, mxx, mxy, myx, myy);
}
}
- private static void adjustClipOffset(final float[] clipRect,
- final float rdrOffX,
- final float rdrOffY)
- {
- clipRect[0] += rdrOffY;
- clipRect[1] += rdrOffY;
- clipRect[2] += rdrOffX;
- clipRect[3] += rdrOffX;
- }
-
- private static void adjustClipScale(final float[] clipRect,
- final float mxx, final float myy)
+ private static float adjustClipScale(final float[] clipRect,
+ final float mxx, final float myy)
{
// Adjust the clipping rectangle (iv_DeltaScaleFilter):
- clipRect[0] /= myy;
- clipRect[1] /= myy;
- clipRect[2] /= mxx;
- clipRect[3] /= mxx;
+ final float scaleY = 1.0f / myy;
+ clipRect[0] *= scaleY;
+ clipRect[1] *= scaleY;
+
+ if (clipRect[1] < clipRect[0]) {
+ float tmp = clipRect[0];
+ clipRect[0] = clipRect[1];
+ clipRect[1] = tmp;
+ }
+
+ final float scaleX = 1.0f / mxx;
+ clipRect[2] *= scaleX;
+ clipRect[3] *= scaleX;
+
+ if (clipRect[3] < clipRect[2]) {
+ float tmp = clipRect[2];
+ clipRect[2] = clipRect[3];
+ clipRect[3] = tmp;
+ }
+
+ if (MarlinConst.DO_LOG_CLIP) {
+ MarlinUtils.logInfo("clipRect (ClipScale): "
+ + Arrays.toString(clipRect));
+ }
+ return 0.5f * (Math.abs(scaleX) + Math.abs(scaleY));
}
- private static void adjustClipInverseDelta(final float[] clipRect,
- final float mxx, final float mxy,
- final float myx, final float myy)
+ private static float adjustClipInverseDelta(final float[] clipRect,
+ final float mxx, final float mxy,
+ final float myx, final float myy)
{
// Adjust the clipping rectangle (iv_DeltaTransformFilter):
final float det = mxx * myy - mxy * myx;
@@ -205,6 +211,16 @@ public final class TransformingPathConsumer2D {
clipRect[1] = ymax;
clipRect[2] = xmin;
clipRect[3] = xmax;
+
+ if (MarlinConst.DO_LOG_CLIP) {
+ MarlinUtils.logInfo("clipRect (ClipInverseDelta): "
+ + Arrays.toString(clipRect));
+ }
+
+ final float scaleX = (float) Math.sqrt(imxx * imxx + imxy * imxy);
+ final float scaleY = (float) Math.sqrt(imyx * imyx + imyy * imyy);
+
+ return 0.5f * (scaleX + scaleY);
}
public PathConsumer2D inverseDeltaTransformConsumer(PathConsumer2D out,
@@ -222,7 +238,7 @@ public final class TransformingPathConsumer2D {
if (mxx == 1.0f && myy == 1.0f) {
return out;
} else {
- return iv_DeltaScaleFilter.init(out, 1.0f/mxx, 1.0f/myy);
+ return iv_DeltaScaleFilter.init(out, 1.0f / mxx, 1.0f / myy);
}
} else {
final float det = mxx * myy - mxy * myx;
@@ -516,22 +532,9 @@ public final class TransformingPathConsumer2D {
: new IndexStack(rdrCtx);
}
- PathClipFilter init(final PathConsumer2D out,
- final double rdrOffX,
- final double rdrOffY)
- {
+ PathClipFilter init(final PathConsumer2D out) {
this.out = out;
- // add a small rounding error:
- final float margin = 1e-3f;
-
- final float[] _clipRect = this.clipRect;
- // Adjust the clipping rectangle with the renderer offsets
- _clipRect[0] -= margin - rdrOffY;
- _clipRect[1] += margin + rdrOffY;
- _clipRect[2] -= margin - rdrOffX;
- _clipRect[3] += margin + rdrOffX;
-
if (MarlinConst.DO_CLIP_SUBDIVIDER) {
// adjust padded clip rectangle:
curveSplitter.init();
@@ -849,6 +852,11 @@ public final class TransformingPathConsumer2D {
private static final int MAX_N_CURVES = 3 * 4;
+ private final RendererContext rdrCtx;
+
+ // scaled length threshold:
+ private float minLength;
+
// clip rectangle (ymin, ymax, xmin, xmax):
final float[] clipRect;
@@ -866,12 +874,23 @@ public final class TransformingPathConsumer2D {
private final Curve curve;
CurveClipSplitter(final RendererContext rdrCtx) {
+ this.rdrCtx = rdrCtx;
this.clipRect = rdrCtx.clipRect;
this.curve = rdrCtx.curve;
}
void init() {
this.init_clipRectPad = true;
+
+ if (DO_CHECK_LENGTH) {
+ this.minLength = (this.rdrCtx.clipInvScale == 0.0f) ? LEN_TH
+ : (LEN_TH * this.rdrCtx.clipInvScale);
+
+ if (MarlinConst.DO_LOG_CLIP) {
+ MarlinUtils.logInfo("CurveClipSplitter.minLength = "
+ + minLength);
+ }
+ }
}
private void initPaddedClip() {
@@ -888,7 +907,7 @@ public final class TransformingPathConsumer2D {
if (TRACE) {
MarlinUtils.logInfo("clip: X [" + _clipRectPad[2] + " .. " + _clipRectPad[3] +"] "
- + "Y ["+ _clipRectPad[0] + " .. " + _clipRectPad[1] +"]");
+ + "Y [" + _clipRectPad[0] + " .. " + _clipRectPad[1] +"]");
}
}
@@ -901,7 +920,7 @@ public final class TransformingPathConsumer2D {
MarlinUtils.logInfo("divLine P0(" + x0 + ", " + y0 + ") P1(" + x1 + ", " + y1 + ")");
}
- if (DO_CHECK_LENGTH && Helpers.fastLineLen(x0, y0, x1, y1) <= LEN_TH) {
+ if (DO_CHECK_LENGTH && Helpers.fastLineLen(x0, y0, x1, y1) <= minLength) {
return false;
}
@@ -922,7 +941,7 @@ public final class TransformingPathConsumer2D {
MarlinUtils.logInfo("divQuad P0(" + x0 + ", " + y0 + ") P1(" + x1 + ", " + y1 + ") P2(" + x2 + ", " + y2 + ")");
}
- if (DO_CHECK_LENGTH && Helpers.fastQuadLen(x0, y0, x1, y1, x2, y2) <= LEN_TH) {
+ if (DO_CHECK_LENGTH && Helpers.fastQuadLen(x0, y0, x1, y1, x2, y2) <= minLength) {
return false;
}
@@ -945,7 +964,7 @@ public final class TransformingPathConsumer2D {
MarlinUtils.logInfo("divCurve P0(" + x0 + ", " + y0 + ") P1(" + x1 + ", " + y1 + ") P2(" + x2 + ", " + y2 + ") P3(" + x3 + ", " + y3 + ")");
}
- if (DO_CHECK_LENGTH && Helpers.fastCurvelen(x0, y0, x1, y1, x2, y2, x3, y3) <= LEN_TH) {
+ if (DO_CHECK_LENGTH && Helpers.fastCurvelen(x0, y0, x1, y1, x2, y2, x3, y3) <= minLength) {
return false;
}
@@ -973,7 +992,7 @@ public final class TransformingPathConsumer2D {
outCodeOR, clipRectPad);
if (TRACE) {
- MarlinUtils.logInfo("nSplits: "+ nSplits);
+ MarlinUtils.logInfo("nSplits: " + nSplits);
MarlinUtils.logInfo("subTs: " + Arrays.toString(Arrays.copyOfRange(subTs, 0, nSplits)));
}
if (nSplits == 0) {
=====================================
modules/javafx.graphics/src/main/java/com/sun/marlin/Version.java
=====================================
@@ -27,7 +27,7 @@ package com.sun.marlin;
public final class Version {
- private static final String VERSION = "marlinFX-0.9.2-Unsafe-OpenJDK";
+ private static final String VERSION = "marlinFX-0.9.3-Unsafe-OpenJDK";
public static String getVersion() {
return VERSION;
=====================================
modules/javafx.graphics/src/main/java/com/sun/prism/impl/shape/DMarlinPrismUtils.java
=====================================
@@ -38,7 +38,9 @@ import com.sun.marlin.DPathConsumer2D;
import com.sun.marlin.DRendererContext;
import com.sun.marlin.DStroker;
import com.sun.marlin.DTransformingPathConsumer2D;
+import com.sun.marlin.MarlinUtils;
import com.sun.prism.BasicStroke;
+import java.util.Arrays;
public final class DMarlinPrismUtils {
@@ -86,7 +88,6 @@ public final class DMarlinPrismUtils {
int dashLen = -1;
boolean recycleDashes = false;
- double scale = 1.0d;
double width = lineWidth;
float[] dashes = stroke.getDashArray();
double[] dashesD = null;
@@ -112,7 +113,7 @@ public final class DMarlinPrismUtils {
// a*b == -c*d && a*a+c*c == b*b+d*d. In the actual check below, we
// leave a bit of room for error.
if (nearZero(a*b + c*d) && nearZero(a*a + c*c - (b*b + d*d))) {
- scale = Math.sqrt(a*a + c*c);
+ final double scale = Math.sqrt(a*a + c*c);
if (dashesD != null) {
for (int i = 0; i < dashLen; i++) {
@@ -147,15 +148,6 @@ public final class DMarlinPrismUtils {
tx = null;
}
- // Get renderer offsets:
- double rdrOffX = 0.0d, rdrOffY = 0.0d;
-
- if (rdrCtx.doClip && (tx != null)) {
- final DMarlinRenderer renderer = (DMarlinRenderer)out;
- rdrOffX = renderer.getOffsetX();
- rdrOffY = renderer.getOffsetY();
- }
-
// Prepare the pipeline:
DPathConsumer2D pc = out;
@@ -173,12 +165,12 @@ public final class DMarlinPrismUtils {
}
// deltaTransformConsumer may adjust the clip rectangle:
- pc = transformerPC2D.deltaTransformConsumer(pc, strokerTx, rdrOffX, rdrOffY);
+ pc = transformerPC2D.deltaTransformConsumer(pc, strokerTx);
// stroker will adjust the clip rectangle (width / miter limit):
pc = rdrCtx.stroker.init(pc, width, stroke.getEndCap(),
stroke.getLineJoin(), stroke.getMiterLimit(),
- scale, rdrOffX, rdrOffY, (dashesD == null));
+ (dashesD == null));
// Curve Monotizer:
rdrCtx.monotonizer.init(width);
@@ -241,10 +233,26 @@ public final class DMarlinPrismUtils {
// Define the initial clip bounds:
final double[] clipRect = rdrCtx.clipRect;
- clipRect[0] = clip.y;
- clipRect[1] = clip.y + clip.height;
- clipRect[2] = clip.x;
- clipRect[3] = clip.x + clip.width;
+ // Adjust the clipping rectangle with the renderer offsets
+ final double rdrOffX = renderer.getOffsetX();
+ final double rdrOffY = renderer.getOffsetY();
+
+ // add a small rounding error:
+ final double margin = 1e-3d;
+
+ clipRect[0] = clip.y
+ - margin + rdrOffY;
+ clipRect[1] = clip.y + clip.height
+ + margin + rdrOffY;
+ clipRect[2] = clip.x
+ - margin + rdrOffX;
+ clipRect[3] = clip.x + clip.width
+ + margin + rdrOffX;
+
+ if (MarlinConst.DO_LOG_CLIP) {
+ MarlinUtils.logInfo("clipRect (clip): "
+ + Arrays.toString(rdrCtx.clipRect));
+ }
// Enable clipping:
rdrCtx.doClip = true;
@@ -267,14 +275,11 @@ public final class DMarlinPrismUtils {
final DTransformingPathConsumer2D transformerPC2D = rdrCtx.transformerPC2D;
if (DO_CLIP_FILL && rdrCtx.doClip) {
- double rdrOffX = renderer.getOffsetX();
- double rdrOffY = renderer.getOffsetY();
-
if (DO_TRACE_PATH) {
// trace Filler:
pc = rdrCtx.transformerPC2D.traceFiller(pc);
}
- pc = rdrCtx.transformerPC2D.pathClipper(pc, rdrOffX, rdrOffY);
+ pc = rdrCtx.transformerPC2D.pathClipper(pc);
}
if (DO_TRACE_PATH) {
=====================================
modules/javafx.graphics/src/main/java/com/sun/prism/impl/shape/MarlinPrismUtils.java
=====================================
@@ -35,10 +35,12 @@ import com.sun.javafx.geom.transform.BaseTransform;
import com.sun.marlin.MarlinConst;
import com.sun.marlin.MarlinProperties;
import com.sun.marlin.MarlinRenderer;
+import com.sun.marlin.MarlinUtils;
import com.sun.marlin.RendererContext;
import com.sun.marlin.Stroker;
import com.sun.marlin.TransformingPathConsumer2D;
import com.sun.prism.BasicStroke;
+import java.util.Arrays;
public final class MarlinPrismUtils {
@@ -86,7 +88,6 @@ public final class MarlinPrismUtils {
int dashLen = -1;
boolean recycleDashes = false;
- float scale = 1.0f;
float width = lineWidth;
float[] dashes = stroke.getDashArray();
float dashphase = stroke.getDashPhase();
@@ -104,7 +105,7 @@ public final class MarlinPrismUtils {
// a*b == -c*d && a*a+c*c == b*b+d*d. In the actual check below, we
// leave a bit of room for error.
if (nearZero(a*b + c*d) && nearZero(a*a + c*c - (b*b + d*d))) {
- scale = (float) Math.sqrt(a*a + c*c);
+ final float scale = (float) Math.sqrt(a*a + c*c);
if (dashes != null) {
recycleDashes = true;
@@ -142,15 +143,6 @@ public final class MarlinPrismUtils {
tx = null;
}
- // Get renderer offsets:
- float rdrOffX = 0.0f, rdrOffY = 0.0f;
-
- if (rdrCtx.doClip && (tx != null)) {
- final MarlinRenderer renderer = (MarlinRenderer)out;
- rdrOffX = renderer.getOffsetX();
- rdrOffY = renderer.getOffsetY();
- }
-
// Prepare the pipeline:
PathConsumer2D pc = out;
@@ -168,12 +160,12 @@ public final class MarlinPrismUtils {
}
// deltaTransformConsumer may adjust the clip rectangle:
- pc = transformerPC2D.deltaTransformConsumer(pc, strokerTx, rdrOffX, rdrOffY);
+ pc = transformerPC2D.deltaTransformConsumer(pc, strokerTx);
// stroker will adjust the clip rectangle (width / miter limit):
pc = rdrCtx.stroker.init(pc, width, stroke.getEndCap(),
stroke.getLineJoin(), stroke.getMiterLimit(),
- scale, rdrOffX, rdrOffY, (dashes == null));
+ (dashes == null));
// Curve Monotizer:
rdrCtx.monotonizer.init(width);
@@ -239,10 +231,26 @@ public final class MarlinPrismUtils {
// Define the initial clip bounds:
final float[] clipRect = rdrCtx.clipRect;
- clipRect[0] = clip.y;
- clipRect[1] = clip.y + clip.height;
- clipRect[2] = clip.x;
- clipRect[3] = clip.x + clip.width;
+ // Adjust the clipping rectangle with the renderer offsets
+ final float rdrOffX = renderer.getOffsetX();
+ final float rdrOffY = renderer.getOffsetY();
+
+ // add a small rounding error:
+ final float margin = 1e-3f;
+
+ clipRect[0] = clip.y
+ - margin + rdrOffY;
+ clipRect[1] = clip.y + clip.height
+ + margin + rdrOffY;
+ clipRect[2] = clip.x
+ - margin + rdrOffX;
+ clipRect[3] = clip.x + clip.width
+ + margin + rdrOffX;
+
+ if (MarlinConst.DO_LOG_CLIP) {
+ MarlinUtils.logInfo("clipRect (clip): "
+ + Arrays.toString(rdrCtx.clipRect));
+ }
// Enable clipping:
rdrCtx.doClip = true;
@@ -265,14 +273,11 @@ public final class MarlinPrismUtils {
final TransformingPathConsumer2D transformerPC2D = rdrCtx.transformerPC2D;
if (DO_CLIP_FILL && rdrCtx.doClip) {
- float rdrOffX = renderer.getOffsetX();
- float rdrOffY = renderer.getOffsetY();
-
if (DO_TRACE_PATH) {
// trace Filler:
pc = rdrCtx.transformerPC2D.traceFiller(pc);
}
- pc = rdrCtx.transformerPC2D.pathClipper(pc, rdrOffX, rdrOffY);
+ pc = rdrCtx.transformerPC2D.pathClipper(pc);
}
if (DO_TRACE_PATH) {
=====================================
modules/javafx.media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-bad/gst/aiff/aiffparse.c
=====================================
@@ -1343,6 +1343,14 @@ iterate_adapter:
if (desired >= aiff->bytes_per_sample)
desired -= (desired % aiff->bytes_per_sample);
+#ifdef GSTREAMER_LITE
+ if (desired == 0) {
+ GST_ELEMENT_ERROR (aiff, STREAM, DEMUX, (NULL),
+ ("Invalid stream"));
+ return GST_FLOW_ERROR;
+ }
+#endif // GSTREAMER_LITE
+
GST_LOG_OBJECT (aiff, "Fetching %" G_GINT64_FORMAT " bytes of data "
"from the sinkpad", desired);
=====================================
modules/javafx.media/src/main/native/gstreamer/gstreamer-lite/gst-plugins-good/gst/wavparse/gstwavparse.c
=====================================
@@ -2064,6 +2064,14 @@ iterate_adapter:
if (desired >= wav->blockalign && wav->blockalign > 0)
desired -= (desired % wav->blockalign);
+#ifdef GSTREAMER_LITE
+ if (desired == 0) {
+ GST_ELEMENT_ERROR (wav, STREAM, DEMUX, (NULL),
+ ("Invalid stream"));
+ return GST_FLOW_ERROR;
+ }
+#endif // GSTREAMER_LITE
+
GST_LOG_OBJECT (wav, "Fetching %" G_GINT64_FORMAT " bytes of data "
"from the sinkpad", desired);
=====================================
modules/javafx.web/src/main/java/com/sun/javafx/webkit/theme/RenderThemeImpl.java
=====================================
@@ -313,26 +313,29 @@ public final class RenderThemeImpl extends RenderTheme {
if (ctrl.isManaged()) {
ctrl.setManaged(false);
}
- if (type == WidgetType.SLIDER) {
- Slider slider = (Slider)ctrl;
- extParams.order(ByteOrder.nativeOrder());
- slider.setOrientation(extParams.getInt()==0
- ? Orientation.HORIZONTAL
- : Orientation.VERTICAL);
- slider.setMax(extParams.getFloat());
- slider.setMin(extParams.getFloat());
- slider.setValue(extParams.getFloat());
- } else if (type == WidgetType.PROGRESSBAR) {
- ProgressBar progress = (ProgressBar)ctrl;
- extParams.order(ByteOrder.nativeOrder());
- progress.setProgress(extParams.getInt() == 1
- ? extParams.getFloat()
- : progress.INDETERMINATE_PROGRESS);
- } else if (type == WidgetType.METER) {
- ProgressBar progress = (ProgressBar) ctrl;
- extParams.order(ByteOrder.nativeOrder());
- progress.setProgress(extParams.getFloat());
- progress.setStyle(getMeterStyle(extParams.getInt()));
+
+ if (extParams != null) {
+ if (type == WidgetType.SLIDER) {
+ Slider slider = (Slider)ctrl;
+ extParams.order(ByteOrder.nativeOrder());
+ slider.setOrientation(extParams.getInt()==0
+ ? Orientation.HORIZONTAL
+ : Orientation.VERTICAL);
+ slider.setMax(extParams.getFloat());
+ slider.setMin(extParams.getFloat());
+ slider.setValue(extParams.getFloat());
+ } else if (type == WidgetType.PROGRESSBAR) {
+ ProgressBar progress = (ProgressBar)ctrl;
+ extParams.order(ByteOrder.nativeOrder());
+ progress.setProgress(extParams.getInt() == 1
+ ? extParams.getFloat()
+ : progress.INDETERMINATE_PROGRESS);
+ } else if (type == WidgetType.METER) {
+ ProgressBar progress = (ProgressBar) ctrl;
+ extParams.order(ByteOrder.nativeOrder());
+ progress.setProgress(extParams.getFloat());
+ progress.setStyle(getMeterStyle(extParams.getInt()));
+ }
}
return new FormControlRef(fc);
}
=====================================
modules/javafx.web/src/main/native/Source/WebCore/platform/graphics/java/ImageBufferJava.cpp
=====================================
@@ -491,7 +491,7 @@ Vector<uint8_t> ImageBuffer::toData(const String& mimeType, std::optional<double
static jmethodID midToData = env->GetMethodID(
PG_GetImageClass(env),
"toData",
- "(Ljava/lang/String;)Ljava/lang/String;");
+ "(Ljava/lang/String;)[B");
ASSERT(midToData);
JLocalRef<jbyteArray> jdata((jbyteArray)env->CallObjectMethod(
=====================================
modules/javafx.web/src/main/native/Source/WebCore/platform/java/RenderThemeJava.cpp
=====================================
@@ -177,7 +177,7 @@ bool RenderThemeJava::paintWidget(
JNIEnv* env = WebCore_GetJavaEnv();
WTF::Vector<jbyte> extParams;
- if (JNI_EXPAND(SLIDER) == widgetIndex) {
+ if (JNI_EXPAND(SLIDER) == widgetIndex && is<RenderSlider>(object)) {
HTMLInputElement& input = downcast<RenderSlider>(object).element();
extParams.grow(sizeof(jint) + 3 * sizeof(jfloat));
@@ -200,24 +200,26 @@ bool RenderThemeJava::paintWidget(
memcpy(data, &valueAsNumber, sizeof(valueAsNumber));
} else if (JNI_EXPAND(PROGRESS_BAR) == widgetIndex) {
#if ENABLE(PROGRESS_ELEMENT)
- RenderProgress& renderProgress = downcast<RenderProgress>(object);
+ if (is<RenderProgress>(object)) {
+ RenderProgress& renderProgress = downcast<RenderProgress>(object);
- extParams.grow(sizeof(jint) + 3*sizeof(jfloat));
- jbyte *data = extParams.data();
- auto isDeterminate = jint(renderProgress.isDeterminate() ? 1 : 0);
- memcpy(data, &isDeterminate, sizeof(isDeterminate));
- data += sizeof(jint);
+ extParams.grow(sizeof(jint) + 3*sizeof(jfloat));
+ jbyte *data = extParams.data();
+ auto isDeterminate = jint(renderProgress.isDeterminate() ? 1 : 0);
+ memcpy(data, &isDeterminate, sizeof(isDeterminate));
+ data += sizeof(jint);
- auto position = jfloat(renderProgress.position());
- memcpy(data, &position, sizeof(position));
- data += sizeof(jfloat);
+ auto position = jfloat(renderProgress.position());
+ memcpy(data, &position, sizeof(position));
+ data += sizeof(jfloat);
- auto animationProgress = jfloat(renderProgress.animationProgress());
- memcpy(data, &animationProgress, sizeof(animationProgress));
- data += sizeof(jfloat);
+ auto animationProgress = jfloat(renderProgress.animationProgress());
+ memcpy(data, &animationProgress, sizeof(animationProgress));
+ data += sizeof(jfloat);
- auto animationStartTime = jfloat(renderProgress.animationStartTime());
- memcpy(data, &animationStartTime, sizeof(animationStartTime));
+ auto animationStartTime = jfloat(renderProgress.animationStartTime());
+ memcpy(data, &animationStartTime, sizeof(animationStartTime));
+ }
#endif
#if ENABLE(METER_ELEMENT)
} else if (JNI_EXPAND(METER) == widgetIndex) {
@@ -228,7 +230,7 @@ bool RenderThemeJava::paintWidget(
value = meter->valueRatio();
region = meter->gaugeRegion();
#if ENABLE(PROGRESS_ELEMENT)
- } else if (object.isProgress()) {
+ } else if (is<RenderProgress>(object>)) {
RenderProgress& renderProgress = downcast<RenderProgress>(object);
value = jfloat(renderProgress.position());
#endif
=====================================
modules/javafx.web/src/shims/java/com/sun/javafx/webkit/prism/PrismInvokerShim.java
=====================================
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2018, 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 com.sun.javafx.webkit.prism;
+
+public final class PrismInvokerShim {
+ public static void runOnRenderThread(final Runnable r) {
+ PrismInvoker.runOnRenderThread(r);
+ }
+}
+
=====================================
modules/jdk.packager/src/main/java/com/sun/javafx/tools/packager/DeployParams.java
=====================================
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, 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
@@ -495,6 +495,39 @@ public class DeployParams extends CommonParams {
path);
}
+ public static void validateAppName(String s) throws PackagerException {
+ if (s == null || s.length() == 0) {
+ // empty or null string - there is no unsupported char
+ return;
+ }
+ int last = s.length() - 1;
+
+ char fc = s.charAt(0);
+ char lc = s.charAt(last);
+
+ // illegal to end in backslash escape char
+ if (lc == '\\') {
+ throw new PackagerException("ERR_InvalidCharacterInArgument", "-name");
+ }
+
+ for (int i = 0; i < s.length(); i++) {
+ char a = s.charAt(i);
+ // We check for ASCII codes first which we accept. If check fails,
+ // then check if it is acceptable extended ASCII or unicode character.
+ if (a < ' ' || a > '~' || a == '%') {
+ // Reject '%', whitespaces and ISO Control.
+ // Accept anything else including special characters like copyright
+ // symbols. Note: space will be included by ASCII check above,
+ // but other whitespace like tabs or new line will be ignored.
+ if (Character.isISOControl(a) || Character.isWhitespace(a) || a == '%') {
+ throw new PackagerException("ERR_InvalidCharacterInArgument", "-name");
+ }
+ }
+ if (a == '"') {
+ throw new PackagerException("ERR_InvalidCharacterInArgument", "-name");
+ }
+ }
+ }
@Override
public void validate() throws PackagerException {
@@ -514,6 +547,7 @@ public class DeployParams extends CommonParams {
throw new PackagerException("ERR_MissingArgument", "-appclass");
}
}
+ validateAppName(appName);
}
public boolean validateForJNLP() {
=====================================
modules/jdk.packager/src/main/java/com/sun/javafx/tools/packager/MakeAllParams.java
=====================================
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2018, 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
@@ -67,5 +67,6 @@ public class MakeAllParams {
}
public void validate() throws PackagerException {
+ DeployParams.validateAppName(appName);
}
}
=====================================
modules/jdk.packager/src/main/resources/com/sun/javafx/tools/packager/Bundle.properties
=====================================
@@ -207,6 +207,7 @@ ERR_InvalidStoreFile=Error: Invalid keystore file: {0}
ERR_SignFailed=Error: Signing failed
ERR_MissingAppResources=Error: No application jars found
ERR_NoEmbeddedDT=Error: -includedt requires the java deployment toolkit, which is not included in this distribution
+ERR_InvalidCharacterInArgument=Error: Invalid character found in {0} argument
MSG_UpdatingJar=Updating jar file\: {0}
MSG_NoJREPackaged=Package is configured to ship without a JRE.
=====================================
modules/jdk.packager/src/test/java/com/sun/javafx/tools/packager/DeployParamsTest.java
=====================================
@@ -0,0 +1,100 @@
+/*
+ * Copyright (c) 2018, 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 com.sun.javafx.tools.packager;
+
+import java.io.File;
+import static org.junit.Assert.*;
+import org.junit.Test;
+import org.junit.Before;
+import org.junit.After;
+
+public class DeployParamsTest {
+
+ private File testRoot = null;
+
+ @Before
+ public void setUp() {
+ testRoot = new File("build/tmp/tests/deployParamsTest");
+ testRoot.mkdirs();
+ }
+
+ @After
+ public void tearDown() {
+ if (testRoot != null) {
+ testRoot.delete();
+ }
+ }
+
+ @Test
+ public void testValidateAppName1() throws PackagerException {
+ DeployParams params = getParamsAppName();
+
+ params.setAppName("Test");
+ params.validate();
+
+ params.setAppName("Test Name");
+ params.validate();
+
+ params.setAppName("Test - Name !!!");
+ params.validate();
+ }
+
+ @Test
+ public void testValidateAppName2() throws PackagerException {
+ DeployParams params = getParamsAppName();
+
+ params.setAppName("Test\nName");
+ appName2TestHelper(params);
+
+ params.setAppName("Test\rName");
+ appName2TestHelper(params);
+
+ params.setAppName("TestName\\");
+ appName2TestHelper(params);
+
+ params.setAppName("Test \" Name");
+ appName2TestHelper(params);
+ }
+
+ private void appName2TestHelper(DeployParams params) {
+ try {
+ params.validate();
+ fail("An exception should have been thrown");
+ } catch (PackagerException pe) { }
+ }
+
+ // Returns deploy params initialized to pass all validation, except for
+ // app name
+ private DeployParams getParamsAppName() {
+ DeployParams params = new DeployParams();
+ params.setOutdir(testRoot);
+ params.setOutfile("Test");
+ params.addResource(testRoot, new File(testRoot, "test.jar"));
+ params.setApplicationClass("TestClass");
+ return params;
+ }
+
+}
=====================================
tests/system/src/test/java/test/com/sun/marlin/ScaleClipTest.java
=====================================
@@ -0,0 +1,280 @@
+/*
+ * Copyright (c) 2018, 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 test.com.sun.marlin;
+
+import java.awt.Color;
+import java.io.File;
+import java.io.IOException;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicBoolean;
+import javafx.application.Application;
+import javafx.application.Platform;
+import javafx.geometry.Rectangle2D;
+import javafx.scene.Group;
+import javafx.scene.Scene;
+import javafx.scene.SnapshotParameters;
+import javafx.scene.image.PixelReader;
+import javafx.scene.image.WritableImage;
+import javafx.scene.shape.LineTo;
+import javafx.scene.shape.MoveTo;
+import javafx.scene.shape.Path;
+import javafx.scene.shape.StrokeLineCap;
+import javafx.scene.shape.StrokeLineJoin;
+import javafx.scene.transform.Transform;
+import javafx.stage.Stage;
+import junit.framework.AssertionFailedError;
+import org.junit.AfterClass;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import test.util.Util;
+import static test.util.Util.TIMEOUT;
+
+/**
+ * Scaled Line Clipping rendering test
+ */
+public class ScaleClipTest {
+
+ static final int SIZE = 50;
+
+ enum SCALE_MODE {
+ ORTHO,
+ NON_ORTHO,
+ COMPLEX
+ };
+
+ // Used to launch the application before running any test
+ private static final CountDownLatch launchLatch = new CountDownLatch(1);
+
+ // Singleton Application instance
+ static MyApp myApp;
+
+ // Application class. An instance is created and initialized before running
+ // the first test, and it lives through the execution of all tests.
+ public static class MyApp extends Application {
+
+ Stage stage = null;
+
+ public MyApp() {
+ super();
+ }
+
+ @Override
+ public void init() {
+ ScaleClipTest.myApp = this;
+ }
+
+ @Override
+ public void start(Stage primaryStage) throws Exception {
+ this.stage = primaryStage;
+
+ stage.setScene(new Scene(new Group()));
+ stage.setTitle("ScaleClipTest");
+ stage.show();
+
+ launchLatch.countDown();
+ }
+ }
+
+ @BeforeClass
+ public static void setupOnce() {
+ // Start the Application
+ new Thread(() -> Application.launch(MyApp.class, (String[]) null)).start();
+
+ try {
+ if (!launchLatch.await(TIMEOUT, TimeUnit.MILLISECONDS)) {
+ throw new AssertionFailedError("Timeout waiting for Application to launch");
+ }
+
+ } catch (InterruptedException ex) {
+ AssertionFailedError err = new AssertionFailedError("Unexpected exception");
+ err.initCause(ex);
+ throw err;
+ }
+
+ assertEquals(0, launchLatch.getCount());
+
+ System.out.println("ScaleClipTest: size = " + SIZE);
+ }
+
+ @AfterClass
+ public static void teardownOnce() {
+ Platform.exit();
+ }
+
+ @Test(timeout = 10000)
+ public void TestNegativeScaleClipPath() throws InterruptedException {
+ final AtomicBoolean fail = new AtomicBoolean();
+
+ for (SCALE_MODE mode : SCALE_MODE.values()) {
+ Util.runAndWait(() -> {
+ try {
+ testNegativeScale(mode);
+ } catch (AssertionError ae) {
+ System.err.println("testNegativeScale[" + mode + "] failed:");
+ ae.printStackTrace();
+ fail.set(true);
+ }
+ });
+ }
+
+ // Fail at the end:
+ if (fail.get()) {
+ fail("TestNegativeScaleClipPath has failures.");
+ }
+ }
+
+ @Test(timeout = 10000)
+ public void TestMarginScaleClipPath() throws InterruptedException {
+ final AtomicBoolean fail = new AtomicBoolean();
+
+ // testMarginScale:
+ for (SCALE_MODE mode : SCALE_MODE.values()) {
+ Util.runAndWait(() -> {
+ try {
+ testMarginScale(mode);
+ } catch (AssertionError ae) {
+ System.err.println("testMarginScale[" + mode + "] failed:");
+ ae.printStackTrace();
+ fail.set(true);
+ }
+ });
+ }
+
+ // Fail at the end:
+ if (fail.get()) {
+ fail("TestMarginScaleClipPath has failures.");
+ }
+ }
+
+ private void testNegativeScale(final SCALE_MODE mode) {
+
+ // Bug in TransformingPathConsumer2D.adjustClipScale()
+ // non ortho scale only
+ final double scale = -1.0;
+
+ final Transform t;
+ switch (mode) {
+ default:
+ case ORTHO:
+ t = Transform.scale(scale, scale);
+ break;
+ case NON_ORTHO:
+ t = Transform.scale(scale, scale + 1e-5);
+ break;
+ case COMPLEX:
+ t = Transform.affine(scale, 1e-4, 1e-4, scale, 0, 0);
+ break;
+ }
+
+ final Path p = new Path();
+ p.getElements().addAll(
+ new MoveTo(scale * 10, scale * 10),
+ new LineTo(scale * (SIZE - 10), scale * (SIZE - 10))
+ );
+
+ // Set cap/join to reduce clip margin:
+ p.setFill(null);
+ p.setStroke(javafx.scene.paint.Color.BLACK);
+ p.setStrokeWidth(2);
+ p.setStrokeLineCap(StrokeLineCap.BUTT);
+ p.setStrokeLineJoin(StrokeLineJoin.BEVEL);
+
+ Scene scene = new Scene(new Group(p));
+ myApp.stage.setScene(scene);
+
+ final SnapshotParameters sp = new SnapshotParameters();
+ sp.setViewport(new Rectangle2D(0, 0, SIZE, SIZE));
+ sp.setTransform(t);
+
+ final WritableImage img = scene.getRoot().snapshot(sp, new WritableImage(SIZE, SIZE));
+
+ // Check image:
+ // 25, 25 = black
+ checkPixel(img.getPixelReader(), 25, 25, Color.BLACK.getRGB());
+ }
+
+ private static void testMarginScale(final SCALE_MODE mode) {
+
+ // Bug in Stroker.init()
+ // ortho scale only: scale used twice !
+ final double scale = 1e-2;
+
+ final Transform t;
+ switch (mode) {
+ default:
+ case ORTHO:
+ t = Transform.scale(scale, scale);
+ break;
+ case NON_ORTHO:
+ t = Transform.scale(scale, scale + 1e-5);
+ break;
+ case COMPLEX:
+ t = Transform.affine(scale, 1e-4, 1e-4, scale, 0, 0);
+ break;
+ }
+
+ final double invScale = 1.0 / scale;
+
+ final Path p = new Path();
+ p.getElements().addAll(
+ new MoveTo(invScale * -0.5, invScale * 10),
+ new LineTo(invScale * -0.5, invScale * (SIZE - 10))
+ );
+
+ // Set cap/join to reduce clip margin:
+ p.setFill(null);
+ p.setStroke(javafx.scene.paint.Color.BLACK);
+ p.setStrokeWidth(3.0 * invScale);
+ p.setStrokeLineCap(StrokeLineCap.BUTT);
+ p.setStrokeLineJoin(StrokeLineJoin.BEVEL);
+
+ Scene scene = new Scene(new Group(p));
+ myApp.stage.setScene(scene);
+
+ final SnapshotParameters sp = new SnapshotParameters();
+ sp.setViewport(new Rectangle2D(0, 0, SIZE, SIZE));
+ sp.setTransform(t);
+
+ final WritableImage img = scene.getRoot().snapshot(sp, new WritableImage(SIZE, SIZE));
+
+ // Check image:
+ // 0, 25 = black
+ checkPixel(img.getPixelReader(), 0, 25, Color.BLACK.getRGB());
+ }
+
+ private static void checkPixel(final PixelReader pr,
+ final int x, final int y,
+ final int expected) {
+
+ final int rgb = pr.getArgb(x, y);
+ if (rgb != expected) {
+ fail("bad pixel at (" + x + ", " + y
+ + ") = " + rgb + " expected: " + expected);
+ }
+ }
+}
View it on GitLab: https://salsa.debian.org/java-team/openjfx/compare/cf1faae8fb8010865b687897db7f90e155f1b223...3f40fca1218ddfe79380685b8445c1bf03bbdf76
--
View it on GitLab: https://salsa.debian.org/java-team/openjfx/compare/cf1faae8fb8010865b687897db7f90e155f1b223...3f40fca1218ddfe79380685b8445c1bf03bbdf76
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20181204/f97c1fc4/attachment.html>
More information about the pkg-java-commits
mailing list