mirror of
https://github.com/Genymobile/scrcpy.git
synced 2025-08-02 22:29:25 +00:00
autodraw
This commit is contained in:
parent
c27d116a66
commit
139b3e688a
2 changed files with 18 additions and 8 deletions
|
@ -193,14 +193,20 @@ public final class OpenGLRunner {
|
||||||
|
|
||||||
filter.init();
|
filter.init();
|
||||||
|
|
||||||
surfaceTexture.setOnFrameAvailableListener(surfaceTexture -> {
|
Runnable runnable = new Runnable() {
|
||||||
if (stopped) {
|
@Override public void run() {
|
||||||
// Make sure to never render after resources have been released
|
if (stopped) {
|
||||||
return;
|
// Make sure to never render after resources have been released
|
||||||
}
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
render(outputSize);
|
render(outputSize);
|
||||||
}, handler);
|
|
||||||
|
handler.postDelayed(this, 15);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
handler.post(runnable);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void render(Size outputSize) {
|
private void render(Size outputSize) {
|
||||||
|
@ -219,7 +225,7 @@ public final class OpenGLRunner {
|
||||||
|
|
||||||
filter.draw(textureId, matrix);
|
filter.draw(textureId, matrix);
|
||||||
|
|
||||||
EGLExt.eglPresentationTimeANDROID(eglDisplay, eglSurface, surfaceTexture.getTimestamp());
|
//EGLExt.eglPresentationTimeANDROID(eglDisplay, eglSurface, surfaceTexture.getTimestamp());
|
||||||
EGL14.eglSwapBuffers(eglDisplay, eglSurface);
|
EGL14.eglSwapBuffers(eglDisplay, eglSurface);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -111,6 +111,10 @@ public class ScreenCapture extends SurfaceCapture {
|
||||||
virtualDisplay = null;
|
virtualDisplay = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (transform == null) {
|
||||||
|
transform = AffineMatrix.IDENTITY;
|
||||||
|
}
|
||||||
|
|
||||||
Size inputSize;
|
Size inputSize;
|
||||||
if (transform != null) {
|
if (transform != null) {
|
||||||
// If there is a filter, it must receive the full display content
|
// If there is a filter, it must receive the full display content
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue