Skip to content

Commit

Permalink
GLSurfaceView: report draw finished after first onDrawFrame in GLThread
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Harsh Shandilya <[email protected]>
Signed-off-by: Simao Gomes Viana <[email protected]>
  • Loading branch information
shoudil authored and sagarrokade006 committed Oct 12, 2020
1 parent c9a7618 commit 433c3ff
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions opengl/java/android/opengl/GLSurfaceView.java
Original file line number Diff line number Diff line change
Expand Up @@ -1570,6 +1570,10 @@ private void guardedRun() throws InterruptedException {
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();
Expand Down

0 comments on commit 433c3ff

Please sign in to comment.