jdk/src/share/classes/java/awt/GradientPaintContext.java
changeset 20107 18e644411f0b
parent 5506 202f599c92aa
child 22584 eed64ee05369
equal deleted inserted replaced
20106:5d5f2c72f262 20107:18e644411f0b
    39         new DirectColorModel(24, 0x00ff0000, 0x0000ff00, 0x000000ff);
    39         new DirectColorModel(24, 0x00ff0000, 0x0000ff00, 0x000000ff);
    40     static ColorModel xbgrmodel =
    40     static ColorModel xbgrmodel =
    41         new DirectColorModel(24, 0x000000ff, 0x0000ff00, 0x00ff0000);
    41         new DirectColorModel(24, 0x000000ff, 0x0000ff00, 0x00ff0000);
    42 
    42 
    43     static ColorModel cachedModel;
    43     static ColorModel cachedModel;
    44     static WeakReference cached;
    44     static WeakReference<Raster> cached;
    45 
    45 
    46     static synchronized Raster getCachedRaster(ColorModel cm, int w, int h) {
    46     static synchronized Raster getCachedRaster(ColorModel cm, int w, int h) {
    47         if (cm == cachedModel) {
    47         if (cm == cachedModel) {
    48             if (cached != null) {
    48             if (cached != null) {
    49                 Raster ras = (Raster) cached.get();
    49                 Raster ras = (Raster) cached.get();
    74                     return;
    74                     return;
    75                 }
    75                 }
    76             }
    76             }
    77         }
    77         }
    78         cachedModel = cm;
    78         cachedModel = cm;
    79         cached = new WeakReference(ras);
    79         cached = new WeakReference<>(ras);
    80     }
    80     }
    81 
    81 
    82     double x1;
    82     double x1;
    83     double y1;
    83     double y1;
    84     double dx;
    84     double dx;