Skip to content

Commit 2b71399

Browse files
committed
Remove SVGUtil and move utility methods into JSVGRasterizer
1 parent 4b0ce82 commit 2b71399

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

bundles/org.eclipse.jface/src/org/eclipse/jface/resource/URLImageDescriptor.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,12 @@
3535
import org.eclipse.swt.SWT;
3636
import org.eclipse.swt.SWTException;
3737
import org.eclipse.swt.graphics.Device;
38-
import org.eclipse.swt.graphics.SVGRasterizer;
3938
import org.eclipse.swt.graphics.Image;
4039
import org.eclipse.swt.graphics.ImageData;
4140
import org.eclipse.swt.graphics.ImageDataProvider;
4241
import org.eclipse.swt.graphics.ImageFileNameProvider;
42+
import org.eclipse.swt.graphics.SVGRasterizer;
4343
import org.eclipse.swt.graphics.SVGRasterizerRegistry;
44-
import org.eclipse.swt.graphics.SVGUtil;
4544

4645
/**
4746
* An ImageDescriptor that gets its information from a URL. This class is not
@@ -65,7 +64,7 @@ public String getImagePath(int zoom) {
6564
SVGRasterizer rasterizer = SVGRasterizerRegistry.getRasterizer();
6665
if (rasterizer != null) {
6766
try (InputStream in = getStream(tempURL)) {
68-
if (SVGUtil.isSVGFile(in)) {
67+
if (rasterizer.isSVGFile(in)) {
6968
return getFilePath(tempURL, false);
7069
}
7170
} catch (IOException e) {
@@ -154,11 +153,9 @@ private static ImageData getImageData(String url, int zoom) {
154153
if (tempURL != null) {
155154
SVGRasterizer rasterizer = SVGRasterizerRegistry.getRasterizer();
156155
if (rasterizer != null) {
157-
try {
158-
try (InputStream in = getStream(tempURL)) {
159-
if (SVGUtil.isSVGFile(in)) {
160-
return getImageData(tempURL, zoom);
161-
}
156+
try (InputStream in = getStream(tempURL)) {
157+
if (rasterizer.isSVGFile(in)) {
158+
return getImageData(tempURL, zoom);
162159
}
163160
} catch (IOException e) {
164161
// ignore.

0 commit comments

Comments
 (0)