jdk/src/share/classes/sun/awt/image/BufImgSurfaceData.java
author dxu
Thu, 04 Apr 2013 15:39:17 -0700
changeset 16734 da1901d79073
parent 12813 c10ab96dcf41
child 24538 25bf8153fbfe
permissions -rw-r--r--
8000406: change files using @GenerateNativeHeader to use @Native Summary: Use @Native annotation to mark constants interested by native codes Reviewed-by: alanb, anthony, prr
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
16734
da1901d79073 8000406: change files using @GenerateNativeHeader to use @Native
dxu
parents: 12813
diff changeset
     2
 * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package sun.awt.image;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.awt.Color;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.awt.Rectangle;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.awt.GraphicsConfiguration;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.awt.image.ColorModel;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import java.awt.image.SampleModel;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import java.awt.image.DirectColorModel;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import java.awt.image.IndexColorModel;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import java.awt.image.Raster;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import java.awt.image.BufferedImage;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
import java.awt.image.DataBuffer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
import sun.java2d.SurfaceData;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
import sun.java2d.SunGraphics2D;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
import sun.java2d.StateTrackable;
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 11080
diff changeset
    42
import sun.java2d.StateTrackable.*;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
import sun.java2d.StateTracker;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
import sun.java2d.loops.SurfaceType;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
import sun.java2d.loops.CompositeType;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
import sun.java2d.loops.RenderLoops;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
12813
c10ab96dcf41 7170969: Add @GenerateNativeHeader to classes whose fields need to be exported for JNI
erikj
parents: 12047
diff changeset
    48
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
public class BufImgSurfaceData extends SurfaceData {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
    BufferedImage bufImg;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
    private BufferedImageGraphicsConfig graphicsConfig;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
    RenderLoops solidloops;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
6861
0c879c7c2ea2 6925710: IndexColorModel.finalize can be made to double free
bae
parents: 5506
diff changeset
    54
    private static native void initIDs(Class ICM, Class ICMColorData);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
    private static final int DCM_RGBX_RED_MASK   = 0xff000000;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
    private static final int DCM_RGBX_GREEN_MASK = 0x00ff0000;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
    private static final int DCM_RGBX_BLUE_MASK  = 0x0000ff00;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
    private static final int DCM_555X_RED_MASK = 0xF800;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
    private static final int DCM_555X_GREEN_MASK = 0x07C0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
    private static final int DCM_555X_BLUE_MASK = 0x003E;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    private static final int DCM_4444_RED_MASK   = 0x0f00;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
    private static final int DCM_4444_GREEN_MASK = 0x00f0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    private static final int DCM_4444_BLUE_MASK  = 0x000f;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
    private static final int DCM_4444_ALPHA_MASK = 0xf000;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
    private static final int DCM_ARGBBM_ALPHA_MASK = 0x01000000;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
    private static final int DCM_ARGBBM_RED_MASK   = 0x00ff0000;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    private static final int DCM_ARGBBM_GREEN_MASK = 0x0000ff00;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    private static final int DCM_ARGBBM_BLUE_MASK  = 0x000000ff;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
    static {
6861
0c879c7c2ea2 6925710: IndexColorModel.finalize can be made to double free
bae
parents: 5506
diff changeset
    72
        initIDs(IndexColorModel.class, ICMColorData.class);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
    public static SurfaceData createData(BufferedImage bufImg) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
        if (bufImg == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
            throw new NullPointerException("BufferedImage cannot be null");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
        SurfaceData sData;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
        ColorModel cm = bufImg.getColorModel();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
        int type = bufImg.getType();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
        // REMIND: Check the image type and pick an appropriate subclass
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
        switch (type) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
        case BufferedImage.TYPE_INT_BGR:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
            sData = createDataIC(bufImg, SurfaceType.IntBgr);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
        case BufferedImage.TYPE_INT_RGB:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
            sData = createDataIC(bufImg, SurfaceType.IntRgb);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
        case BufferedImage.TYPE_INT_ARGB:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
            sData = createDataIC(bufImg, SurfaceType.IntArgb);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
        case BufferedImage.TYPE_INT_ARGB_PRE:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
            sData = createDataIC(bufImg, SurfaceType.IntArgbPre);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
        case BufferedImage.TYPE_3BYTE_BGR:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
            sData = createDataBC(bufImg, SurfaceType.ThreeByteBgr, 2);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
        case BufferedImage.TYPE_4BYTE_ABGR:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
            sData = createDataBC(bufImg, SurfaceType.FourByteAbgr, 3);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
        case BufferedImage.TYPE_4BYTE_ABGR_PRE:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
            sData = createDataBC(bufImg, SurfaceType.FourByteAbgrPre, 3);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
        case BufferedImage.TYPE_USHORT_565_RGB:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
            sData = createDataSC(bufImg, SurfaceType.Ushort565Rgb, null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
        case BufferedImage.TYPE_USHORT_555_RGB:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
            sData = createDataSC(bufImg, SurfaceType.Ushort555Rgb, null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
        case BufferedImage.TYPE_BYTE_INDEXED:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
            {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
                SurfaceType sType;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
                switch (cm.getTransparency()) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
                case OPAQUE:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
                    if (isOpaqueGray((IndexColorModel)cm)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
                        sType = SurfaceType.Index8Gray;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
                    } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
                        sType = SurfaceType.ByteIndexedOpaque;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
                    break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
                case BITMASK:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
                    sType = SurfaceType.ByteIndexedBm;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
                    break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
                case TRANSLUCENT:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
                    sType = SurfaceType.ByteIndexed;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
                    break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
                default:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
                    throw new InternalError("Unrecognized transparency");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
                sData = createDataBC(bufImg, sType, 0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
        case BufferedImage.TYPE_BYTE_GRAY:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
            sData = createDataBC(bufImg, SurfaceType.ByteGray, 0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
        case BufferedImage.TYPE_USHORT_GRAY:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
            sData = createDataSC(bufImg, SurfaceType.UshortGray, null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
        case BufferedImage.TYPE_BYTE_BINARY:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
            {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
                SurfaceType sType;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
                SampleModel sm = bufImg.getRaster().getSampleModel();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
                switch (sm.getSampleSize(0)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
                case 1:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
                    sType = SurfaceType.ByteBinary1Bit;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
                    break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
                case 2:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
                    sType = SurfaceType.ByteBinary2Bit;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
                    break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
                case 4:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
                    sType = SurfaceType.ByteBinary4Bit;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
                    break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
                default:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
                    throw new InternalError("Unrecognized pixel size");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
                sData = createDataBP(bufImg, sType);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
        case BufferedImage.TYPE_CUSTOM:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
        default:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
            {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
                Raster raster = bufImg.getRaster();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
                int numBands = raster.getNumBands();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
                if (raster instanceof IntegerComponentRaster &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
                    raster.getNumDataElements() == 1 &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
                    ((IntegerComponentRaster)raster).getPixelStride() == 1)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
                {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
                    SurfaceType sType = SurfaceType.AnyInt;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
                    if (cm instanceof DirectColorModel) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
                        DirectColorModel dcm = (DirectColorModel) cm;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
                        int aMask = dcm.getAlphaMask();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
                        int rMask = dcm.getRedMask();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
                        int gMask = dcm.getGreenMask();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
                        int bMask = dcm.getBlueMask();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
                        if (numBands == 3 &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
                            aMask == 0 &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
                            rMask == DCM_RGBX_RED_MASK &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
                            gMask == DCM_RGBX_GREEN_MASK &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
                            bMask == DCM_RGBX_BLUE_MASK)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
                        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
                            sType = SurfaceType.IntRgbx;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
                        } else if (numBands == 4 &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
                                   aMask == DCM_ARGBBM_ALPHA_MASK &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
                                   rMask == DCM_ARGBBM_RED_MASK &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
                                   gMask == DCM_ARGBBM_GREEN_MASK &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
                                   bMask == DCM_ARGBBM_BLUE_MASK)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
                        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
                            sType = SurfaceType.IntArgbBm;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
                        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
                            sType = SurfaceType.AnyDcm;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
                        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
                    sData = createDataIC(bufImg, sType);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
                    break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
                } else if (raster instanceof ShortComponentRaster &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
                           raster.getNumDataElements() == 1 &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
                           ((ShortComponentRaster)raster).getPixelStride() == 1)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
                {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
                    SurfaceType sType = SurfaceType.AnyShort;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
                    IndexColorModel icm = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
                    if (cm instanceof DirectColorModel) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
                        DirectColorModel dcm = (DirectColorModel) cm;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
                        int aMask = dcm.getAlphaMask();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
                        int rMask = dcm.getRedMask();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
                        int gMask = dcm.getGreenMask();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
                        int bMask = dcm.getBlueMask();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
                        if (numBands == 3 &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
                            aMask == 0 &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
                            rMask == DCM_555X_RED_MASK &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
                            gMask == DCM_555X_GREEN_MASK &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
                            bMask == DCM_555X_BLUE_MASK)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
                        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
                            sType = SurfaceType.Ushort555Rgbx;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
                        } else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
                        if (numBands == 4 &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
                            aMask == DCM_4444_ALPHA_MASK &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
                            rMask == DCM_4444_RED_MASK &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
                            gMask == DCM_4444_GREEN_MASK &&
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
                            bMask == DCM_4444_BLUE_MASK)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
                        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
                            sType = SurfaceType.Ushort4444Argb;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
                        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
                    } else if (cm instanceof IndexColorModel) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
                        icm = (IndexColorModel)cm;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
                        if (icm.getPixelSize() == 12) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
                            if (isOpaqueGray(icm)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
                                sType = SurfaceType.Index12Gray;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
                            } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
                                sType = SurfaceType.UshortIndexed;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
                            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
                        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
                            icm = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
                        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
                    sData = createDataSC(bufImg, sType, icm);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
                    break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
                sData = new BufImgSurfaceData(raster.getDataBuffer(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
                                              bufImg, SurfaceType.Custom);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
            break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
        ((BufImgSurfaceData) sData).initSolidLoops();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
        return sData;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
    public static SurfaceData createData(Raster ras, ColorModel cm) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
        throw new InternalError("SurfaceData not implemented for Raster/CM");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
    public static SurfaceData createDataIC(BufferedImage bImg,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
                                           SurfaceType sType) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
        IntegerComponentRaster icRaster =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
            (IntegerComponentRaster)bImg.getRaster();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
        BufImgSurfaceData bisd =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
            new BufImgSurfaceData(icRaster.getDataBuffer(), bImg, sType);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
        bisd.initRaster(icRaster.getDataStorage(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
                        icRaster.getDataOffset(0) * 4, 0,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
                        icRaster.getWidth(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
                        icRaster.getHeight(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
                        icRaster.getPixelStride() * 4,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
                        icRaster.getScanlineStride() * 4,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
                        null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
        return bisd;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
    public static SurfaceData createDataSC(BufferedImage bImg,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
                                           SurfaceType sType,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
                                           IndexColorModel icm) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
        ShortComponentRaster scRaster =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
            (ShortComponentRaster)bImg.getRaster();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
        BufImgSurfaceData bisd =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
            new BufImgSurfaceData(scRaster.getDataBuffer(), bImg, sType);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
        bisd.initRaster(scRaster.getDataStorage(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
                        scRaster.getDataOffset(0) * 2, 0,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
                        scRaster.getWidth(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
                        scRaster.getHeight(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
                        scRaster.getPixelStride() * 2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
                        scRaster.getScanlineStride() * 2,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
                        icm);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
        return bisd;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
    public static SurfaceData createDataBC(BufferedImage bImg,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
                                           SurfaceType sType,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
                                           int primaryBank) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
        ByteComponentRaster bcRaster =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
            (ByteComponentRaster)bImg.getRaster();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
        BufImgSurfaceData bisd =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
            new BufImgSurfaceData(bcRaster.getDataBuffer(), bImg, sType);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
        ColorModel cm = bImg.getColorModel();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
        IndexColorModel icm = ((cm instanceof IndexColorModel)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
                               ? (IndexColorModel) cm
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
                               : null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
        bisd.initRaster(bcRaster.getDataStorage(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
                        bcRaster.getDataOffset(primaryBank), 0,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
                        bcRaster.getWidth(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
                        bcRaster.getHeight(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
                        bcRaster.getPixelStride(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
                        bcRaster.getScanlineStride(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
                        icm);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
        return bisd;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
    public static SurfaceData createDataBP(BufferedImage bImg,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
                                           SurfaceType sType) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
        BytePackedRaster bpRaster =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
            (BytePackedRaster)bImg.getRaster();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
        BufImgSurfaceData bisd =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
            new BufImgSurfaceData(bpRaster.getDataBuffer(), bImg, sType);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
        ColorModel cm = bImg.getColorModel();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
        IndexColorModel icm = ((cm instanceof IndexColorModel)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
                               ? (IndexColorModel) cm
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
                               : null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
        bisd.initRaster(bpRaster.getDataStorage(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
                        bpRaster.getDataBitOffset() / 8,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
                        bpRaster.getDataBitOffset() & 7,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
                        bpRaster.getWidth(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
                        bpRaster.getHeight(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
                        0,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
                        bpRaster.getScanlineStride(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
                        icm);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
        return bisd;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
    public RenderLoops getRenderLoops(SunGraphics2D sg2d) {
11080
7e18e343964e 7117914: Fix javac warnings in src/share/classes/sun/java2d
neugens
parents: 7668
diff changeset
   328
        if (sg2d.paintState <= SunGraphics2D.PAINT_ALPHACOLOR &&
7e18e343964e 7117914: Fix javac warnings in src/share/classes/sun/java2d
neugens
parents: 7668
diff changeset
   329
            sg2d.compositeState <= SunGraphics2D.COMP_ISCOPY)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
            return solidloops;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
        return super.getRenderLoops(sg2d);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
    public java.awt.image.Raster getRaster(int x, int y, int w, int h) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
        return bufImg.getRaster();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
     * Initializes the native Ops pointer.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
    protected native void initRaster(Object theArray,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
                                     int offset,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
                                     int bitoffset,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
                                     int width,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
                                     int height,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
                                     int pixStr,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
                                     int scanStr,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
                                     IndexColorModel icm);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
    public BufImgSurfaceData(DataBuffer db,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
                             BufferedImage bufImg, SurfaceType sType)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
        super(SunWritableRaster.stealTrackable(db),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
              sType, bufImg.getColorModel());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
        this.bufImg = bufImg;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
12047
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 11080
diff changeset
   360
    protected BufImgSurfaceData(SurfaceType surfaceType, ColorModel cm) {
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 11080
diff changeset
   361
        super(surfaceType, cm);
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 11080
diff changeset
   362
    }
320a714614e9 7113349: Initial changeset for Macosx port to jdk
michaelm
parents: 11080
diff changeset
   363
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
    public void initSolidLoops() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
        this.solidloops = getSolidLoops(getSurfaceType());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
    private static final int CACHE_SIZE = 5;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
    private static RenderLoops loopcache[] = new RenderLoops[CACHE_SIZE];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
    private static SurfaceType typecache[] = new SurfaceType[CACHE_SIZE];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
    public static synchronized RenderLoops getSolidLoops(SurfaceType type) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
        for (int i = CACHE_SIZE - 1; i >= 0; i--) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
            SurfaceType t = typecache[i];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
            if (t == type) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
                return loopcache[i];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
            } else if (t == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
                break;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
        RenderLoops l = makeRenderLoops(SurfaceType.OpaqueColor,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
                                        CompositeType.SrcNoEa,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
                                        type);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
        System.arraycopy(loopcache, 1, loopcache, 0, CACHE_SIZE-1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
        System.arraycopy(typecache, 1, typecache, 0, CACHE_SIZE-1);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
        loopcache[CACHE_SIZE - 1] = l;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
        typecache[CACHE_SIZE - 1] = type;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
        return l;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
    public SurfaceData getReplacement() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
        // BufImgSurfaceData objects should never lose their contents,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
        // so this method should never be called.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
        return restoreContents(bufImg);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
    public synchronized GraphicsConfiguration getDeviceConfiguration() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
        if (graphicsConfig == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
            graphicsConfig = BufferedImageGraphicsConfig.getConfig(bufImg);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
        return graphicsConfig;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
    public java.awt.Rectangle getBounds() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
        return new Rectangle(bufImg.getWidth(), bufImg.getHeight());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
    protected void checkCustomComposite() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
        // BufferedImages always allow Custom Composite objects since
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
        // their pixels are immediately retrievable anyway.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
6861
0c879c7c2ea2 6925710: IndexColorModel.finalize can be made to double free
bae
parents: 5506
diff changeset
   412
    private static native void freeNativeICMData(long pData);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
     * Returns destination Image associated with this SurfaceData.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
    public Object getDestination() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
        return bufImg;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
    }
6861
0c879c7c2ea2 6925710: IndexColorModel.finalize can be made to double free
bae
parents: 5506
diff changeset
   420
0c879c7c2ea2 6925710: IndexColorModel.finalize can be made to double free
bae
parents: 5506
diff changeset
   421
    public static final class ICMColorData {
0c879c7c2ea2 6925710: IndexColorModel.finalize can be made to double free
bae
parents: 5506
diff changeset
   422
        private long pData = 0L;
0c879c7c2ea2 6925710: IndexColorModel.finalize can be made to double free
bae
parents: 5506
diff changeset
   423
0c879c7c2ea2 6925710: IndexColorModel.finalize can be made to double free
bae
parents: 5506
diff changeset
   424
        private ICMColorData(long pData) {
0c879c7c2ea2 6925710: IndexColorModel.finalize can be made to double free
bae
parents: 5506
diff changeset
   425
            this.pData = pData;
0c879c7c2ea2 6925710: IndexColorModel.finalize can be made to double free
bae
parents: 5506
diff changeset
   426
        }
0c879c7c2ea2 6925710: IndexColorModel.finalize can be made to double free
bae
parents: 5506
diff changeset
   427
0c879c7c2ea2 6925710: IndexColorModel.finalize can be made to double free
bae
parents: 5506
diff changeset
   428
        public void finalize() {
0c879c7c2ea2 6925710: IndexColorModel.finalize can be made to double free
bae
parents: 5506
diff changeset
   429
            if (pData != 0L) {
0c879c7c2ea2 6925710: IndexColorModel.finalize can be made to double free
bae
parents: 5506
diff changeset
   430
                BufImgSurfaceData.freeNativeICMData(pData);
0c879c7c2ea2 6925710: IndexColorModel.finalize can be made to double free
bae
parents: 5506
diff changeset
   431
                pData = 0L;
0c879c7c2ea2 6925710: IndexColorModel.finalize can be made to double free
bae
parents: 5506
diff changeset
   432
            }
0c879c7c2ea2 6925710: IndexColorModel.finalize can be made to double free
bae
parents: 5506
diff changeset
   433
        }
0c879c7c2ea2 6925710: IndexColorModel.finalize can be made to double free
bae
parents: 5506
diff changeset
   434
    }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
}