equal
deleted
inserted
replaced
108 |
108 |
109 boolean doubleBufferingEnabled = true; |
109 boolean doubleBufferingEnabled = true; |
110 |
110 |
111 private Dimension doubleBufferMaxSize; |
111 private Dimension doubleBufferMaxSize; |
112 |
112 |
|
113 private boolean isCustomMaxBufferSizeSet = false; |
|
114 |
113 // Support for both the standard and volatile offscreen buffers exists to |
115 // Support for both the standard and volatile offscreen buffers exists to |
114 // provide backwards compatibility for the [rare] programs which may be |
116 // provide backwards compatibility for the [rare] programs which may be |
115 // calling getOffScreenBuffer() and not expecting to get a VolatileImage. |
117 // calling getOffScreenBuffer() and not expecting to get a VolatileImage. |
116 // Swing internally is migrating to use *only* the volatile image buffer. |
118 // Swing internally is migrating to use *only* the volatile image buffer. |
117 |
119 |
333 } |
335 } |
334 processingRunnable = new ProcessingRunnable(); |
336 processingRunnable = new ProcessingRunnable(); |
335 } |
337 } |
336 |
338 |
337 private void displayChanged() { |
339 private void displayChanged() { |
338 clearImages(); |
340 if (isCustomMaxBufferSizeSet) { |
|
341 clearImages(); |
|
342 } else { |
|
343 // Reset buffer maximum size to get valid size from updated graphics |
|
344 // environment in getDoubleBufferMaximumSize() |
|
345 setDoubleBufferMaximumSize(null); |
|
346 } |
339 } |
347 } |
340 |
348 |
341 /** |
349 /** |
342 * Mark the component as in need of layout and queue a runnable |
350 * Mark the component as in need of layout and queue a runnable |
343 * for the event dispatching thread that will validate the components |
351 * for the event dispatching thread that will validate the components |
1154 * @param d the dimension |
1162 * @param d the dimension |
1155 */ |
1163 */ |
1156 public void setDoubleBufferMaximumSize(Dimension d) { |
1164 public void setDoubleBufferMaximumSize(Dimension d) { |
1157 doubleBufferMaxSize = d; |
1165 doubleBufferMaxSize = d; |
1158 if (doubleBufferMaxSize == null) { |
1166 if (doubleBufferMaxSize == null) { |
|
1167 isCustomMaxBufferSizeSet = false; |
1159 clearImages(); |
1168 clearImages(); |
1160 } else { |
1169 } else { |
|
1170 isCustomMaxBufferSizeSet = true; |
1161 clearImages(d.width, d.height); |
1171 clearImages(d.width, d.height); |
1162 } |
1172 } |
1163 } |
1173 } |
1164 |
1174 |
1165 private void clearImages() { |
1175 private void clearImages() { |