src/share/classes/java/awt/GradientPaintContext.java

Print this page

        

*** 39,49 **** new DirectColorModel(24, 0x00ff0000, 0x0000ff00, 0x000000ff); static ColorModel xbgrmodel = new DirectColorModel(24, 0x000000ff, 0x0000ff00, 0x00ff0000); static ColorModel cachedModel; ! static WeakReference cached; static synchronized Raster getCachedRaster(ColorModel cm, int w, int h) { if (cm == cachedModel) { if (cached != null) { Raster ras = (Raster) cached.get(); --- 39,49 ---- new DirectColorModel(24, 0x00ff0000, 0x0000ff00, 0x000000ff); static ColorModel xbgrmodel = new DirectColorModel(24, 0x000000ff, 0x0000ff00, 0x00ff0000); static ColorModel cachedModel; ! static WeakReference<Raster> cached; static synchronized Raster getCachedRaster(ColorModel cm, int w, int h) { if (cm == cachedModel) { if (cached != null) { Raster ras = (Raster) cached.get();
*** 74,84 **** return; } } } cachedModel = cm; ! cached = new WeakReference(ras); } double x1; double y1; double dx; --- 74,84 ---- return; } } } cachedModel = cm; ! cached = new WeakReference<>(ras); } double x1; double y1; double dx;