summaryrefslogtreecommitdiff
path: root/libs/ultrahdr/jpegencoderhelper.cpp
diff options
context:
space:
mode:
author Ryan Prichard <rprichard@google.com> 2023-10-18 08:35:03 +0000
committer Android Build Cherrypicker Worker <android-build-cherrypicker-worker@google.com> 2023-10-18 08:35:03 +0000
commit5260e525830c7bbd67511d5f8e83a59042890f24 (patch)
tree1f1b3852bf6ca59b2bf39a878e6000b80fe811e8 /libs/ultrahdr/jpegencoderhelper.cpp
parent9160050592c5ce8936e875d11c091835d101a62a (diff)
[sf] HdrOutputControlTest: fix strategy arguments
The code was previously passing an aidl::[...]::common::HdrConversionStrategy* argument to gui::ISurfaceComposer::setHdrConversionStrategy, which accepts a const gui::HdrConversionStrategy& parameter. Converting between these two kinds of HdrConversionStrategy is laborious -- see SurfaceFlinger::setHdrConversionStrategy. This code was previously avoiding the conversion difficulty by passing a pointer to HdrConversionStrategy, which is wrong because the function actually accepts a const reference. It worked, though, because gui::HdrConversionStrategy's _value has type: std::variant<bool, ::std::vector<int32_t>, int32_t> ... and aidl::[...]::common::HdrConversionStrategy* can be coerced to bool. The pointer is always non-nullptr, so each sf->setHdrConversionStrategy was actually passing a {passthrough==true} strategy. The C++ standard tightened the rules around variant conversion (P0608R3, P1957R2), and after upgrading libc++, this code no longer compiles. Fix the compile error by using gui::HdrConversionStrategy for the type of the strategy vector elements. Bug: 175635923 Test: m MODULES-IN-frameworks-native-services-surfaceflinger (cherry picked from https://googleplex-android-review.googlesource.com/q/commit:0dfa358c79fc8047dd622d82020c37559871c8e7) Merged-In: I820ac945113da0317d0eaa44f581fd6ab1b61645 Change-Id: I820ac945113da0317d0eaa44f581fd6ab1b61645
Diffstat (limited to 'libs/ultrahdr/jpegencoderhelper.cpp')
0 files changed, 0 insertions, 0 deletions