diff options
author | Joshua Duong <joshuaduong@google.com> | 2023-04-18 07:57:39 -0700 |
---|---|---|
committer | Joshua Duong <joshuaduong@google.com> | 2023-04-18 07:57:39 -0700 |
commit | f931778bbd6ff9c98d37cbeb3926ce3f83f92007 (patch) | |
tree | 7aa852a59e35a53fc636390a627b8a431bdefc5e | |
parent | 6ce719d0df8661ffa6eec89bed178d562bd5a62c (diff) | |
download | vulkan-cereal-f931778bbd6ff9c98d37cbeb3926ce3f83f92007.tar.gz |
Use correct screen width/height in screenshots.
This fixes an incorrect size displayed in embedded emulator when in the
folded state.
Bug: 270230050
Test: boot embedded emulator and fold
Change-Id: I82f183bf520098f515be5f5a9c7742f591f0e80d
-rw-r--r-- | stream-servers/FrameBuffer.cpp | 4 | ||||
-rw-r--r-- | stream-servers/gl/ColorBufferGl.cpp | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/stream-servers/FrameBuffer.cpp b/stream-servers/FrameBuffer.cpp index 75b22986..90a2a744 100644 --- a/stream-servers/FrameBuffer.cpp +++ b/stream-servers/FrameBuffer.cpp @@ -2698,8 +2698,8 @@ int FrameBuffer::getScreenshot(unsigned int nChannels, unsigned int* width, unsi Post scrCmd; scrCmd.cmd = PostCmd::Screenshot; scrCmd.screenshot.cb = colorBuffer.get(); - scrCmd.screenshot.screenwidth = *width; - scrCmd.screenshot.screenheight = *height; + scrCmd.screenshot.screenwidth = screenWidth; + scrCmd.screenshot.screenheight = screenHeight; scrCmd.screenshot.format = format; scrCmd.screenshot.type = GL_UNSIGNED_BYTE; scrCmd.screenshot.rotation = desiredRotation; diff --git a/stream-servers/gl/ColorBufferGl.cpp b/stream-servers/gl/ColorBufferGl.cpp index f3957bfc..3faea8b5 100644 --- a/stream-servers/gl/ColorBufferGl.cpp +++ b/stream-servers/gl/ColorBufferGl.cpp @@ -432,6 +432,8 @@ void ColorBufferGl::readPixelsScaled(int width, int height, GLenum p_format, GLe if (useSnipping) { s_gles2.glReadPixels(rect.pos.x, rect.pos.y, rect.size.w, rect.size.h, p_format, p_type, readPixelsDst); + width = rect.size.w; + height = rect.size.h; } else { s_gles2.glReadPixels(0, 0, width, height, p_format, p_type, readPixelsDst); |