< 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      */
 437     @Override
 438     public ContextCapabilities getContextCapabilities() {
   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                 || type == FBOBJECT && !isCapPresent(CAPS_EXT_FBOBJECT)) {





 405             return null;
 406         }







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