498 synchronized (totalDisplayBounds) { 499 Rectangle virtualBounds = new Rectangle(); 500 for (GraphicsDevice gd : GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices()) { 501 for (GraphicsConfiguration gc : gd.getConfigurations()) { 502 virtualBounds = virtualBounds.union(gc.getBounds()); 503 } 504 } 505 totalDisplayBounds.setBounds(virtualBounds); 506 } 507 } 508 509 510 // 7160609: GL still fails to create a square texture of this size, 511 // so we use this value to cap the total display bounds. 512 private int getMaxTextureSize() { 513 return cachedMaxTextureSize; 514 } 515 516 @Override 517 public int getMaxTextureWidth() { 518 int width; 519 520 synchronized (totalDisplayBounds) { 521 if (totalDisplayBounds.width == 0) { 522 updateTotalDisplayBounds(); 523 } 524 width = totalDisplayBounds.width; 525 } 526 527 return Math.min(width, getMaxTextureSize()); 528 } 529 530 @Override 531 public int getMaxTextureHeight() { 532 int height; 533 534 synchronized (totalDisplayBounds) { 535 if (totalDisplayBounds.height == 0) { 536 updateTotalDisplayBounds(); 537 } 538 height = totalDisplayBounds.height; 539 } 540 541 return Math.min(height, getMaxTextureSize()); 542 } 543 } | 498 synchronized (totalDisplayBounds) { 499 Rectangle virtualBounds = new Rectangle(); 500 for (GraphicsDevice gd : GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices()) { 501 for (GraphicsConfiguration gc : gd.getConfigurations()) { 502 virtualBounds = virtualBounds.union(gc.getBounds()); 503 } 504 } 505 totalDisplayBounds.setBounds(virtualBounds); 506 } 507 } 508 509 510 // 7160609: GL still fails to create a square texture of this size, 511 // so we use this value to cap the total display bounds. 512 private int getMaxTextureSize() { 513 return cachedMaxTextureSize; 514 } 515 516 @Override 517 public int getMaxTextureWidth() { 518 //Temporary disable this logic and use some magic constrain. 519 /* 520 int width; 521 522 synchronized (totalDisplayBounds) { 523 if (totalDisplayBounds.width == 0) { 524 updateTotalDisplayBounds(); 525 } 526 width = totalDisplayBounds.width; 527 } 528 529 return Math.min(width, getMaxTextureSize()); 530 */ 531 return getMaxTextureSize() / (getDevice().getScaleFactor() * 2); 532 } 533 534 @Override 535 public int getMaxTextureHeight() { 536 //Temporary disable this logic and use some magic constrain. 537 /* 538 int height; 539 540 synchronized (totalDisplayBounds) { 541 if (totalDisplayBounds.height == 0) { 542 updateTotalDisplayBounds(); 543 } 544 height = totalDisplayBounds.height; 545 } 546 547 return Math.min(height, getMaxTextureSize()); 548 */ 549 return getMaxTextureSize() / (getDevice().getScaleFactor() * 2); 550 } 551 } |