< prev index next >
src/java.desktop/share/classes/sun/java2d/marlin/MarlinCache.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
@@ -41,13 +41,13 @@
= Math.max(BLOCK_SIZE, MarlinProperties.getRLEMinWidth());
// maximum width for RLE encoding:
// values are stored as int [x|alpha] where alpha is 8 bits
static final int RLE_MAX_WIDTH = 1 << (24 - 1);
- // 2048 (pixelSize) alpha values (width) x 32 rows (tile) = 64K bytes
+ // 4096 (pixels) alpha values (width) x 64 rows / 4 (tile) = 64K bytes
// x1 instead of 4 bytes (RLE) ie 1/4 capacity or average good RLE compression
- static final long INITIAL_CHUNK_ARRAY = TILE_H * INITIAL_PIXEL_DIM; // 64K
+ static final long INITIAL_CHUNK_ARRAY = TILE_H * INITIAL_PIXEL_WIDTH >> 2; // 64K
// The alpha map used by this object (taken out of our map cache) to convert
// pixel coverage counts gotten from MarlinCache (which are in the range
// [0, maxalpha]) into alpha values, which are in [0,256).
static final byte[] ALPHA_MAP;
@@ -290,15 +290,15 @@
val += alphaRow[x]; // [from; to[
// ensure values are in [0; MAX_AA_ALPHA] range
if (DO_AA_RANGE_CHECK) {
if (val < 0) {
- System.out.println("Invalid coverage = " + val);
+ MarlinUtils.logInfo("Invalid coverage = " + val);
val = 0;
}
if (val > MAX_AA_ALPHA) {
- System.out.println("Invalid coverage = " + val);
+ MarlinUtils.logInfo("Invalid coverage = " + val);
val = MAX_AA_ALPHA;
}
}
// store alpha sum (as byte):
@@ -458,15 +458,15 @@
val += delta;
// ensure values are in [0; MAX_AA_ALPHA] range
if (DO_AA_RANGE_CHECK) {
if (val < 0) {
- System.out.println("Invalid coverage = " + val);
+ MarlinUtils.logInfo("Invalid coverage = " + val);
val = 0;
}
if (val > MAX_AA_ALPHA) {
- System.out.println("Invalid coverage = " + val);
+ MarlinUtils.logInfo("Invalid coverage = " + val);
val = MAX_AA_ALPHA;
}
}
}
}
@@ -628,11 +628,9 @@
// double size !
final byte[] alMap = new byte[maxalpha << 1];
final int halfmaxalpha = maxalpha >> 2;
for (int i = 0; i <= maxalpha; i++) {
alMap[i] = (byte) ((i * 255 + halfmaxalpha) / maxalpha);
-// System.out.println("alphaMap[" + i + "] = "
-// + Byte.toUnsignedInt(alMap[i]));
}
return alMap;
}
}
< prev index next >