Loading libs/gui/include/gui/ISurfaceComposerClient.h +1 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ public: eFXSurfaceNormal = 0x00000000, eFXSurfaceColor = 0x00020000, eFXSurfaceContainer = 0x00080000, eFXSurfaceMask = 0x000F0000, }; Loading services/surfaceflinger/Layer.cpp +1 −16 Original line number Diff line number Diff line Loading @@ -133,22 +133,7 @@ Layer::Layer(SurfaceFlinger* flinger, const sp<Client>& client, const String8& n CompositorTiming compositorTiming; flinger->getCompositorTiming(&compositorTiming); mFrameEventHistory.initializeCompositorTiming(compositorTiming); } void Layer::onFirstRef() NO_THREAD_SAFETY_ANALYSIS { if (!isCreatedFromMainThread()) { // Grab the SF state lock during this since it's the only way to safely access HWC mFlinger->mStateLock.lock(); } const auto& hwc = mFlinger->getHwComposer(); const auto& activeConfig = hwc.getActiveConfig(HWC_DISPLAY_PRIMARY); nsecs_t displayPeriod = activeConfig->getVsyncPeriod(); mFrameTracker.setDisplayRefreshPeriod(displayPeriod); if (!isCreatedFromMainThread()) { mFlinger->mStateLock.unlock(); } mFrameTracker.setDisplayRefreshPeriod(compositorTiming.interval); } Layer::~Layer() { Loading services/surfaceflinger/Layer.h +0 −2 Original line number Diff line number Diff line Loading @@ -618,8 +618,6 @@ protected: : mFlinger(flinger), mLayer(layer) {} }; virtual void onFirstRef(); friend class impl::SurfaceInterceptor; void commitTransaction(const State& stateToCommit); Loading services/surfaceflinger/SurfaceFlinger.cpp +15 −0 Original line number Diff line number Diff line Loading @@ -3645,6 +3645,11 @@ status_t SurfaceFlinger::createLayer( uniqueName, w, h, flags, handle, &layer); break; case ISurfaceComposerClient::eFXSurfaceContainer: result = createContainerLayer(client, uniqueName, w, h, flags, handle, &layer); break; default: result = BAD_VALUE; break; Loading Loading @@ -3736,6 +3741,16 @@ status_t SurfaceFlinger::createColorLayer(const sp<Client>& client, return NO_ERROR; } status_t SurfaceFlinger::createContainerLayer(const sp<Client>& client, const String8& name, uint32_t w, uint32_t h, uint32_t flags, sp<IBinder>* handle, sp<Layer>* outLayer) { *outLayer = new ContainerLayer(this, client, name, w, h, flags); *handle = (*outLayer)->getHandle(); return NO_ERROR; } status_t SurfaceFlinger::onLayerRemoved(const sp<Client>& client, const sp<IBinder>& handle) { // called by a client when it wants to remove a Layer Loading services/surfaceflinger/SurfaceFlinger.h +4 −0 Original line number Diff line number Diff line Loading @@ -541,6 +541,10 @@ private: uint32_t w, uint32_t h, uint32_t flags, sp<IBinder>* outHandle, sp<Layer>* outLayer); status_t createContainerLayer(const sp<Client>& client, const String8& name, uint32_t w, uint32_t h, uint32_t flags, sp<IBinder>* outHandle, sp<Layer>* outLayer); String8 getUniqueLayerName(const String8& name); // called in response to the window-manager calling Loading Loading
libs/gui/include/gui/ISurfaceComposerClient.h +1 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,7 @@ public: eFXSurfaceNormal = 0x00000000, eFXSurfaceColor = 0x00020000, eFXSurfaceContainer = 0x00080000, eFXSurfaceMask = 0x000F0000, }; Loading
services/surfaceflinger/Layer.cpp +1 −16 Original line number Diff line number Diff line Loading @@ -133,22 +133,7 @@ Layer::Layer(SurfaceFlinger* flinger, const sp<Client>& client, const String8& n CompositorTiming compositorTiming; flinger->getCompositorTiming(&compositorTiming); mFrameEventHistory.initializeCompositorTiming(compositorTiming); } void Layer::onFirstRef() NO_THREAD_SAFETY_ANALYSIS { if (!isCreatedFromMainThread()) { // Grab the SF state lock during this since it's the only way to safely access HWC mFlinger->mStateLock.lock(); } const auto& hwc = mFlinger->getHwComposer(); const auto& activeConfig = hwc.getActiveConfig(HWC_DISPLAY_PRIMARY); nsecs_t displayPeriod = activeConfig->getVsyncPeriod(); mFrameTracker.setDisplayRefreshPeriod(displayPeriod); if (!isCreatedFromMainThread()) { mFlinger->mStateLock.unlock(); } mFrameTracker.setDisplayRefreshPeriod(compositorTiming.interval); } Layer::~Layer() { Loading
services/surfaceflinger/Layer.h +0 −2 Original line number Diff line number Diff line Loading @@ -618,8 +618,6 @@ protected: : mFlinger(flinger), mLayer(layer) {} }; virtual void onFirstRef(); friend class impl::SurfaceInterceptor; void commitTransaction(const State& stateToCommit); Loading
services/surfaceflinger/SurfaceFlinger.cpp +15 −0 Original line number Diff line number Diff line Loading @@ -3645,6 +3645,11 @@ status_t SurfaceFlinger::createLayer( uniqueName, w, h, flags, handle, &layer); break; case ISurfaceComposerClient::eFXSurfaceContainer: result = createContainerLayer(client, uniqueName, w, h, flags, handle, &layer); break; default: result = BAD_VALUE; break; Loading Loading @@ -3736,6 +3741,16 @@ status_t SurfaceFlinger::createColorLayer(const sp<Client>& client, return NO_ERROR; } status_t SurfaceFlinger::createContainerLayer(const sp<Client>& client, const String8& name, uint32_t w, uint32_t h, uint32_t flags, sp<IBinder>* handle, sp<Layer>* outLayer) { *outLayer = new ContainerLayer(this, client, name, w, h, flags); *handle = (*outLayer)->getHandle(); return NO_ERROR; } status_t SurfaceFlinger::onLayerRemoved(const sp<Client>& client, const sp<IBinder>& handle) { // called by a client when it wants to remove a Layer Loading
services/surfaceflinger/SurfaceFlinger.h +4 −0 Original line number Diff line number Diff line Loading @@ -541,6 +541,10 @@ private: uint32_t w, uint32_t h, uint32_t flags, sp<IBinder>* outHandle, sp<Layer>* outLayer); status_t createContainerLayer(const sp<Client>& client, const String8& name, uint32_t w, uint32_t h, uint32_t flags, sp<IBinder>* outHandle, sp<Layer>* outLayer); String8 getUniqueLayerName(const String8& name); // called in response to the window-manager calling Loading