38 /**
39 * Contains the runtime arguments used by Prism.
40 */
41 public final class PrismSettings {
42
43 public static final boolean verbose;
44 public static final boolean debug;
45 public static final boolean trace;
46 public static final boolean printAllocs;
47 public static final boolean isVsyncEnabled;
48 public static final boolean dirtyOptsEnabled;
49 public static final boolean occlusionCullingEnabled;
50 public static final boolean scrollCacheOpt;
51 public static final boolean threadCheck;
52 public static final boolean cacheSimpleShapes;
53 public static final boolean cacheComplexShapes;
54 public static final boolean useNewImageLoader;
55 public static final List<String> tryOrder;
56 public static final int prismStatFrequency;
57 public static final boolean doNativePisces;
58 public static final String refType;
59 public static final boolean forceRepaint;
60 public static final boolean noFallback;
61 public static final boolean showDirtyRegions;
62 public static final boolean showOverdraw;
63 public static final boolean printRenderGraph;
64 public static final int minRTTSize;
65 public static final int dirtyRegionCount;
66 public static final boolean disableBadDriverWarning;
67 public static final boolean forceGPU;
68 public static final int maxTextureSize;
69 public static final int primTextureSize;
70 public static final boolean disableRegionCaching;
71 public static final boolean forcePow2;
72 public static final boolean noClampToZero;
73 public static final boolean disableD3D9Ex;
74 public static final boolean allowHiDPIScaling;
75 public static final long maxVram;
76 public static final long targetVram;
77 public static final boolean poolStats;
197 if (order != null) {
198 tryOrderArr = split(order, ",");
199 } else {
200 if (PlatformUtil.isWindows()) {
201 tryOrderArr = new String[] { "d3d", "sw" };
202 } else if (PlatformUtil.isMac()) {
203 tryOrderArr = new String[] { "es2", "sw" };
204 } else if (PlatformUtil.isIOS()) {
205 tryOrderArr = new String[] { "es2" };
206 } else if (PlatformUtil.isAndroid()) {
207 tryOrderArr = new String[] { "es2" };
208 } else if (PlatformUtil.isLinux()) {
209 tryOrderArr = new String[] { "es2", "sw" };
210 } else {
211 tryOrderArr = new String[] { "sw" };
212 }
213 }
214
215 tryOrder = Collections.unmodifiableList(Arrays.asList(tryOrderArr));
216
217 String npprop = systemProperties.getProperty("prism.nativepisces");
218 if (npprop == null) {
219 doNativePisces = PlatformUtil.isEmbedded() || !PlatformUtil.isLinux();
220 } else {
221 doNativePisces = Boolean.parseBoolean(npprop);
222 }
223
224 String primtex = systemProperties.getProperty("prism.primtextures");
225 if (primtex == null) {
226 primTextureSize = PlatformUtil.isEmbedded() ? -1 : 0;
227 } else if (primtex.equals("true")) {
228 primTextureSize = -1;
229 } else if (primtex.equals("false")) {
230 primTextureSize = 0;
231 } else {
232 primTextureSize =
233 parseInt(primtex, 0,
234 "Try -Dprism.primtextures=[true|false|<number>]");
235 }
236
237 /* Setting for reference type used by Disposer */
238 refType = systemProperties.getProperty("prism.reftype");
239
240 forcePow2 = getBoolean(systemProperties, "prism.forcepowerof2", false);
241 noClampToZero = getBoolean(systemProperties, "prism.noclamptozero", false);
242
243 allowHiDPIScaling = getBoolean(systemProperties, "prism.allowhidpi", true);
244
245 maxVram = getLong(systemProperties, "prism.maxvram", 512 * 1024 * 1024,
246 "Try -Dprism.maxvram=<long>[kKmMgG]");
247 targetVram = getLong(systemProperties, "prism.targetvram", maxVram / 8, maxVram,
248 "Try -Dprism.targetvram=<long>[kKmMgG]|<double(0,100)>%");
249 poolStats = getBoolean(systemProperties, "prism.poolstats", false);
250 poolDebug = getBoolean(systemProperties, "prism.pooldebug", false);
251
252 if (verbose) {
253 System.out.print("Prism pipeline init order: ");
254 for (String s : tryOrder) {
255 System.out.print(s+" ");
256 }
257 System.out.println("");
258 String piscestype = (doNativePisces ? "native" : "java");
259 System.out.println("Using " + piscestype + "-based Pisces rasterizer");
260 printBooleanOption(dirtyOptsEnabled, "Using dirty region optimizations");
261 if (primTextureSize == 0) {
262 System.out.println("Not using texture mask for primitives");
263 } else if (primTextureSize < 0) {
264 System.out.println("Using system sized mask for primitives");
265 } else {
266 System.out.println("Using "+primTextureSize+" sized mask for primitives");
267 }
268 printBooleanOption(forcePow2, "Forcing power of 2 sizes for textures");
269 printBooleanOption(!noClampToZero, "Using hardware CLAMP_TO_ZERO mode");
270 printBooleanOption(allowHiDPIScaling, "Opting in for HiDPI pixel scaling");
271 }
272
273 /*
274 * Setting for maximum texture size. Default is 4096.
275 * This will clamp the limit reported by the card to the specified
276 * value. A value of <= 0 will disable this clamping, causing the
277 * limit reported by the card to be used without modification.
278 *
279 * See RT-21998. This is a workaround for the fact that we don't
|
38 /**
39 * Contains the runtime arguments used by Prism.
40 */
41 public final class PrismSettings {
42
43 public static final boolean verbose;
44 public static final boolean debug;
45 public static final boolean trace;
46 public static final boolean printAllocs;
47 public static final boolean isVsyncEnabled;
48 public static final boolean dirtyOptsEnabled;
49 public static final boolean occlusionCullingEnabled;
50 public static final boolean scrollCacheOpt;
51 public static final boolean threadCheck;
52 public static final boolean cacheSimpleShapes;
53 public static final boolean cacheComplexShapes;
54 public static final boolean useNewImageLoader;
55 public static final List<String> tryOrder;
56 public static final int prismStatFrequency;
57 public static final boolean doNativePisces;
58 public static final boolean useMarlinRasterizer;
59 public static final String refType;
60 public static final boolean forceRepaint;
61 public static final boolean noFallback;
62 public static final boolean showDirtyRegions;
63 public static final boolean showOverdraw;
64 public static final boolean printRenderGraph;
65 public static final int minRTTSize;
66 public static final int dirtyRegionCount;
67 public static final boolean disableBadDriverWarning;
68 public static final boolean forceGPU;
69 public static final int maxTextureSize;
70 public static final int primTextureSize;
71 public static final boolean disableRegionCaching;
72 public static final boolean forcePow2;
73 public static final boolean noClampToZero;
74 public static final boolean disableD3D9Ex;
75 public static final boolean allowHiDPIScaling;
76 public static final long maxVram;
77 public static final long targetVram;
78 public static final boolean poolStats;
198 if (order != null) {
199 tryOrderArr = split(order, ",");
200 } else {
201 if (PlatformUtil.isWindows()) {
202 tryOrderArr = new String[] { "d3d", "sw" };
203 } else if (PlatformUtil.isMac()) {
204 tryOrderArr = new String[] { "es2", "sw" };
205 } else if (PlatformUtil.isIOS()) {
206 tryOrderArr = new String[] { "es2" };
207 } else if (PlatformUtil.isAndroid()) {
208 tryOrderArr = new String[] { "es2" };
209 } else if (PlatformUtil.isLinux()) {
210 tryOrderArr = new String[] { "es2", "sw" };
211 } else {
212 tryOrderArr = new String[] { "sw" };
213 }
214 }
215
216 tryOrder = Collections.unmodifiableList(Arrays.asList(tryOrderArr));
217
218 useMarlinRasterizer = getBoolean(systemProperties, "prism.marlinrasterizer", false);
219 if (useMarlinRasterizer) {
220 doNativePisces = false;
221 } else {
222 String npprop = systemProperties.getProperty("prism.nativepisces");
223 if (npprop == null) {
224 doNativePisces = PlatformUtil.isEmbedded() || !PlatformUtil.isLinux();
225 } else {
226 doNativePisces = Boolean.parseBoolean(npprop);
227 }
228 }
229
230 String primtex = systemProperties.getProperty("prism.primtextures");
231 if (primtex == null) {
232 primTextureSize = PlatformUtil.isEmbedded() ? -1 : 0;
233 } else if (primtex.equals("true")) {
234 primTextureSize = -1;
235 } else if (primtex.equals("false")) {
236 primTextureSize = 0;
237 } else {
238 primTextureSize =
239 parseInt(primtex, 0,
240 "Try -Dprism.primtextures=[true|false|<number>]");
241 }
242
243 /* Setting for reference type used by Disposer */
244 refType = systemProperties.getProperty("prism.reftype");
245
246 forcePow2 = getBoolean(systemProperties, "prism.forcepowerof2", false);
247 noClampToZero = getBoolean(systemProperties, "prism.noclamptozero", false);
248
249 allowHiDPIScaling = getBoolean(systemProperties, "prism.allowhidpi", true);
250
251 maxVram = getLong(systemProperties, "prism.maxvram", 512 * 1024 * 1024,
252 "Try -Dprism.maxvram=<long>[kKmMgG]");
253 targetVram = getLong(systemProperties, "prism.targetvram", maxVram / 8, maxVram,
254 "Try -Dprism.targetvram=<long>[kKmMgG]|<double(0,100)>%");
255 poolStats = getBoolean(systemProperties, "prism.poolstats", false);
256 poolDebug = getBoolean(systemProperties, "prism.pooldebug", false);
257
258 if (verbose) {
259 System.out.print("Prism pipeline init order: ");
260 for (String s : tryOrder) {
261 System.out.print(s+" ");
262 }
263 System.out.println("");
264 if (useMarlinRasterizer) {
265 System.out.println("Using Marlin rasterizer");
266 } else {
267 String piscestype = (doNativePisces ? "native" : "java");
268 System.out.println("Using " + piscestype + "-based Pisces rasterizer");
269 }
270 printBooleanOption(dirtyOptsEnabled, "Using dirty region optimizations");
271 if (primTextureSize == 0) {
272 System.out.println("Not using texture mask for primitives");
273 } else if (primTextureSize < 0) {
274 System.out.println("Using system sized mask for primitives");
275 } else {
276 System.out.println("Using "+primTextureSize+" sized mask for primitives");
277 }
278 printBooleanOption(forcePow2, "Forcing power of 2 sizes for textures");
279 printBooleanOption(!noClampToZero, "Using hardware CLAMP_TO_ZERO mode");
280 printBooleanOption(allowHiDPIScaling, "Opting in for HiDPI pixel scaling");
281 }
282
283 /*
284 * Setting for maximum texture size. Default is 4096.
285 * This will clamp the limit reported by the card to the specified
286 * value. A value of <= 0 will disable this clamping, causing the
287 * limit reported by the card to be used without modification.
288 *
289 * See RT-21998. This is a workaround for the fact that we don't
|