/* * Copyright (c) 2015, 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. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions.
*/
/** * @test * @summary Simple crash rendering test using huge GeneralPaths with the Marlin renderer * @run main/othervm -mx512m CrashTest * @ignore tests that take a long time and consumes 5Gb memory * @run main/othervm -ms4g -mx4g CrashTest -slow
*/ publicclass CrashTest {
// First display which renderer is tested:
System.setProperty("sun.java2d.renderer.verbose", "true");
// try insane image sizes:
// subpixel coords may overflow: // check MAX_VALUE / (8 * 2); overflow may happen due to orientation flag // But as it is impossible to allocate an image larger than 2Gb (byte) then // it is also impossible to have rowAAChunk larger than 2Gb !
// Disabled test as it consumes 4GB heap + offheap (2Gb) ie > 6Gb ! if (runSlowTests) {
testHugeImage((Integer.MAX_VALUE >> 4) - 100, 16);
}
// larger than 23 bits: (RLE)
testHugeImage(8388608 + 1, 10);
if (runSlowTests) {
test(0.1f, false, 0);
test(0.1f, true, 7f);
}
for (int i = 0; i < dashes.length; i += 2) {
dashes[i] = cur;
dashes[i + 1] = cur;
cur += step;
}
} else {
dashes = null;
}
if (USE_ROUND_CAPS_AND_JOINS) { // Use both round Caps & Joins: returnnew BasicStroke(width, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 100.0f, dashes, 0.0f);
} returnnew BasicStroke(width, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 100.0f, dashes, 0.0f);
}
}
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.2Bemerkung:
Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.