src/java.desktop/macosx/classes/sun/java2d/metal/MTLVolatileSurfaceManager.java
author jdv
Fri, 21 Jun 2019 12:08:37 +0530
branchmetal-prototype-branch
changeset 57416 e153174dba06
permissions -rw-r--r--
Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch Reviewed-by: avu, prr, kcr Contributed-by: avu(Jetbrains), aghaisas, jdv
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
57416
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
     1
/*
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
     2
 * Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved.
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
     4
 *
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    10
 *
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    15
 * accompanied this code).
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    16
 *
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    20
 *
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    23
 * questions.
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    24
 */
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    25
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    26
package sun.java2d.metal;
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    27
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    28
import sun.awt.AWTAccessor;
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    29
import sun.awt.AWTAccessor.ComponentAccessor;
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    30
import sun.awt.image.SunVolatileImage;
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    31
import sun.awt.image.VolatileSurfaceManager;
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    32
import sun.java2d.BackBufferCapsProvider;
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    33
import sun.java2d.SurfaceData;
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    34
import sun.java2d.opengl.OGLSurfaceData;
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    35
import sun.java2d.pipe.hw.ExtendedBufferCapabilities;
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    36
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    37
import java.awt.*;
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    38
import java.awt.image.ColorModel;
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    39
import java.awt.peer.ComponentPeer;
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    40
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    41
import static java.awt.BufferCapabilities.FlipContents.COPIED;
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    42
//import static sun.java2d.opengl.OGLContext.OGLContextCaps.CAPS_EXT_FBOBJECT;
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    43
import static sun.java2d.pipe.hw.ExtendedBufferCapabilities.VSyncType.VSYNC_ON;
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    44
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    45
public class MTLVolatileSurfaceManager extends VolatileSurfaceManager {
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    46
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    47
    private final boolean accelerationEnabled;
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    48
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    49
    public MTLVolatileSurfaceManager(SunVolatileImage vImg, Object context) {
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    50
        super(vImg, context);
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    51
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    52
        /*
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    53
         * We will attempt to accelerate this image only under the
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    54
         * following conditions:
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    55
         *   - the image is not bitmask AND the GraphicsConfig supports the FBO
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    56
         *     extension
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    57
         */
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    58
        int transparency = vImg.getTransparency();
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    59
        MTLGraphicsConfig gc = (MTLGraphicsConfig) vImg.getGraphicsConfig();
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    60
        accelerationEnabled = true;
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    61
                //gc.isCapPresent(CAPS_EXT_FBOBJECT)
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    62
                //&& transparency != Transparency.BITMASK;
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    63
    }
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    64
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    65
    protected boolean isAccelerationEnabled() {
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    66
        return accelerationEnabled;
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    67
    }
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    68
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    69
    /**
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    70
     * Create a FBO-based SurfaceData object (or init the backbuffer
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    71
     * of an existing window if this is a double buffered GraphicsConfig)
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    72
     */
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    73
    protected SurfaceData initAcceleratedSurface() {
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    74
        SurfaceData sData = null;
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    75
        Component comp = vImg.getComponent();
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    76
        final ComponentAccessor acc = AWTAccessor.getComponentAccessor();
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    77
        final ComponentPeer peer = (comp != null) ? acc.getPeer(comp) : null;
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    78
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    79
        try {
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    80
            boolean createVSynced = false;
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    81
            boolean forceback = false;
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    82
            if (context instanceof Boolean) {
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    83
                forceback = ((Boolean)context).booleanValue();
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    84
                if (forceback && peer instanceof BackBufferCapsProvider) {
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    85
                    BackBufferCapsProvider provider =
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    86
                        (BackBufferCapsProvider)peer;
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    87
                    BufferCapabilities caps = provider.getBackBufferCaps();
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    88
                    if (caps instanceof ExtendedBufferCapabilities) {
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    89
                        ExtendedBufferCapabilities ebc =
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    90
                            (ExtendedBufferCapabilities)caps;
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    91
                        if (ebc.getVSync() == VSYNC_ON &&
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    92
                            ebc.getFlipContents() == COPIED)
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    93
                        {
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    94
                            createVSynced = true;
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    95
                            forceback = false;
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    96
                        }
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    97
                    }
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    98
                }
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
    99
            }
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   100
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   101
            if (forceback) {
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   102
                // peer must be non-null in this case
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   103
                // TODO: modify parameter to delegate
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   104
                //                sData = MTLSurfaceData.createData(peer, vImg, FLIP_BACKBUFFER);
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   105
            } else {
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   106
                MTLGraphicsConfig gc =
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   107
                    (MTLGraphicsConfig)vImg.getGraphicsConfig();
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   108
                ColorModel cm = gc.getColorModel(vImg.getTransparency());
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   109
                int type = vImg.getForcedAccelSurfaceType();
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   110
                // if acceleration type is forced (type != UNDEFINED) then
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   111
                // use the forced type, otherwise choose RT_TEXTURE
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   112
                if (type == OGLSurfaceData.UNDEFINED) {
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   113
                    type = OGLSurfaceData.FBOBJECT;
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   114
                }
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   115
                if (createVSynced) {
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   116
                    // TODO: modify parameter to delegate
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   117
//                  sData = MTLSurfaceData.createData(peer, vImg, type);
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   118
                } else {
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   119
                    sData = MTLSurfaceData.createData(gc,
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   120
                                                      vImg.getWidth(),
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   121
                                                      vImg.getHeight(),
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   122
                                                      cm, vImg, type);
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   123
                }
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   124
            }
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   125
        } catch (NullPointerException ex) {
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   126
            sData = null;
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   127
        } catch (OutOfMemoryError er) {
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   128
            sData = null;
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   129
        }
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   130
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   131
        return sData;
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   132
    }
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   133
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   134
    @Override
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   135
    protected boolean isConfigValid(GraphicsConfiguration gc) {
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   136
        return ((gc == null) || (gc == vImg.getGraphicsConfig()));
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   137
    }
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   138
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   139
    @Override
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   140
    public void initContents() {
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   141
        if (vImg.getForcedAccelSurfaceType() != OGLSurfaceData.TEXTURE) {
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   142
            super.initContents();
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   143
        }
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   144
    }
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   145
}
e153174dba06 Merge JDK-8220154 initial metal implementation patch to the jdk sandbox branch
jdv
parents:
diff changeset
   146