diff options
author | Ady Abraham <adyabr@google.com> | 2021-12-22 23:14:05 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2021-12-22 23:14:05 +0000 |
commit | e2af3c01f41d141ae85d20b1aef125ddba1084d4 (patch) | |
tree | e71323119aa21e84b4f3fa5c15e2dc78bf387286 /hwc3/impl/HalImpl.cpp | |
parent | a245b727dc1cb61887eca0d042a349972802550a (diff) | |
parent | 169defd014b8d5ea2e424c8c80ea1b53a906199d (diff) |
Merge "hwc3: DisplayCommand.colorTransform is just a matrix"
Diffstat (limited to 'hwc3/impl/HalImpl.cpp')
-rw-r--r-- | hwc3/impl/HalImpl.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/hwc3/impl/HalImpl.cpp b/hwc3/impl/HalImpl.cpp index f79073b..8c3e9d3 100644 --- a/hwc3/impl/HalImpl.cpp +++ b/hwc3/impl/HalImpl.cpp @@ -630,8 +630,19 @@ int32_t HalImpl::setColorMode(int64_t display, ColorMode mode, RenderIntent inte return halDisplay->setColorModeWithRenderIntent(hwcMode, hwcIntent); } -int32_t HalImpl::setColorTransform(int64_t display, const std::vector<float>& matrix, - common::ColorTransform hint) { +int32_t HalImpl::setColorTransform(int64_t display, const std::vector<float>& matrix) { + // clang-format off + constexpr std::array<float, 16> kIdentity = { + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f, + }; + // clang-format on + const bool isIdentity = (std::equal(matrix.begin(), matrix.end(), kIdentity.begin())); + const common::ColorTransform hint = isIdentity ? common::ColorTransform::IDENTITY + : common::ColorTransform::ARBITRARY_MATRIX; + ExynosDisplay* halDisplay; RET_IF_ERR(getHalDisplay(display, halDisplay)); |