sun.java2d.Disposer Java Examples
The following examples show how to use
sun.java2d.Disposer.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FontScaler.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
public static FontScaler getScaler(Font2D font, int indexInCollection, boolean supportsCJK, int filesize) { FontScaler scaler = null; try { Object args[] = new Object[] {font, indexInCollection, supportsCJK, filesize}; scaler = scalerConstructor.newInstance(args); Disposer.addObjectRecord(font, scaler); } catch (Throwable e) { scaler = nullScaler; //if we can not instantiate scaler assume bad font //NB: technically it could be also because of internal scaler // error but here we are assuming scaler is ok. FontManager fm = FontManagerFactory.getInstance(); fm.deRegisterBadFont(font); } return scaler; }
Example #2
Source File: FontScaler.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
public static FontScaler getScaler(Font2D font, int indexInCollection, boolean supportsCJK, int filesize) { FontScaler scaler = null; try { Object args[] = new Object[] {font, indexInCollection, supportsCJK, filesize}; scaler = scalerConstructor.newInstance(args); Disposer.addObjectRecord(font, scaler); } catch (Throwable e) { scaler = nullScaler; //if we can not instantiate scaler assume bad font //NB: technically it could be also because of internal scaler // error but here we are assuming scaler is ok. FontManager fm = FontManagerFactory.getInstance(); fm.deRegisterBadFont(font); } return scaler; }
Example #3
Source File: Type1Font.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
/** * - does basic verification of the file * - reads the names (full, family). * - determines the style of the font. * @throws FontFormatException if the font can't be opened * or fails verification, or there's no usable cmap */ public Type1Font(String platname, Object nativeNames, boolean createdCopy) throws FontFormatException { super(platname, nativeNames); fontRank = Font2D.TYPE1_RANK; checkedNatives = true; try { verify(); } catch (Throwable t) { if (createdCopy) { T1DisposerRecord ref = new T1DisposerRecord(platname); Disposer.addObjectRecord(bufferRef, ref); bufferRef = null; } if (t instanceof FontFormatException) { throw (FontFormatException)t; } else { throw new FontFormatException("Unexpected runtime exception."); } } }
Example #4
Source File: TrueTypeFont.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
/** * - does basic verification of the file * - reads the header table for this font (within a collection) * - reads the names (full, family). * - determines the style of the font. * - initializes the CMAP * @throws FontFormatException if the font can't be opened * or fails verification, or there's no usable cmap */ public TrueTypeFont(String platname, Object nativeNames, int fIndex, boolean javaRasterizer, boolean useFilePool) throws FontFormatException { super(platname, nativeNames); useJavaRasterizer = javaRasterizer; fontRank = Font2D.TTF_RANK; try { verify(useFilePool); init(fIndex); if (!useFilePool) { close(); } } catch (Throwable t) { close(); if (t instanceof FontFormatException) { throw (FontFormatException)t; } else { throw new FontFormatException("Unexpected runtime exception."); } } Disposer.addObjectRecord(this, disposerRecord); }
Example #5
Source File: TrueTypeFont.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
/** * - does basic verification of the file * - reads the header table for this font (within a collection) * - reads the names (full, family). * - determines the style of the font. * - initializes the CMAP * @throws FontFormatException - if the font can't be opened * or fails verification, or there's no usable cmap */ public TrueTypeFont(String platname, Object nativeNames, int fIndex, boolean javaRasterizer, boolean useFilePool) throws FontFormatException { super(platname, nativeNames); useJavaRasterizer = javaRasterizer; fontRank = Font2D.TTF_RANK; try { verify(useFilePool); init(fIndex); if (!useFilePool) { close(); } } catch (Throwable t) { close(); if (t instanceof FontFormatException) { throw (FontFormatException)t; } else { throw new FontFormatException("Unexpected runtime exception."); } } Disposer.addObjectRecord(this, disposerRecord); }
Example #6
Source File: Type1Font.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
/** * - does basic verification of the file * - reads the names (full, family). * - determines the style of the font. * @throws FontFormatException - if the font can't be opened * or fails verification, or there's no usable cmap */ public Type1Font(String platname, Object nativeNames, boolean createdCopy) throws FontFormatException { super(platname, nativeNames); fontRank = Font2D.TYPE1_RANK; checkedNatives = true; try { verify(); } catch (Throwable t) { if (createdCopy) { T1DisposerRecord ref = new T1DisposerRecord(platname); Disposer.addObjectRecord(bufferRef, ref); bufferRef = null; } if (t instanceof FontFormatException) { throw (FontFormatException)t; } else { throw new FontFormatException("Unexpected runtime exception."); } } }
Example #7
Source File: FontScaler.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
public static FontScaler getScaler(Font2D font, int indexInCollection, boolean supportsCJK, int filesize) { FontScaler scaler = null; try { Object args[] = new Object[] {font, indexInCollection, supportsCJK, filesize}; scaler = scalerConstructor.newInstance(args); Disposer.addObjectRecord(font, scaler); } catch (Throwable e) { scaler = nullScaler; //if we can not instantiate scaler assume bad font //NB: technically it could be also because of internal scaler // error but here we are assuming scaler is ok. FontManager fm = FontManagerFactory.getInstance(); fm.deRegisterBadFont(font); } return scaler; }
Example #8
Source File: CGLGraphicsConfig.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
private CGLGraphicsConfig(CGraphicsDevice device, int pixfmt, long configInfo, int maxTextureSize, ContextCapabilities oglCaps) { super(device); this.pixfmt = pixfmt; this.pConfigInfo = configInfo; this.oglCaps = oglCaps; this.maxTextureSize = maxTextureSize; context = new OGLContext(OGLRenderQueue.getInstance(), this); // add a record to the Disposer so that we destroy the native // CGLGraphicsConfigInfo data when this object goes away Disposer.addRecord(disposerReferent, new CGLGCDisposerRecord(pConfigInfo)); }
Example #9
Source File: Type1Font.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
/** * - does basic verification of the file * - reads the names (full, family). * - determines the style of the font. * @throws FontFormatException - if the font can't be opened * or fails verification, or there's no usable cmap */ public Type1Font(String platname, Object nativeNames, boolean createdCopy) throws FontFormatException { super(platname, nativeNames); fontRank = Font2D.TYPE1_RANK; checkedNatives = true; try { verify(); } catch (Throwable t) { if (createdCopy) { T1DisposerRecord ref = new T1DisposerRecord(platname); Disposer.addObjectRecord(bufferRef, ref); bufferRef = null; } if (t instanceof FontFormatException) { throw (FontFormatException)t; } else { throw new FontFormatException("Unexpected runtime exception."); } } }
Example #10
Source File: TrueTypeFont.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 6 votes |
/** * - does basic verification of the file * - reads the header table for this font (within a collection) * - reads the names (full, family). * - determines the style of the font. * - initializes the CMAP * @throws FontFormatException - if the font can't be opened * or fails verification, or there's no usable cmap */ public TrueTypeFont(String platname, Object nativeNames, int fIndex, boolean javaRasterizer) throws FontFormatException { super(platname, nativeNames); useJavaRasterizer = javaRasterizer; fontRank = Font2D.TTF_RANK; try { verify(); init(fIndex); } catch (Throwable t) { close(); if (t instanceof FontFormatException) { throw (FontFormatException)t; } else { throw new FontFormatException("Unexpected runtime exception."); } } Disposer.addObjectRecord(this, disposerRecord); }
Example #11
Source File: CGLGraphicsConfig.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
private CGLGraphicsConfig(CGraphicsDevice device, int pixfmt, long configInfo, int maxTextureSize, ContextCapabilities oglCaps) { super(device); this.pixfmt = pixfmt; this.pConfigInfo = configInfo; this.oglCaps = oglCaps; this.maxTextureSize = maxTextureSize; context = new OGLContext(OGLRenderQueue.getInstance(), this); // add a record to the Disposer so that we destroy the native // CGLGraphicsConfigInfo data when this object goes away Disposer.addRecord(disposerReferent, new CGLGCDisposerRecord(pConfigInfo)); }
Example #12
Source File: CGLGraphicsConfig.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
private CGLGraphicsConfig(CGraphicsDevice device, int pixfmt, long configInfo, int maxTextureSize, ContextCapabilities oglCaps) { super(device); this.pixfmt = pixfmt; this.pConfigInfo = configInfo; this.oglCaps = oglCaps; this.maxTextureSize = maxTextureSize; context = new OGLContext(OGLRenderQueue.getInstance(), this); // add a record to the Disposer so that we destroy the native // CGLGraphicsConfigInfo data when this object goes away Disposer.addRecord(disposerReferent, new CGLGCDisposerRecord(pConfigInfo)); }
Example #13
Source File: WindowsLeak.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { Robot r = new Robot(); for (int i = 0; i < 100; i++) { Frame f = new Frame(); f.pack(); f.dispose(); } r.waitForIdle(); Disposer.addRecord(new Object(), () -> disposerPhantomComplete = true); while (!disposerPhantomComplete) { Util.generateOOME(); } Vector<WeakReference<Window>> windowList = (Vector<WeakReference<Window>>) AppContext.getAppContext().get(Window.class); if (windowList != null && !windowList.isEmpty()) { throw new RuntimeException("Test FAILED: Window list is not empty: " + windowList.size()); } System.out.println("Test PASSED"); }
Example #14
Source File: FontScaler.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
public static FontScaler getScaler(Font2D font, int indexInCollection, boolean supportsCJK, int filesize) { FontScaler scaler = null; try { Object args[] = new Object[] {font, indexInCollection, supportsCJK, filesize}; scaler = scalerConstructor.newInstance(args); Disposer.addObjectRecord(font, scaler); } catch (Throwable e) { scaler = nullScaler; //if we can not instantiate scaler assume bad font //NB: technically it could be also because of internal scaler // error but here we are assuming scaler is ok. FontManager fm = FontManagerFactory.getInstance(); fm.deRegisterBadFont(font); } return scaler; }
Example #15
Source File: WindowsLeak.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
public static void main(String[] args) throws Exception { Robot r = new Robot(); for (int i = 0; i < 100; i++) { Frame f = new Frame(); f.pack(); f.dispose(); } r.waitForIdle(); Disposer.addRecord(new Object(), () -> disposerPhantomComplete = true); while (!disposerPhantomComplete) { Util.generateOOME(); } Vector<WeakReference<Window>> windowList = (Vector<WeakReference<Window>>) AppContext.getAppContext().get(Window.class); if (windowList != null && !windowList.isEmpty()) { throw new RuntimeException("Test FAILED: Window list is not empty: " + windowList.size()); } System.out.println("Test PASSED"); }
Example #16
Source File: FontScaler.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
public static FontScaler getScaler(Font2D font, int indexInCollection, boolean supportsCJK, int filesize) { FontScaler scaler = null; try { Object args[] = new Object[] {font, indexInCollection, supportsCJK, filesize}; scaler = scalerConstructor.newInstance(args); Disposer.addObjectRecord(font, scaler); } catch (Throwable e) { scaler = nullScaler; //if we can not instantiate scaler assume bad font //NB: technically it could be also because of internal scaler // error but here we are assuming scaler is ok. FontManager fm = FontManagerFactory.getInstance(); fm.deRegisterBadFont(font); } return scaler; }
Example #17
Source File: X11GraphicsConfig.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
protected X11GraphicsConfig(X11GraphicsDevice device, int visualnum, int depth, int colormap, boolean doubleBuffer) { this.screen = device; this.visual = visualnum; this.doubleBuffer = doubleBuffer; this.depth = depth; this.colormap = colormap; init (visualnum, screen.getScreen()); // add a record to the Disposer so that we destroy the native // AwtGraphicsConfigData when this object goes away (i.e. after a // display change event) long x11CfgData = getAData(); Disposer.addRecord(disposerReferent, new X11GCDisposerRecord(x11CfgData)); }
Example #18
Source File: X11GraphicsConfig.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
protected X11GraphicsConfig(X11GraphicsDevice device, int visualnum, int depth, int colormap, boolean doubleBuffer) { this.screen = device; this.visual = visualnum; this.doubleBuffer = doubleBuffer; this.depth = depth; this.colormap = colormap; init (visualnum, screen.getScreen()); // add a record to the Disposer so that we destroy the native // AwtGraphicsConfigData when this object goes away (i.e. after a // display change event) long x11CfgData = getAData(); Disposer.addRecord(disposerReferent, new X11GCDisposerRecord(x11CfgData)); }
Example #19
Source File: Type1Font.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
/** * - does basic verification of the file * - reads the names (full, family). * - determines the style of the font. * @throws FontFormatException - if the font can't be opened * or fails verification, or there's no usable cmap */ public Type1Font(String platname, Object nativeNames, boolean createdCopy) throws FontFormatException { super(platname, nativeNames); fontRank = Font2D.TYPE1_RANK; checkedNatives = true; try { verify(); } catch (Throwable t) { if (createdCopy) { T1DisposerRecord ref = new T1DisposerRecord(platname); Disposer.addObjectRecord(bufferRef, ref); bufferRef = null; } if (t instanceof FontFormatException) { throw (FontFormatException)t; } else { throw new FontFormatException("Unexpected runtime exception."); } } }
Example #20
Source File: CGLGraphicsConfig.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
private CGLGraphicsConfig(CGraphicsDevice device, int pixfmt, long configInfo, int maxTextureSize, ContextCapabilities oglCaps) { super(device); this.pixfmt = pixfmt; this.pConfigInfo = configInfo; this.oglCaps = oglCaps; this.maxTextureSize = maxTextureSize; context = new OGLContext(OGLRenderQueue.getInstance(), this); // add a record to the Disposer so that we destroy the native // CGLGraphicsConfigInfo data when this object goes away Disposer.addRecord(disposerReferent, new CGLGCDisposerRecord(pConfigInfo)); }
Example #21
Source File: TrueTypeFont.java From Bytecoder with Apache License 2.0 | 6 votes |
/** * - does basic verification of the file * - reads the header table for this font (within a collection) * - reads the names (full, family). * - determines the style of the font. * - initializes the CMAP * @throws FontFormatException if the font can't be opened * or fails verification, or there's no usable cmap */ public TrueTypeFont(String platname, Object nativeNames, int fIndex, boolean javaRasterizer, boolean useFilePool) throws FontFormatException { super(platname, nativeNames); useJavaRasterizer = javaRasterizer; fontRank = Font2D.TTF_RANK; try { verify(useFilePool); init(fIndex); if (!useFilePool) { close(); } } catch (Throwable t) { close(); if (t instanceof FontFormatException) { throw (FontFormatException)t; } else { throw new FontFormatException("Unexpected runtime exception."); } } Disposer.addObjectRecord(this, disposerRecord); }
Example #22
Source File: Window.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
private void initDeserializedWindow() { setWarningString(); inputContextLock = new Object(); // Deserialized Windows are not yet visible. visible = false; weakThis = new WeakReference<>(this); anchor = new Object(); disposerRecord = new WindowDisposerRecord(appContext, this); sun.java2d.Disposer.addRecord(anchor, disposerRecord); addToWindowList(); initGC(null); ownedWindowList = new Vector<>(); }
Example #23
Source File: CGLGraphicsConfig.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 6 votes |
private CGLGraphicsConfig(CGraphicsDevice device, int pixfmt, long configInfo, int maxTextureSize, ContextCapabilities oglCaps) { super(device); this.pixfmt = pixfmt; this.pConfigInfo = configInfo; this.oglCaps = oglCaps; this.maxTextureSize = maxTextureSize; context = new OGLContext(OGLRenderQueue.getInstance(), this); // add a record to the Disposer so that we destroy the native // CGLGraphicsConfigInfo data when this object goes away Disposer.addRecord(disposerReferent, new CGLGCDisposerRecord(pConfigInfo)); }
Example #24
Source File: Type1Font.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
/** * - does basic verification of the file * - reads the names (full, family). * - determines the style of the font. * @throws FontFormatException - if the font can't be opened * or fails verification, or there's no usable cmap */ public Type1Font(String platname, Object nativeNames, boolean createdCopy) throws FontFormatException { super(platname, nativeNames); fontRank = Font2D.TYPE1_RANK; checkedNatives = true; try { verify(); } catch (Throwable t) { if (createdCopy) { T1DisposerRecord ref = new T1DisposerRecord(platname); Disposer.addObjectRecord(bufferRef, ref); bufferRef = null; } if (t instanceof FontFormatException) { throw (FontFormatException)t; } else { throw new FontFormatException("Unexpected runtime exception."); } } }
Example #25
Source File: Window.java From hottub with GNU General Public License v2.0 | 6 votes |
private void initDeserializedWindow() { setWarningString(); inputContextLock = new Object(); // Deserialized Windows are not yet visible. visible = false; weakThis = new WeakReference<>(this); anchor = new Object(); disposerRecord = new WindowDisposerRecord(appContext, this); sun.java2d.Disposer.addRecord(anchor, disposerRecord); addToWindowList(); initGC(null); ownedWindowList = new Vector<>(); }
Example #26
Source File: X11GraphicsConfig.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
protected X11GraphicsConfig(X11GraphicsDevice device, int visualnum, int depth, int colormap, boolean doubleBuffer) { this.screen = device; this.visual = visualnum; this.doubleBuffer = doubleBuffer; this.depth = depth; this.colormap = colormap; init (visualnum, screen.getScreen()); // add a record to the Disposer so that we destroy the native // AwtGraphicsConfigData when this object goes away (i.e. after a // display change event) long x11CfgData = getAData(); Disposer.addRecord(disposerReferent, new X11GCDisposerRecord(x11CfgData)); }
Example #27
Source File: X11GraphicsConfig.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
protected X11GraphicsConfig(X11GraphicsDevice device, int visualnum, int depth, int colormap, boolean doubleBuffer) { this.screen = device; this.visual = visualnum; this.doubleBuffer = doubleBuffer; this.depth = depth; this.colormap = colormap; init (visualnum, screen.getScreen()); // add a record to the Disposer so that we destroy the native // AwtGraphicsConfigData when this object goes away (i.e. after a // display change event) long x11CfgData = getAData(); Disposer.addRecord(disposerReferent, new X11GCDisposerRecord(x11CfgData)); }
Example #28
Source File: CGLGraphicsConfig.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
private CGLGraphicsConfig(CGraphicsDevice device, int pixfmt, long configInfo, int maxTextureSize, ContextCapabilities oglCaps) { super(device); this.pixfmt = pixfmt; this.pConfigInfo = configInfo; this.oglCaps = oglCaps; this.maxTextureSize = maxTextureSize; context = new OGLContext(OGLRenderQueue.getInstance(), this); // add a record to the Disposer so that we destroy the native // CGLGraphicsConfigInfo data when this object goes away Disposer.addRecord(disposerReferent, new CGLGCDisposerRecord(pConfigInfo)); }
Example #29
Source File: CGLGraphicsConfig.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
private CGLGraphicsConfig(CGraphicsDevice device, int pixfmt, long configInfo, int maxTextureSize, ContextCapabilities oglCaps) { super(device); this.pixfmt = pixfmt; this.pConfigInfo = configInfo; this.oglCaps = oglCaps; this.maxTextureSize = maxTextureSize; context = new OGLContext(OGLRenderQueue.getInstance(), this); // add a record to the Disposer so that we destroy the native // CGLGraphicsConfigInfo data when this object goes away Disposer.addRecord(disposerReferent, new CGLGCDisposerRecord(pConfigInfo)); }
Example #30
Source File: WGLGraphicsConfig.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
protected WGLGraphicsConfig(Win32GraphicsDevice device, int visualnum, long configInfo, ContextCapabilities oglCaps) { super(device, visualnum); this.pConfigInfo = configInfo; this.oglCaps = oglCaps; context = new OGLContext(OGLRenderQueue.getInstance(), this); // add a record to the Disposer so that we destroy the native // WGLGraphicsConfigInfo data when this object goes away Disposer.addRecord(disposerReferent, new WGLGCDisposerRecord(pConfigInfo, device.getScreen())); }