< prev index next >

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

Print this page

        

*** 29,44 **** import sun.java2d.pipe.AATileGenerator; import jdk.internal.misc.Unsafe; final class MarlinTileGenerator implements AATileGenerator, MarlinConst { 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% ! private static final int FILL_TILE_W = TILE_W >> 1; // half tile width static { if (MAX_TILE_ALPHA_SUM <= 0) { throw new IllegalStateException("Invalid MAX_TILE_ALPHA_SUM: " + MAX_TILE_ALPHA_SUM); } --- 29,46 ---- 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% ! private static final int FILL_TILE_W = Math.max(16, TILE_W >> 2); // 1/4th tile width static { if (MAX_TILE_ALPHA_SUM <= 0) { throw new IllegalStateException("Invalid MAX_TILE_ALPHA_SUM: " + MAX_TILE_ALPHA_SUM); }
*** 139,148 **** --- 141,154 ---- * @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 >