Fix output viewport size of empty FrameProcessorChain.

Since the output size can be overridden, the viewport should be
ouputWidth/Height and NOT the ExternalCopyFrameProcessor's output size
which matches the input size.

PiperOrigin-RevId: 437256635
This commit is contained in:
hschlueter 2022-03-25 15:44:18 +00:00 committed by Ian Baker
parent 67acfc67de
commit 92eb09fa6f

View File

@ -398,18 +398,16 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
private void processFrame() { private void processFrame() {
checkState(Thread.currentThread().equals(glThread)); checkState(Thread.currentThread().equals(glThread));
Size outputSize = inputSizes.get(0);
if (frameProcessors.isEmpty()) { if (frameProcessors.isEmpty()) {
GlUtil.focusEglSurface( GlUtil.focusEglSurface(eglDisplay, eglContext, eglSurface, outputWidth, outputHeight);
eglDisplay, eglContext, eglSurface, outputSize.getWidth(), outputSize.getHeight());
} else { } else {
GlUtil.focusFramebuffer( GlUtil.focusFramebuffer(
eglDisplay, eglDisplay,
eglContext, eglContext,
eglSurface, eglSurface,
framebuffers[0], framebuffers[0],
outputSize.getWidth(), inputSizes.get(0).getWidth(),
outputSize.getHeight()); inputSizes.get(0).getHeight());
} }
inputSurfaceTexture.updateTexImage(); inputSurfaceTexture.updateTexImage();
inputSurfaceTexture.getTransformMatrix(textureTransformMatrix); inputSurfaceTexture.getTransformMatrix(textureTransformMatrix);
@ -418,7 +416,7 @@ import org.checkerframework.checker.nullness.qual.RequiresNonNull;
externalCopyFrameProcessor.updateProgramAndDraw(presentationTimeNs); externalCopyFrameProcessor.updateProgramAndDraw(presentationTimeNs);
for (int i = 0; i < frameProcessors.size() - 1; i++) { for (int i = 0; i < frameProcessors.size() - 1; i++) {
outputSize = inputSizes.get(i + 1); Size outputSize = inputSizes.get(i + 1);
GlUtil.focusFramebuffer( GlUtil.focusFramebuffer(
eglDisplay, eglDisplay,
eglContext, eglContext,