aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Macnak <natsu@google.com>2023-12-13 19:33:31 +0000
committerCherrypicker Worker <android-build-cherrypicker-worker@google.com>2023-12-15 16:18:37 +0000
commit8c528191b2dbfd0bb6e40dbe8a09613106625bdf (patch)
tree2da213c23e6a3261470e6cf1da8f7dcff07a67ac
parentcf42201561fe3df4ee59e6f7e505ed3e18afbbbc (diff)
downloadgoldfish-opengl-8c528191b2dbfd0bb6e40dbe8a09613106625bdf.tar.gz
Fix color conversion in HostFrameComposer
Bug: b/315817323 Test: cvd start --gpu_mode=gfxstream_guest_angle Test: cvd start --gpu_mode=gfxstream_guest_angle_host_swiftshader (cherry picked from https://android-review.googlesource.com/q/commit:fb5dd2ad7d1fd9321980452b5d47539c36481ef2) Merged-In: I216db30cee88d2b19b297815791b9ef5a55f3b84 Change-Id: I216db30cee88d2b19b297815791b9ef5a55f3b84
-rw-r--r--system/hwc3/HostFrameComposer.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/system/hwc3/HostFrameComposer.cpp b/system/hwc3/HostFrameComposer.cpp
index 6264052e..d82ece64 100644
--- a/system/hwc3/HostFrameComposer.cpp
+++ b/system/hwc3/HostFrameComposer.cpp
@@ -60,10 +60,10 @@ hwc_frect AsHwcFrect(const common::FRect& rect) {
hwc_color AsHwcColor(const Color& color) {
hwc_color out;
- out.r = color.r;
- out.g = color.g;
- out.b = color.b;
- out.a = color.a;
+ out.r = static_cast<uint8_t>(color.r * 255.0f);
+ out.g = static_cast<uint8_t>(color.g * 255.0f);
+ out.b = static_cast<uint8_t>(color.b * 255.0f);
+ out.a = static_cast<uint8_t>(color.a * 255.0f);
return out;
}