Skip to content

Commit d99cc6e

Browse files
committed
renabled initialization code
1 parent 2821940 commit d99cc6e

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

core/src/processing/core/PApplet.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -884,6 +884,7 @@ public class SketchSurfaceViewGL extends GLSurfaceView {
884884
SurfaceHolder surfaceHolder;
885885

886886

887+
@SuppressWarnings("deprecation")
887888
public SketchSurfaceViewGL(Context context, int wide, int high,
888889
Class<? extends PGraphicsOpenGL> clazz) {
889890
super(context);
@@ -900,7 +901,7 @@ public SketchSurfaceViewGL(Context context, int wide, int high,
900901
surfaceHolder = getHolder();
901902
// are these two needed?
902903
surfaceHolder.addCallback(this);
903-
//surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_GPU);
904+
surfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_GPU);
904905

905906
// The PGraphics object needs to be created here so the renderer is not
906907
// null. This is required because PApplet.onResume events (which call

core/src/processing/opengl/PGraphicsOpenGL.java

+16-16
Original file line numberDiff line numberDiff line change
@@ -1974,23 +1974,23 @@ protected boolean pointBuffersContextIsOutdated() {
19741974
* OpenGL cannot draw until a proper native peer is available, so this
19751975
* returns the value of PApplet.isDisplayable() (inherited from Component).
19761976
*/
1977-
// @Override
1978-
// public boolean canDraw() {
1979-
// return pgl.canDraw();
1980-
// }
1977+
@Override
1978+
public boolean canDraw() {
1979+
return pgl.canDraw();
1980+
}
19811981

19821982

1983-
// @Override
1984-
// public void requestDraw() {
1985-
// if (primarySurface) {
1986-
// if (initialized) {
1987-
// if (sized) pgl.reinitSurface();
1988-
// if (parent.canDraw()) pgl.requestDraw();
1989-
// } else {
1990-
// initPrimary();
1991-
// }
1992-
// }
1993-
// }
1983+
@Override
1984+
public void requestDraw() {
1985+
if (primaryGraphics) {
1986+
if (initialized) {
1987+
if (sized) pgl.reinitSurface();
1988+
if (parent.canDraw()) pgl.requestDraw();
1989+
} else {
1990+
initPrimary();
1991+
}
1992+
}
1993+
}
19941994

19951995

19961996
@Override
@@ -6849,7 +6849,7 @@ public void resize(int wide, int high) {
68496849

68506850

68516851
protected void initPrimary() {
6852-
// pgl.initSurface(quality);
6852+
pgl.initSurface(smooth);
68536853
if (texture != null) {
68546854
removeCache(this);
68556855
texture = ptexture = null;

0 commit comments

Comments
 (0)