Skip to content

Commit c8c4ced

Browse files
Romain GuyAndroid (Google) Code Review
authored andcommitted
Merge "Call invalidate() immediately when a frame is available" into jb-dev
2 parents f7a44e8 + 52c145f commit c8c4ced

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

core/java/android/view/TextureView.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import android.graphics.Paint;
2424
import android.graphics.Rect;
2525
import android.graphics.SurfaceTexture;
26+
import android.os.Looper;
2627
import android.util.AttributeSet;
2728
import android.util.Log;
2829

@@ -353,7 +354,12 @@ public void onFrameAvailable(SurfaceTexture surfaceTexture) {
353354
synchronized (mLock) {
354355
mUpdateLayer = true;
355356
}
356-
postInvalidate();
357+
358+
if (Looper.myLooper() == Looper.getMainLooper()) {
359+
invalidate();
360+
} else {
361+
postInvalidate();
362+
}
357363
}
358364
};
359365
mSurface.setOnFrameAvailableListener(mUpdateListener);

0 commit comments

Comments
 (0)