mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
fix chrome and firefox 4 animation stuttering
This commit is contained in:
@@ -1424,6 +1424,8 @@ public class PApplet extends Applet
|
||||
|
||||
//synchronized public void paint(Graphics screen) { // shutting off for 0146
|
||||
public void paint(Graphics screen) {
|
||||
println("non-active paint");
|
||||
|
||||
// ignore the very first call to paint, since it's coming
|
||||
// from the o.s., and the applet will soon update itself anyway.
|
||||
if (frameCount == 0) {
|
||||
@@ -1452,28 +1454,6 @@ public class PApplet extends Applet
|
||||
}
|
||||
|
||||
|
||||
// active paint method
|
||||
protected void paint() {
|
||||
try {
|
||||
Graphics screen = this.getGraphics();
|
||||
if (screen != null) {
|
||||
if ((g != null) && (g.image != null)) {
|
||||
screen.drawImage(g.image, 0, 0, null);
|
||||
}
|
||||
Toolkit.getDefaultToolkit().sync();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// Seen on applet destroy, maybe can ignore?
|
||||
e.printStackTrace();
|
||||
|
||||
// } finally {
|
||||
// if (g != null) {
|
||||
// g.dispose();
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -1649,11 +1629,8 @@ public class PApplet extends Applet
|
||||
frameRateLastNanos = now;
|
||||
frameCount++;
|
||||
|
||||
// Actively render the screen
|
||||
paint();
|
||||
|
||||
// repaint();
|
||||
// getToolkit().sync(); // force repaint now (proper method)
|
||||
repaint();
|
||||
getToolkit().sync(); // force repaint now (proper method)
|
||||
|
||||
postMethods.handle();
|
||||
}
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
0193 core
|
||||
X fix problem that made applets suck in Google Chrome and Firefox 4
|
||||
|
||||
|
||||
_ java.lang.OutOfMemoryError using get() and image() inside a tight loop
|
||||
_ just need to swap out use of clone() since it's causing trouble
|
||||
_ http://code.google.com/p/processing/issues/detail?id=42
|
||||
|
||||
_ need to finish font changes wrt native fonts before any release
|
||||
_ right now not in a good place--default font will be bitmapped and ugly
|
||||
|
||||
Reference in New Issue
Block a user