diff options
author | Leon Scroggins <scroggo@google.com> | 2022-02-10 11:56:31 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2022-02-10 11:56:31 +0000 |
commit | 2e38a44a77e2cf645b7605e5514f8fdae62b137c (patch) | |
tree | 8587985176f93817704428bffe14f602733fdb0b /hwc3/ComposerClient.cpp | |
parent | 0b21789279bc1d261e12523d42f0d59f6d3754b1 (diff) | |
parent | 51f511d13360453d08489b812e9b46cecafe4151 (diff) |
Merge "hwc: Implement getDisplayDecorationSupport"
Diffstat (limited to 'hwc3/ComposerClient.cpp')
-rw-r--r-- | hwc3/ComposerClient.cpp | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/hwc3/ComposerClient.cpp b/hwc3/ComposerClient.cpp index 96d5f58..848d1f7 100644 --- a/hwc3/ComposerClient.cpp +++ b/hwc3/ComposerClient.cpp @@ -162,15 +162,6 @@ ndk::ScopedAStatus ComposerClient::getDisplayCapabilities(int64_t display, return TO_BINDER_STATUS(err); } - bool support = false; - err = mHal->getRCDLayerSupport(display, support); - if (err != ::android::OK) { - LOG(ERROR) << "failed to getRCDLayerSupport: " << err; - } - if (support) { - caps->push_back(DisplayCapability::DISPLAY_DECORATION); - } - return TO_BINDER_STATUS(err); } @@ -276,6 +267,25 @@ ndk::ScopedAStatus ComposerClient::getSupportedContentTypes(int64_t display, return TO_BINDER_STATUS(err); } +ndk::ScopedAStatus ComposerClient::getDisplayDecorationSupport( + int64_t display, std::optional<common::DisplayDecorationSupport>* supportStruct) { + DEBUG_FUNC(); + bool support = false; + auto err = mHal->getRCDLayerSupport(display, support); + if (err != ::android::OK) { + LOG(ERROR) << "failed to getRCDLayerSupport: " << err; + } + if (support) { + // TODO (b/218499393): determine from mHal instead of hard coding. + auto& s = supportStruct->emplace(); + s.format = common::PixelFormat::R_8; + s.alphaInterpretation = common::AlphaInterpretation::COVERAGE; + } else { + supportStruct->reset(); + } + return TO_BINDER_STATUS(err); +} + ndk::ScopedAStatus ComposerClient::registerCallback( const std::shared_ptr<IComposerCallback>& callback) { DEBUG_FUNC(); |