Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft support for AWT image resizing #20148

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
package io.quarkus.deployment;

import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.nativeimage.JniRuntimeAccessBuildItem;
import io.quarkus.deployment.builditem.nativeimage.ReflectiveClassBuildItem;

public class Java2DProcessor {

@BuildStep
ReflectiveClassBuildItem setupReflectionClasses() {
return new ReflectiveClassBuildItem(false, false,
"sun.awt.X11GraphicsEnvironment",
"sun.awt.X11.XToolkit");
}

@BuildStep
JniRuntimeAccessBuildItem setupJava2DClasses() {
return new JniRuntimeAccessBuildItem(true, true, true,
"java.awt.AlphaComposite",
"java.awt.Color",
"java.awt.geom.AffineTransform",
"java.awt.geom.Path2D",
"java.awt.geom.Path2D$Float",
"java.awt.image.BufferedImage",
"java.awt.image.ColorModel",
"java.awt.image.IndexColorModel",
"java.awt.image.Raster",
"java.awt.image.SampleModel",
"java.awt.image.SinglePixelPackedSampleModel",
"sun.awt.SunHints",
"sun.awt.image.BufImgSurfaceData$ICMColorData",
"sun.awt.image.ByteComponentRaster",
"sun.awt.image.BytePackedRaster",
"sun.awt.image.ImageRepresentation",
"sun.awt.image.IntegerComponentRaster",
"sun.java2d.Disposer",
"sun.java2d.InvalidPipeException",
"sun.java2d.NullSurfaceData",
"sun.java2d.SunGraphics2D",
"sun.java2d.SurfaceData",
"sun.java2d.loops.Blit",
"sun.java2d.loops.BlitBg",
"sun.java2d.loops.CompositeType",
"sun.java2d.loops.DrawGlyphList",
"sun.java2d.loops.DrawGlyphListAA",
"sun.java2d.loops.DrawGlyphListLCD",
"sun.java2d.loops.DrawLine",
"sun.java2d.loops.DrawParallelogram",
"sun.java2d.loops.DrawPath",
"sun.java2d.loops.DrawPolygons",
"sun.java2d.loops.DrawRect",
"sun.java2d.loops.FillParallelogram",
"sun.java2d.loops.FillPath",
"sun.java2d.loops.FillRect",
"sun.java2d.loops.FillSpans",
"sun.java2d.loops.GraphicsPrimitive",
"sun.java2d.loops.GraphicsPrimitiveMgr",
"sun.java2d.loops.GraphicsPrimitive[]",
"sun.java2d.loops.MaskBlit",
"sun.java2d.loops.MaskFill",
"sun.java2d.loops.ScaledBlit",
"sun.java2d.loops.SurfaceType",
"sun.java2d.loops.TransformHelper",
"sun.java2d.loops.XORComposite",
"sun.java2d.pipe.Region",
"sun.java2d.pipe.RegionIterator");
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,8 @@ public NativeImageInvokerInfo build() {
}

handleAdditionalProperties(nativeConfig, nativeImageArgs, isContainerBuild, outputDir);
nativeImageArgs
.add("--initialize-at-run-time=java.awt,javax.imageio,sun.awt,sun.java2d,sun.font,com.sun.imageio,org.apache.pdfbox,org.apache.poi.hssf.util,org.apache.poi.ss.format");
nativeImageArgs.add(
"-H:InitialCollectionPolicy=com.oracle.svm.core.genscavenge.CollectionPolicy$BySpaceAndTime"); //the default collection policy results in full GC's 50% of the time
nativeImageArgs.add("-H:+JNI");
Expand Down

This file was deleted.