Loading libs/gui/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -339,6 +339,7 @@ cc_defaults { "android.hardware.graphics.bufferqueue@2.0", "android.hardware.graphics.common@1.1", "android.hardware.graphics.common@1.2", "android.hardware.graphics.common-V3-ndk", "android.hidl.token@1.0-utils", "libbase", "libcutils", Loading libs/gui/ISurfaceComposer.cpp +34 −8 Original line number Diff line number Diff line Loading @@ -42,6 +42,8 @@ // --------------------------------------------------------------------------- using namespace aidl::android::hardware::graphics; namespace android { using gui::IDisplayEventConnection; Loading Loading @@ -1201,8 +1203,9 @@ public: return NO_ERROR; } status_t getDisplayDecorationSupport(const sp<IBinder>& displayToken, bool* outSupport) const override { status_t getDisplayDecorationSupport( const sp<IBinder>& displayToken, std::optional<common::DisplayDecorationSupport>* outSupport) const override { Parcel data, reply; status_t error = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); if (error != NO_ERROR) { Loading @@ -1225,7 +1228,26 @@ public: ALOGE("getDisplayDecorationSupport: failed to read support: %d", error); return error; } *outSupport = support; if (support) { int32_t format, alphaInterpretation; error = reply.readInt32(&format); if (error != NO_ERROR) { ALOGE("getDisplayDecorationSupport: failed to read format: %d", error); return error; } error = reply.readInt32(&alphaInterpretation); if (error != NO_ERROR) { ALOGE("getDisplayDecorationSupport: failed to read alphaInterpretation: %d", error); return error; } outSupport->emplace(); outSupport->value().format = static_cast<common::PixelFormat>(format); outSupport->value().alphaInterpretation = static_cast<common::AlphaInterpretation>(alphaInterpretation); } else { outSupport->reset(); } return NO_ERROR; } Loading Loading @@ -2164,14 +2186,18 @@ status_t BnSurfaceComposer::onTransact( case GET_DISPLAY_DECORATION_SUPPORT: { CHECK_INTERFACE(ISurfaceComposer, data, reply); sp<IBinder> displayToken; status_t error = data.readNullableStrongBinder(&displayToken); SAFE_PARCEL(data.readNullableStrongBinder, &displayToken); std::optional<common::DisplayDecorationSupport> support; auto error = getDisplayDecorationSupport(displayToken, &support); if (error != NO_ERROR) { ALOGE("getDisplayDecorationSupport: failed to read display token: %d", error); ALOGE("getDisplayDecorationSupport failed with error %d", error); return error; } bool support = false; error = getDisplayDecorationSupport(displayToken, &support); reply->writeBool(support); reply->writeBool(support.has_value()); if (support) { reply->writeInt32(static_cast<int32_t>(support.value().format)); reply->writeInt32(static_cast<int32_t>(support.value().alphaInterpretation)); } return error; } case SET_FRAME_RATE: { Loading libs/gui/SurfaceComposerClient.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ namespace android { using aidl::android::hardware::graphics::common::DisplayDecorationSupport; using gui::FocusRequest; using gui::IRegionSamplingListener; using gui::WindowInfo; Loading Loading @@ -2239,8 +2240,9 @@ status_t SurfaceComposerClient::setGlobalShadowSettings(const half4& ambientColo lightRadius); } bool SurfaceComposerClient::getDisplayDecorationSupport(const sp<IBinder>& displayToken) { bool support = false; std::optional<DisplayDecorationSupport> SurfaceComposerClient::getDisplayDecorationSupport( const sp<IBinder>& displayToken) { std::optional<DisplayDecorationSupport> support; ComposerService::getComposerService()->getDisplayDecorationSupport(displayToken, &support); return support; } Loading libs/gui/include/gui/ISurfaceComposer.h +7 −3 Original line number Diff line number Diff line Loading @@ -52,6 +52,8 @@ #include <unordered_set> #include <vector> #include <aidl/android/hardware/graphics/common/DisplayDecorationSupport.h> namespace android { struct client_cache_t; Loading Loading @@ -533,15 +535,17 @@ public: * displayToken * The token of the display. * outSupport * An output parameter for whether the display supports * An output parameter for whether/how the display supports * DISPLAY_DECORATION layers. * * Returns NO_ERROR upon success. Otherwise, * NAME_NOT_FOUND if the display is invalid, or * BAD_VALUE if the output parameter is invalid. */ virtual status_t getDisplayDecorationSupport(const sp<IBinder>& displayToken, bool* outSupport) const = 0; virtual status_t getDisplayDecorationSupport( const sp<IBinder>& displayToken, std::optional<aidl::android::hardware::graphics::common::DisplayDecorationSupport>* outSupport) const = 0; /* * Sets the intended frame rate for a surface. See ANativeWindow_setFrameRate() for more info. Loading libs/gui/include/gui/SurfaceComposerClient.h +7 −3 Original line number Diff line number Diff line Loading @@ -47,6 +47,8 @@ #include <gui/WindowInfosListenerReporter.h> #include <math/vec3.h> #include <aidl/android/hardware/graphics/common/DisplayDecorationSupport.h> namespace android { class HdrCapabilities; Loading Loading @@ -285,14 +287,16 @@ public: float lightPosY, float lightPosZ, float lightRadius); /* * Returns whether a display supports DISPLAY_DECORATION layers. * Returns whether and how a display supports DISPLAY_DECORATION layers. * * displayToken * The token of the display. * * Returns whether a display supports DISPLAY_DECORATION layers. * Returns how a display supports DISPLAY_DECORATION layers, or nullopt if * it does not. */ static bool getDisplayDecorationSupport(const sp<IBinder>& displayToken); static std::optional<aidl::android::hardware::graphics::common::DisplayDecorationSupport> getDisplayDecorationSupport(const sp<IBinder>& displayToken); // ------------------------------------------------------------------------ // surface creation / destruction Loading Loading
libs/gui/Android.bp +1 −0 Original line number Diff line number Diff line Loading @@ -339,6 +339,7 @@ cc_defaults { "android.hardware.graphics.bufferqueue@2.0", "android.hardware.graphics.common@1.1", "android.hardware.graphics.common@1.2", "android.hardware.graphics.common-V3-ndk", "android.hidl.token@1.0-utils", "libbase", "libcutils", Loading
libs/gui/ISurfaceComposer.cpp +34 −8 Original line number Diff line number Diff line Loading @@ -42,6 +42,8 @@ // --------------------------------------------------------------------------- using namespace aidl::android::hardware::graphics; namespace android { using gui::IDisplayEventConnection; Loading Loading @@ -1201,8 +1203,9 @@ public: return NO_ERROR; } status_t getDisplayDecorationSupport(const sp<IBinder>& displayToken, bool* outSupport) const override { status_t getDisplayDecorationSupport( const sp<IBinder>& displayToken, std::optional<common::DisplayDecorationSupport>* outSupport) const override { Parcel data, reply; status_t error = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); if (error != NO_ERROR) { Loading @@ -1225,7 +1228,26 @@ public: ALOGE("getDisplayDecorationSupport: failed to read support: %d", error); return error; } *outSupport = support; if (support) { int32_t format, alphaInterpretation; error = reply.readInt32(&format); if (error != NO_ERROR) { ALOGE("getDisplayDecorationSupport: failed to read format: %d", error); return error; } error = reply.readInt32(&alphaInterpretation); if (error != NO_ERROR) { ALOGE("getDisplayDecorationSupport: failed to read alphaInterpretation: %d", error); return error; } outSupport->emplace(); outSupport->value().format = static_cast<common::PixelFormat>(format); outSupport->value().alphaInterpretation = static_cast<common::AlphaInterpretation>(alphaInterpretation); } else { outSupport->reset(); } return NO_ERROR; } Loading Loading @@ -2164,14 +2186,18 @@ status_t BnSurfaceComposer::onTransact( case GET_DISPLAY_DECORATION_SUPPORT: { CHECK_INTERFACE(ISurfaceComposer, data, reply); sp<IBinder> displayToken; status_t error = data.readNullableStrongBinder(&displayToken); SAFE_PARCEL(data.readNullableStrongBinder, &displayToken); std::optional<common::DisplayDecorationSupport> support; auto error = getDisplayDecorationSupport(displayToken, &support); if (error != NO_ERROR) { ALOGE("getDisplayDecorationSupport: failed to read display token: %d", error); ALOGE("getDisplayDecorationSupport failed with error %d", error); return error; } bool support = false; error = getDisplayDecorationSupport(displayToken, &support); reply->writeBool(support); reply->writeBool(support.has_value()); if (support) { reply->writeInt32(static_cast<int32_t>(support.value().format)); reply->writeInt32(static_cast<int32_t>(support.value().alphaInterpretation)); } return error; } case SET_FRAME_RATE: { Loading
libs/gui/SurfaceComposerClient.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -52,6 +52,7 @@ namespace android { using aidl::android::hardware::graphics::common::DisplayDecorationSupport; using gui::FocusRequest; using gui::IRegionSamplingListener; using gui::WindowInfo; Loading Loading @@ -2239,8 +2240,9 @@ status_t SurfaceComposerClient::setGlobalShadowSettings(const half4& ambientColo lightRadius); } bool SurfaceComposerClient::getDisplayDecorationSupport(const sp<IBinder>& displayToken) { bool support = false; std::optional<DisplayDecorationSupport> SurfaceComposerClient::getDisplayDecorationSupport( const sp<IBinder>& displayToken) { std::optional<DisplayDecorationSupport> support; ComposerService::getComposerService()->getDisplayDecorationSupport(displayToken, &support); return support; } Loading
libs/gui/include/gui/ISurfaceComposer.h +7 −3 Original line number Diff line number Diff line Loading @@ -52,6 +52,8 @@ #include <unordered_set> #include <vector> #include <aidl/android/hardware/graphics/common/DisplayDecorationSupport.h> namespace android { struct client_cache_t; Loading Loading @@ -533,15 +535,17 @@ public: * displayToken * The token of the display. * outSupport * An output parameter for whether the display supports * An output parameter for whether/how the display supports * DISPLAY_DECORATION layers. * * Returns NO_ERROR upon success. Otherwise, * NAME_NOT_FOUND if the display is invalid, or * BAD_VALUE if the output parameter is invalid. */ virtual status_t getDisplayDecorationSupport(const sp<IBinder>& displayToken, bool* outSupport) const = 0; virtual status_t getDisplayDecorationSupport( const sp<IBinder>& displayToken, std::optional<aidl::android::hardware::graphics::common::DisplayDecorationSupport>* outSupport) const = 0; /* * Sets the intended frame rate for a surface. See ANativeWindow_setFrameRate() for more info. Loading
libs/gui/include/gui/SurfaceComposerClient.h +7 −3 Original line number Diff line number Diff line Loading @@ -47,6 +47,8 @@ #include <gui/WindowInfosListenerReporter.h> #include <math/vec3.h> #include <aidl/android/hardware/graphics/common/DisplayDecorationSupport.h> namespace android { class HdrCapabilities; Loading Loading @@ -285,14 +287,16 @@ public: float lightPosY, float lightPosZ, float lightRadius); /* * Returns whether a display supports DISPLAY_DECORATION layers. * Returns whether and how a display supports DISPLAY_DECORATION layers. * * displayToken * The token of the display. * * Returns whether a display supports DISPLAY_DECORATION layers. * Returns how a display supports DISPLAY_DECORATION layers, or nullopt if * it does not. */ static bool getDisplayDecorationSupport(const sp<IBinder>& displayToken); static std::optional<aidl::android::hardware::graphics::common::DisplayDecorationSupport> getDisplayDecorationSupport(const sp<IBinder>& displayToken); // ------------------------------------------------------------------------ // surface creation / destruction Loading