Skip to content

Commit 84840bc

Browse files
GC with Image in unsupported use cases
Logging a warning for GC initialized with unsupported use cases. 1. all dynamic images (retrieved via any of the existing providers). 2. all images for which handles in other zoom values have already been created.
1 parent 74c39bf commit 84840bc

File tree

1 file changed

+8
-0
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics

1 file changed

+8
-0
lines changed

bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java

+8
Original file line numberDiff line numberDiff line change
@@ -1743,6 +1743,14 @@ private ImageHandle init(ImageData i, int zoom) {
17431743
@Override
17441744
public long internal_new_GC (GCData data) {
17451745
if (isDisposed()) SWT.error(SWT.ERROR_GRAPHIC_DISPOSED);
1746+
1747+
if(imageProvider != null && (imageProvider instanceof ImageDataProviderWrapper || imageProvider instanceof ImageFileNameProviderWrapper)) {
1748+
System.err.println("***WARNING: Image initialized with ImageDataProvider or ImageFileNameProvider is not supposed to be modified");
1749+
}
1750+
1751+
if(zoomLevelToImageHandle != null && !zoomLevelToImageHandle.isEmpty()) {
1752+
System.err.println("**WARNING: Images with handles created for a different zoom level should not be modified.");
1753+
}
17461754
/*
17471755
* Create a new GC that can draw into the image.
17481756
* Only supported for bitmaps.

0 commit comments

Comments
 (0)