aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBo Hu <bohu@google.com>2024-04-16 09:18:53 -0700
committerBo Hu <bohu@google.com>2024-04-16 18:06:37 +0000
commitd2049d02aa1f92964fd9d1cd0243e547ff02b9df (patch)
treef75c673a1656491943ad904c764743a2d5760986
parentc3407cd72eab0832c6d2b811ce0479386bf0cc31 (diff)
downloadgfxstream-d2049d02aa1f92964fd9d1cd0243e547ff02b9df.tar.gz
resizable: clear width, height and number of pixels when skip frames
When we are skipping frames, need to clear those variables as the callers are depending on them to check whether a frame is available. Bug: 296127332 Change-Id: I72e918aab8b0b39df5c0a7ceb2f2e942caff7395
-rw-r--r--host/FrameBuffer.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/host/FrameBuffer.cpp b/host/FrameBuffer.cpp
index 411ddc91..3bab94a7 100644
--- a/host/FrameBuffer.cpp
+++ b/host/FrameBuffer.cpp
@@ -1987,6 +1987,9 @@ int FrameBuffer::getScreenshot(unsigned int nChannels, unsigned int* width, unsi
uint8_t* pixels, size_t* cPixels, int displayId, int desiredWidth,
int desiredHeight, int desiredRotation, Rect rect) {
if (emugl::shouldSkipDraw()) {
+ *width = 0;
+ *height = 0;
+ *cPixels = 0;
return -1;
}
AutoLock mutex(m_lock);