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