src/demo/share/java2d/J2DBench/src/j2dbench/tests/GraphicsTests.java

Print this page


   1 /*
   2  * Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
   3  *
   4  * Redistribution and use in source and binary forms, with or without
   5  * modification, are permitted provided that the following conditions
   6  * are met:
   7  *
   8  *   - Redistributions of source code must retain the above copyright
   9  *     notice, this list of conditions and the following disclaimer.
  10  *
  11  *   - Redistributions in binary form must reproduce the above copyright
  12  *     notice, this list of conditions and the following disclaimer in the
  13  *     documentation and/or other materials provided with the distribution.
  14  *
  15  *   - Neither the name of Oracle nor the names of its
  16  *     contributors may be used to endorse or promote products derived
  17  *     from this software without specific prior written permission.
  18  *
  19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  20  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  21  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  22  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR


  95     public static void init() {
  96         graphicsroot = new Group("graphics", "Graphics Benchmarks");
  97         graphicsroot.setTabbed();
  98 
  99         groptroot = new Group(graphicsroot, "opts", "General Graphics Options");
 100 
 101         animList = new Option.IntList(groptroot, "anim",
 102                                       "Movement of rendering position",
 103                                       new int[] {0, 1, 2},
 104                                       new String[] {
 105                                           "static", "slide", "bounce",
 106                                       },
 107                                       new String[] {
 108                                           "No movement",
 109                                           "Shift horizontal alignment",
 110                                           "Bounce around window",
 111                                       }, 0x4);
 112 
 113         sizeList = new Option.IntList(groptroot, "sizes",
 114                                       "Size of Operations to perform",
 115                                       new int[] {1, 20, 100, 250, 1000},
 116                                       new String[] {
 117                                           "1x1", "20x20", "100x100", "250x250",
 118                                           "1000x1000",
 119                                       },
 120                                       new String[] {
 121                                           "Tiny Shapes (1x1)",
 122                                           "Small Shapes (20x20)",
 123                                           "Medium Shapes (100x100)",
 124                                           "Large Shapes (250x250)",
 125                                           "X-Large Shapes (1000x1000)",

 126                                       }, 0xa);
 127         if (hasGraphics2D) {
 128             String rulenames[] = {
 129                 "Clear",
 130                 "Src",
 131                 "Dst",
 132                 "SrcOver",
 133                 "DstOver",
 134                 "SrcIn",
 135                 "DstIn",
 136                 "SrcOut",
 137                 "DstOut",
 138                 "SrcAtop",
 139                 "DstAtop",
 140                 "Xor",
 141             };
 142             String ruledescs[] = new String[rulenames.length];
 143             Object rules[] = new Object[rulenames.length];
 144             int j = 0;
 145             int defrule = 0;


   1 /*
   2  * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
   3  *
   4  * Redistribution and use in source and binary forms, with or without
   5  * modification, are permitted provided that the following conditions
   6  * are met:
   7  *
   8  *   - Redistributions of source code must retain the above copyright
   9  *     notice, this list of conditions and the following disclaimer.
  10  *
  11  *   - Redistributions in binary form must reproduce the above copyright
  12  *     notice, this list of conditions and the following disclaimer in the
  13  *     documentation and/or other materials provided with the distribution.
  14  *
  15  *   - Neither the name of Oracle nor the names of its
  16  *     contributors may be used to endorse or promote products derived
  17  *     from this software without specific prior written permission.
  18  *
  19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
  20  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
  21  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  22  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR


  95     public static void init() {
  96         graphicsroot = new Group("graphics", "Graphics Benchmarks");
  97         graphicsroot.setTabbed();
  98 
  99         groptroot = new Group(graphicsroot, "opts", "General Graphics Options");
 100 
 101         animList = new Option.IntList(groptroot, "anim",
 102                                       "Movement of rendering position",
 103                                       new int[] {0, 1, 2},
 104                                       new String[] {
 105                                           "static", "slide", "bounce",
 106                                       },
 107                                       new String[] {
 108                                           "No movement",
 109                                           "Shift horizontal alignment",
 110                                           "Bounce around window",
 111                                       }, 0x4);
 112 
 113         sizeList = new Option.IntList(groptroot, "sizes",
 114                                       "Size of Operations to perform",
 115                                       new int[] {1, 20, 100, 250, 1000, 4000},
 116                                       new String[] {
 117                                           "1x1", "20x20", "100x100", "250x250",
 118                                           "1000x1000", "4000x4000",
 119                                       },
 120                                       new String[] {
 121                                           "Tiny Shapes (1x1)",
 122                                           "Small Shapes (20x20)",
 123                                           "Medium Shapes (100x100)",
 124                                           "Large Shapes (250x250)",
 125                                           "X-Large Shapes (1000x1000)",
 126                                           "Huge Shapes (4000x4000)",
 127                                       }, 0xa);
 128         if (hasGraphics2D) {
 129             String rulenames[] = {
 130                 "Clear",
 131                 "Src",
 132                 "Dst",
 133                 "SrcOver",
 134                 "DstOver",
 135                 "SrcIn",
 136                 "DstIn",
 137                 "SrcOut",
 138                 "DstOut",
 139                 "SrcAtop",
 140                 "DstAtop",
 141                 "Xor",
 142             };
 143             String ruledescs[] = new String[rulenames.length];
 144             Object rules[] = new Object[rulenames.length];
 145             int j = 0;
 146             int defrule = 0;