< prev index next >

src/java.desktop/share/classes/sun/java2d/marlin/MarlinTileGenerator.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -29,10 +29,12 @@
 import sun.java2d.pipe.AATileGenerator;
 import jdk.internal.misc.Unsafe;
 
 final class MarlinTileGenerator implements AATileGenerator, MarlinConst {
 
+    private static final boolean DISABLE_BLEND = false;
+
     private static final int MAX_TILE_ALPHA_SUM = TILE_W * TILE_H * MAX_AA_ALPHA;
 
     private static final int TH_AA_ALPHA_FILL_EMPTY = ((MAX_AA_ALPHA + 1) / 3); // 33%
     private static final int TH_AA_ALPHA_FILL_FULL  = ((MAX_AA_ALPHA + 1) * 2 / 3); // 66%
 

@@ -41,14 +43,14 @@
     static {
         if (MAX_TILE_ALPHA_SUM <= 0) {
             throw new IllegalStateException("Invalid MAX_TILE_ALPHA_SUM: " + MAX_TILE_ALPHA_SUM);
         }
         if (DO_TRACE) {
-            System.out.println("MAX_AA_ALPHA           : " + MAX_AA_ALPHA);
-            System.out.println("TH_AA_ALPHA_FILL_EMPTY : " + TH_AA_ALPHA_FILL_EMPTY);
-            System.out.println("TH_AA_ALPHA_FILL_FULL  : " + TH_AA_ALPHA_FILL_FULL);
-            System.out.println("FILL_TILE_W            : " + FILL_TILE_W);
+            MarlinUtils.logInfo("MAX_AA_ALPHA           : " + MAX_AA_ALPHA);
+            MarlinUtils.logInfo("TH_AA_ALPHA_FILL_EMPTY : " + TH_AA_ALPHA_FILL_EMPTY);
+            MarlinUtils.logInfo("TH_AA_ALPHA_FILL_FULL  : " + TH_AA_ALPHA_FILL_FULL);
+            MarlinUtils.logInfo("FILL_TILE_W            : " + FILL_TILE_W);
         }
     }
 
     private final Renderer rdrF;
     private final DRenderer rdrD;

@@ -139,10 +141,14 @@
      * @return 0x00 for no coverage, 0xff for total coverage, or any other
      *         value for partial coverage of the tile
      */
     @Override
     public int getTypicalAlpha() {
+        if (DISABLE_BLEND) {
+            // always return empty tiles to disable blending operations
+            return 0x00;
+        }
         int al = cache.alphaSumInTile(x);
         // Note: if we have a filled rectangle that doesn't end on a tile
         // border, we could still return 0xff, even though al!=maxTileAlphaSum
         // This is because if we return 0xff, our users will fill a rectangle
         // starting at x,y that has width = Math.min(TILE_SIZE, bboxX1-x),
< prev index next >