Browse Source

GLSurfaceView: report draw finished after first onDrawFrame in GLThread

At default, GLThread will not report draw finish after 1st
onDrawFrame. This will cause long black screen issue for game
whose 2nd onDrawFrame taking time, such as CandyCrash case
reported by customer.
This change ensure the draw finished to be reported after 1st
onDrawFrame.

CRs-Fixed: 2182359

Change-Id: I8b817bdb5d6dcaec9835b45c6efe8e6892c716fe
Signed-off-by: Adesh15 <adesikha15@gmail.com>
Signed-off-by: Harsh Shandilya <harsh@prjkt.io>
Signed-off-by: Simao Gomes Viana <xdevs23@outlook.com>
ten
shoudil 3 years ago
parent
commit
8109d2c613
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      opengl/java/android/opengl/GLSurfaceView.java

+ 4
- 0
opengl/java/android/opengl/GLSurfaceView.java View File

@@ -1570,6 +1570,10 @@ public class GLSurfaceView extends SurfaceView implements SurfaceHolder.Callback
if (view != null) {
try {
Trace.traceBegin(Trace.TRACE_TAG_VIEW, "onDrawFrame");
if (mFinishDrawingRunnable != null) {
finishDrawingRunnable = mFinishDrawingRunnable;
mFinishDrawingRunnable = null;
}
view.mRenderer.onDrawFrame(gl);
if (finishDrawingRunnable != null) {
finishDrawingRunnable.run();

Loading…
Cancel
Save