< prev index next >

src/java.desktop/unix/classes/sun/java2d/opengl/GLXGraphicsConfig.java

Print this page


   1 /*
   2  * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 382         public boolean isTrueVolatile() {
 383             return true;
 384         }
 385     }
 386 
 387     @Override
 388     public ImageCapabilities getImageCapabilities() {
 389         return imageCaps;
 390     }
 391 
 392     /**
 393      * {@inheritDoc}
 394      *
 395      * @see sun.java2d.pipe.hw.AccelGraphicsConfig#createCompatibleVolatileImage
 396      */
 397     @Override
 398     public VolatileImage
 399         createCompatibleVolatileImage(int width, int height,
 400                                       int transparency, int type)
 401     {
 402         if (type == FLIP_BACKBUFFER || type == WINDOW || type == UNDEFINED ||
 403             transparency == Transparency.BITMASK)
 404         {
 405             return null;
 406         }
 407 
 408         if (type == FBOBJECT) {
 409             if (!isCapPresent(CAPS_EXT_FBOBJECT)) {
 410                 return null;
 411             }
 412         } else if (type == PBUFFER) {
 413             boolean isOpaque = transparency == Transparency.OPAQUE;
 414             if (!isOpaque && !isCapPresent(CAPS_STORED_ALPHA)) {
 415                 return null;
 416             }
 417         }
 418 
 419         SunVolatileImage vi = new AccelTypedVolatileImage(this, width, height,
 420                                                           transparency, type);
 421         Surface sd = vi.getDestSurface();
 422         if (!(sd instanceof AccelSurface) ||
 423             ((AccelSurface)sd).getType() != type)
 424         {
 425             vi.flush();
 426             vi = null;
 427         }
 428 
 429         return vi;
 430     }
 431 
 432     /**
 433      * {@inheritDoc}
 434      *
 435      * @see sun.java2d.pipe.hw.AccelGraphicsConfig#getContextCapabilities
 436      */
   1 /*
   2  * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


 382         public boolean isTrueVolatile() {
 383             return true;
 384         }
 385     }
 386 
 387     @Override
 388     public ImageCapabilities getImageCapabilities() {
 389         return imageCaps;
 390     }
 391 
 392     /**
 393      * {@inheritDoc}
 394      *
 395      * @see sun.java2d.pipe.hw.AccelGraphicsConfig#createCompatibleVolatileImage
 396      */
 397     @Override
 398     public VolatileImage
 399         createCompatibleVolatileImage(int width, int height,
 400                                       int transparency, int type)
 401     {
 402         if ((type != FBOBJECT && type != TEXTURE)
 403                 || transparency == Transparency.BITMASK) {

 404             return null;
 405         }
 406 
 407         if (type == FBOBJECT) {
 408             if (!isCapPresent(CAPS_EXT_FBOBJECT)) {
 409                 return null;
 410             }





 411         }
 412 
 413         SunVolatileImage vi = new AccelTypedVolatileImage(this, width, height,
 414                                                           transparency, type);
 415         Surface sd = vi.getDestSurface();
 416         if (!(sd instanceof AccelSurface) ||
 417             ((AccelSurface)sd).getType() != type)
 418         {
 419             vi.flush();
 420             vi = null;
 421         }
 422 
 423         return vi;
 424     }
 425 
 426     /**
 427      * {@inheritDoc}
 428      *
 429      * @see sun.java2d.pipe.hw.AccelGraphicsConfig#getContextCapabilities
 430      */
< prev index next >