Loading libs/gui/ISurfaceComposer.cpp +31 −0 Original line number Diff line number Diff line Loading @@ -558,6 +558,25 @@ public: outLayers->clear(); return reply.readParcelableVector(outLayers); } virtual status_t getCompositionPreference(ui::Dataspace* dataSpace, ui::PixelFormat* pixelFormat) const { Parcel data, reply; status_t error = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); if (error != NO_ERROR) { return error; } error = remote()->transact(BnSurfaceComposer::GET_COMPOSITION_PREFERENCE, data, &reply); if (error != NO_ERROR) { return error; } error = static_cast<status_t>(reply.readInt32()); if (error == NO_ERROR) { *dataSpace = static_cast<ui::Dataspace>(reply.readInt32()); *pixelFormat = static_cast<ui::PixelFormat>(reply.readInt32()); } return error; } }; // Out-of-line virtual method definition to trigger vtable emission in this Loading Loading @@ -881,6 +900,18 @@ status_t BnSurfaceComposer::onTransact( } return result; } case GET_COMPOSITION_PREFERENCE: { CHECK_INTERFACE(ISurfaceComposer, data, reply); ui::Dataspace dataSpace; ui::PixelFormat pixelFormat; status_t error = getCompositionPreference(&dataSpace, &pixelFormat); reply->writeInt32(error); if (error == NO_ERROR) { reply->writeInt32(static_cast<int32_t>(dataSpace)); reply->writeInt32(static_cast<int32_t>(pixelFormat)); } return NO_ERROR; } default: { return BBinder::onTransact(code, data, reply, flags); } Loading libs/gui/SurfaceComposerClient.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -854,6 +854,11 @@ void SurfaceComposerClient::setDisplayPowerMode(const sp<IBinder>& token, ComposerService::getComposerService()->setPowerMode(token, mode); } status_t SurfaceComposerClient::getCompositionPreference(ui::Dataspace* dataSpace, ui::PixelFormat* pixelFormat) { return ComposerService::getComposerService()->getCompositionPreference(dataSpace, pixelFormat); } status_t SurfaceComposerClient::clearAnimationFrameStats() { return ComposerService::getComposerService()->clearAnimationFrameStats(); } Loading libs/gui/include/gui/ISurfaceComposer.h +5 −1 Original line number Diff line number Diff line Loading @@ -231,6 +231,9 @@ public: * Requires the ACCESS_SURFACE_FLINGER permission. */ virtual status_t getLayerDebugInfo(std::vector<LayerDebugInfo>* outLayers) const = 0; virtual status_t getCompositionPreference(ui::Dataspace* dataSpace, ui::PixelFormat* pixelFormat) const = 0; }; // ---------------------------------------------------------------------------- Loading Loading @@ -267,7 +270,8 @@ public: ENABLE_VSYNC_INJECTIONS, INJECT_VSYNC, GET_LAYER_DEBUG_INFO, CREATE_SCOPED_CONNECTION CREATE_SCOPED_CONNECTION, GET_COMPOSITION_PREFERENCE, }; virtual status_t onTransact(uint32_t code, const Parcel& data, Loading libs/gui/include/gui/SurfaceComposerClient.h +4 −0 Original line number Diff line number Diff line Loading @@ -101,6 +101,10 @@ public: /* Triggers screen on/off or low power mode and waits for it to complete */ static void setDisplayPowerMode(const sp<IBinder>& display, int mode); // static status_t getCompositionPreference(ui::Dataspace* dataSpace, ui::PixelFormat* pixelFormat); // ------------------------------------------------------------------------ // surface creation / destruction Loading libs/gui/tests/Surface_test.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -622,6 +622,10 @@ public: status_t getLayerDebugInfo(std::vector<LayerDebugInfo>* /*layers*/) const override { return NO_ERROR; } status_t getCompositionPreference(ui::Dataspace* /*outDataSpace*/, ui::PixelFormat* /*outPixelFormat*/) const override { return NO_ERROR; } protected: IBinder* onAsBinder() override { return nullptr; } Loading Loading
libs/gui/ISurfaceComposer.cpp +31 −0 Original line number Diff line number Diff line Loading @@ -558,6 +558,25 @@ public: outLayers->clear(); return reply.readParcelableVector(outLayers); } virtual status_t getCompositionPreference(ui::Dataspace* dataSpace, ui::PixelFormat* pixelFormat) const { Parcel data, reply; status_t error = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor()); if (error != NO_ERROR) { return error; } error = remote()->transact(BnSurfaceComposer::GET_COMPOSITION_PREFERENCE, data, &reply); if (error != NO_ERROR) { return error; } error = static_cast<status_t>(reply.readInt32()); if (error == NO_ERROR) { *dataSpace = static_cast<ui::Dataspace>(reply.readInt32()); *pixelFormat = static_cast<ui::PixelFormat>(reply.readInt32()); } return error; } }; // Out-of-line virtual method definition to trigger vtable emission in this Loading Loading @@ -881,6 +900,18 @@ status_t BnSurfaceComposer::onTransact( } return result; } case GET_COMPOSITION_PREFERENCE: { CHECK_INTERFACE(ISurfaceComposer, data, reply); ui::Dataspace dataSpace; ui::PixelFormat pixelFormat; status_t error = getCompositionPreference(&dataSpace, &pixelFormat); reply->writeInt32(error); if (error == NO_ERROR) { reply->writeInt32(static_cast<int32_t>(dataSpace)); reply->writeInt32(static_cast<int32_t>(pixelFormat)); } return NO_ERROR; } default: { return BBinder::onTransact(code, data, reply, flags); } Loading
libs/gui/SurfaceComposerClient.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -854,6 +854,11 @@ void SurfaceComposerClient::setDisplayPowerMode(const sp<IBinder>& token, ComposerService::getComposerService()->setPowerMode(token, mode); } status_t SurfaceComposerClient::getCompositionPreference(ui::Dataspace* dataSpace, ui::PixelFormat* pixelFormat) { return ComposerService::getComposerService()->getCompositionPreference(dataSpace, pixelFormat); } status_t SurfaceComposerClient::clearAnimationFrameStats() { return ComposerService::getComposerService()->clearAnimationFrameStats(); } Loading
libs/gui/include/gui/ISurfaceComposer.h +5 −1 Original line number Diff line number Diff line Loading @@ -231,6 +231,9 @@ public: * Requires the ACCESS_SURFACE_FLINGER permission. */ virtual status_t getLayerDebugInfo(std::vector<LayerDebugInfo>* outLayers) const = 0; virtual status_t getCompositionPreference(ui::Dataspace* dataSpace, ui::PixelFormat* pixelFormat) const = 0; }; // ---------------------------------------------------------------------------- Loading Loading @@ -267,7 +270,8 @@ public: ENABLE_VSYNC_INJECTIONS, INJECT_VSYNC, GET_LAYER_DEBUG_INFO, CREATE_SCOPED_CONNECTION CREATE_SCOPED_CONNECTION, GET_COMPOSITION_PREFERENCE, }; virtual status_t onTransact(uint32_t code, const Parcel& data, Loading
libs/gui/include/gui/SurfaceComposerClient.h +4 −0 Original line number Diff line number Diff line Loading @@ -101,6 +101,10 @@ public: /* Triggers screen on/off or low power mode and waits for it to complete */ static void setDisplayPowerMode(const sp<IBinder>& display, int mode); // static status_t getCompositionPreference(ui::Dataspace* dataSpace, ui::PixelFormat* pixelFormat); // ------------------------------------------------------------------------ // surface creation / destruction Loading
libs/gui/tests/Surface_test.cpp +4 −0 Original line number Diff line number Diff line Loading @@ -622,6 +622,10 @@ public: status_t getLayerDebugInfo(std::vector<LayerDebugInfo>* /*layers*/) const override { return NO_ERROR; } status_t getCompositionPreference(ui::Dataspace* /*outDataSpace*/, ui::PixelFormat* /*outPixelFormat*/) const override { return NO_ERROR; } protected: IBinder* onAsBinder() override { return nullptr; } Loading