jdk/src/share/classes/sun/awt/image/SunVolatileImage.java
author xdono
Wed, 02 Jul 2008 12:55:45 -0700
changeset 715 f16baef3a20e
parent 557 800259d3792b
child 889 6549643c008c
permissions -rw-r--r--
6719955: Update copyright year Summary: Update copyright year for files that have been modified in 2008 Reviewed-by: ohair, tbell
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
715
f16baef3a20e 6719955: Update copyright year
xdono
parents: 557
diff changeset
     2
 * Copyright 2000-2008 Sun Microsystems, Inc.  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
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Sun designates this
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * by Sun in the LICENSE file that accompanied this code.
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
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    21
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 * CA 95054 USA or visit www.sun.com if you need additional information or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 * have any questions.
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.AlphaComposite;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.awt.Color;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.awt.Component;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.awt.Font;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import java.awt.Graphics;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import java.awt.Graphics2D;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import java.awt.GraphicsConfiguration;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import java.awt.ImageCapabilities;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import java.awt.Transparency;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
import java.awt.image.BufferedImage;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
import java.awt.image.ColorModel;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
import java.awt.image.ImageObserver;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
import java.awt.image.VolatileImage;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
import java.awt.image.WritableRaster;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
import sun.java2d.SunGraphics2D;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
import sun.java2d.SurfaceData;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
import sun.java2d.SurfaceManagerFactory;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * This class is the base implementation of the VolatileImage
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * abstract class.  The class implements most of the standard Image
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * methods (width, height, etc.) but delegates all surface management
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * issues to a platform-specific VolatileSurfaceManager.  When a new instance
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 * of SunVolatileImage is created, it automatically creates an
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 * appropriate VolatileSurfaceManager for the GraphicsConfiguration
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 * under which this SunVolatileImage was created.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
public class SunVolatileImage extends VolatileImage {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
    protected VolatileSurfaceManager volSurfaceManager;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
    protected Component comp;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
    private GraphicsConfiguration graphicsConfig;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
    private Font defaultFont;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
    private int width, height;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
    private SunVolatileImage(Component comp,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
                             GraphicsConfiguration graphicsConfig,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
                             int width, int height, Object context,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
                             int transparency, ImageCapabilities caps)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
        this.comp = comp;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
        this.graphicsConfig = graphicsConfig;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
        this.width = width;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
        this.height = height;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
        if (!(transparency == Transparency.OPAQUE ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
            transparency == Transparency.BITMASK ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
            transparency == Transparency.TRANSLUCENT))
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
            throw new IllegalArgumentException("Unknown transparency type:" +
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
                                               transparency);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
        this.transparency = transparency;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
        this.volSurfaceManager = createSurfaceManager(context, caps);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
        SurfaceManager.setManager(this, volSurfaceManager);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
        // post-construction initialization of the surface manager
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
        volSurfaceManager.initialize();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
        // clear the background
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
        volSurfaceManager.initContents();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
    private SunVolatileImage(Component comp,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
                             GraphicsConfiguration graphicsConfig,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
                             int width, int height, Object context,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
                             ImageCapabilities caps)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
        this(comp, graphicsConfig,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
             width, height, context, Transparency.OPAQUE, caps);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
    public SunVolatileImage(Component comp, int width, int height) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
        this(comp, width, height, null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
    public SunVolatileImage(Component comp,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
                            int width, int height, Object context)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
        this(comp, comp.getGraphicsConfiguration(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
             width, height, context, null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
    public SunVolatileImage(GraphicsConfiguration graphicsConfig,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
                            int width, int height, int transparency,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
                            ImageCapabilities caps)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
        this(null, graphicsConfig, width, height, null, transparency, caps);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
    public int getWidth() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
        return width;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
    public int getHeight() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
        return height;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
    public GraphicsConfiguration getGraphicsConfig() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
        return graphicsConfig;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
    public void updateGraphicsConfig() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
        // If this VImage is associated with a Component, get an updated
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
        // graphicsConfig from that component.  Otherwise, keep the one
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
        // that we were created with
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
        if (comp != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
            GraphicsConfiguration gc = comp.getGraphicsConfiguration();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
            if (gc != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
                // Could potentially be null in some failure situations;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
                // better to keep the old non-null value around than to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
                // set graphicsConfig to null
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
                graphicsConfig = gc;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
    public Component getComponent() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
        return comp;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
    protected VolatileSurfaceManager createSurfaceManager(Object context,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
                                                          ImageCapabilities caps)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
        /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
         * Platform-specific SurfaceManagerFactories will return a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
         * manager suited to acceleration on each platform.  But if
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
         * the user is asking for a VolatileImage from a BufferedImageGC,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
         * then we need to return the appropriate unaccelerated manager.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
         * Note: this could change in the future; if some platform would
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
         * like to accelerate BIGC volatile images, then this special-casing
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
         * of the BIGC graphicsConfig should live in platform-specific
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
         * code instead.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
         * We do the same for a Printer Device, and if user requested an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
         * unaccelerated VolatileImage by passing the capabilities object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
        if (graphicsConfig instanceof BufferedImageGraphicsConfig ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
            graphicsConfig instanceof sun.print.PrinterGraphicsConfig ||
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
            (caps != null && !caps.isAccelerated()))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
        {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
            return new BufImgVolatileSurfaceManager(this, context);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
        }
557
800259d3792b 6675596: SurfaceManagerFactory should allow plugging in different implementations
tdv
parents: 2
diff changeset
   168
        SurfaceManagerFactory smf = SurfaceManagerFactory.getInstance();
800259d3792b 6675596: SurfaceManagerFactory should allow plugging in different implementations
tdv
parents: 2
diff changeset
   169
        return smf.createVolatileManager(this, context);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
    private Color getForeground() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
        if (comp != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
            return comp.getForeground();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
            return Color.black;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
    private Color getBackground() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
        if (comp != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
            return comp.getBackground();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
            return Color.white;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
    private Font getFont() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
        if (comp != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
            return comp.getFont();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
        } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
            if (defaultFont == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
                defaultFont = new Font("Dialog", Font.PLAIN, 12);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
            return defaultFont;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
    public Graphics2D createGraphics() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
        return new SunGraphics2D(volSurfaceManager.getPrimarySurfaceData(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
                                 getForeground(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
                                 getBackground(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
                                 getFont());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
    // Image method implementations
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
    public Object getProperty(String name, ImageObserver observer) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
        if (name == null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
            throw new NullPointerException("null property name is not allowed");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
        return java.awt.Image.UndefinedProperty;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
    public int getWidth(ImageObserver observer) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
        return getWidth();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
    public int getHeight(ImageObserver observer) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
        return getHeight();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
     * This method creates a BufferedImage intended for use as a "snapshot"
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
     * or a backup surface.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
    public BufferedImage getBackupImage() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
        return graphicsConfig.createCompatibleImage(getWidth(), getHeight(),
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
                                                    getTransparency());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
    public BufferedImage getSnapshot() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
        BufferedImage bi = getBackupImage();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
        Graphics2D g = bi.createGraphics();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
        g.setComposite(AlphaComposite.Src);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
        g.drawImage(this, 0, 0, null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
        g.dispose();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
        return bi;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
    public int validate(GraphicsConfiguration gc) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
        return volSurfaceManager.validate(gc);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
    public boolean contentsLost() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
        return volSurfaceManager.contentsLost();
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 ImageCapabilities getCapabilities() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
        return volSurfaceManager.getCapabilities(graphicsConfig);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
}