diff options
author | 2020-10-05 15:47:26 -0700 | |
---|---|---|
committer | 2020-10-06 01:36:33 +0000 | |
commit | 9f0a4008b72138f6279a12f474b60e5e3caa13c3 (patch) | |
tree | 08fdda2d9313e34f081cc79888d081449434c2aa | |
parent | 4e9769a7ccef89ecf4dce68ca90f4319d688c608 (diff) |
SurfaceFLinger: rename outLayerId
- Rename outId to outLayerId to reflect what the Id is.
- Remove the default value and require it to be non-nullptr
Test: SF tests
Change-Id: Icdbbab4a84e9bd5982d274ee5bf522e36545855a
-rw-r--r-- | libs/gui/ISurfaceComposerClient.cpp | 14 | ||||
-rw-r--r-- | libs/gui/include/gui/ISurfaceComposerClient.h | 6 | ||||
-rw-r--r-- | services/surfaceflinger/Client.cpp | 12 | ||||
-rw-r--r-- | services/surfaceflinger/Client.h | 6 | ||||
-rw-r--r-- | services/surfaceflinger/RefreshRateOverlay.cpp | 3 | ||||
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 12 | ||||
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.h | 7 |
7 files changed, 30 insertions, 30 deletions
diff --git a/libs/gui/ISurfaceComposerClient.cpp b/libs/gui/ISurfaceComposerClient.cpp index a814362e3c..5e7a7ec67b 100644 --- a/libs/gui/ISurfaceComposerClient.cpp +++ b/libs/gui/ISurfaceComposerClient.cpp @@ -49,13 +49,13 @@ public: status_t createSurface(const String8& name, uint32_t width, uint32_t height, PixelFormat format, uint32_t flags, const sp<IBinder>& parent, LayerMetadata metadata, - sp<IBinder>* handle, sp<IGraphicBufferProducer>* gbp, int32_t* outId, - uint32_t* outTransformHint) override { + sp<IBinder>* handle, sp<IGraphicBufferProducer>* gbp, + int32_t* outLayerId, uint32_t* outTransformHint) override { return callRemote<decltype(&ISurfaceComposerClient::createSurface)>(Tag::CREATE_SURFACE, name, width, height, format, flags, parent, std::move(metadata), - handle, gbp, outId, + handle, gbp, outLayerId, outTransformHint); } @@ -63,14 +63,14 @@ public: PixelFormat format, uint32_t flags, const sp<IGraphicBufferProducer>& parent, LayerMetadata metadata, sp<IBinder>* handle, - sp<IGraphicBufferProducer>* gbp, int32_t* outId, + sp<IGraphicBufferProducer>* gbp, int32_t* outLayerId, uint32_t* outTransformHint) override { return callRemote<decltype( &ISurfaceComposerClient::createWithSurfaceParent)>(Tag::CREATE_WITH_SURFACE_PARENT, name, width, height, format, flags, parent, std::move(metadata), handle, gbp, - outId, outTransformHint); + outLayerId, outTransformHint); } status_t clearLayerFrameStats(const sp<IBinder>& handle) const override { @@ -86,10 +86,10 @@ public: } status_t mirrorSurface(const sp<IBinder>& mirrorFromHandle, sp<IBinder>* outHandle, - int32_t* outId) override { + int32_t* outLayerId) override { return callRemote<decltype(&ISurfaceComposerClient::mirrorSurface)>(Tag::MIRROR_SURFACE, mirrorFromHandle, - outHandle, outId); + outHandle, outLayerId); } }; diff --git a/libs/gui/include/gui/ISurfaceComposerClient.h b/libs/gui/include/gui/ISurfaceComposerClient.h index f3fcebecad..4a92f535a2 100644 --- a/libs/gui/include/gui/ISurfaceComposerClient.h +++ b/libs/gui/include/gui/ISurfaceComposerClient.h @@ -58,7 +58,7 @@ public: virtual status_t createSurface(const String8& name, uint32_t w, uint32_t h, PixelFormat format, uint32_t flags, const sp<IBinder>& parent, LayerMetadata metadata, sp<IBinder>* handle, - sp<IGraphicBufferProducer>* gbp, int32_t* outId, + sp<IGraphicBufferProducer>* gbp, int32_t* outLayerId, uint32_t* outTransformHint) = 0; /* @@ -68,7 +68,7 @@ public: PixelFormat format, uint32_t flags, const sp<IGraphicBufferProducer>& parent, LayerMetadata metadata, sp<IBinder>* handle, - sp<IGraphicBufferProducer>* gbp, int32_t* outId, + sp<IGraphicBufferProducer>* gbp, int32_t* outLayerId, uint32_t* outTransformHint) = 0; /* @@ -82,7 +82,7 @@ public: virtual status_t getLayerFrameStats(const sp<IBinder>& handle, FrameStats* outStats) const = 0; virtual status_t mirrorSurface(const sp<IBinder>& mirrorFromHandle, sp<IBinder>* outHandle, - int32_t* outId) = 0; + int32_t* outLayerId) = 0; }; class BnSurfaceComposerClient : public SafeBnInterface<ISurfaceComposerClient> { diff --git a/services/surfaceflinger/Client.cpp b/services/surfaceflinger/Client.cpp index 07817b5a7f..aac6c913cf 100644 --- a/services/surfaceflinger/Client.cpp +++ b/services/surfaceflinger/Client.cpp @@ -79,18 +79,18 @@ sp<Layer> Client::getLayerUser(const sp<IBinder>& handle) const status_t Client::createSurface(const String8& name, uint32_t w, uint32_t h, PixelFormat format, uint32_t flags, const sp<IBinder>& parentHandle, LayerMetadata metadata, sp<IBinder>* handle, - sp<IGraphicBufferProducer>* gbp, int32_t* outId, + sp<IGraphicBufferProducer>* gbp, int32_t* outLayerId, uint32_t* outTransformHint) { // We rely on createLayer to check permissions. return mFlinger->createLayer(name, this, w, h, format, flags, std::move(metadata), handle, gbp, - parentHandle, nullptr, outId, outTransformHint); + parentHandle, outLayerId, nullptr, outTransformHint); } status_t Client::createWithSurfaceParent(const String8& name, uint32_t w, uint32_t h, PixelFormat format, uint32_t flags, const sp<IGraphicBufferProducer>& parent, LayerMetadata metadata, sp<IBinder>* handle, - sp<IGraphicBufferProducer>* gbp, int32_t* outId, + sp<IGraphicBufferProducer>* gbp, int32_t* outLayerId, uint32_t* outTransformHint) { if (mFlinger->authenticateSurfaceTexture(parent) == false) { ALOGE("failed to authenticate surface texture"); @@ -104,12 +104,12 @@ status_t Client::createWithSurfaceParent(const String8& name, uint32_t w, uint32 } return mFlinger->createLayer(name, this, w, h, format, flags, std::move(metadata), handle, gbp, - nullptr, layer, outId, outTransformHint); + nullptr, outLayerId, layer, outTransformHint); } status_t Client::mirrorSurface(const sp<IBinder>& mirrorFromHandle, sp<IBinder>* outHandle, - int32_t* outId) { - return mFlinger->mirrorLayer(this, mirrorFromHandle, outHandle, outId); + int32_t* outLayerId) { + return mFlinger->mirrorLayer(this, mirrorFromHandle, outHandle, outLayerId); } status_t Client::clearLayerFrameStats(const sp<IBinder>& handle) const { diff --git a/services/surfaceflinger/Client.h b/services/surfaceflinger/Client.h index 9462f1a7a3..15cd763822 100644 --- a/services/surfaceflinger/Client.h +++ b/services/surfaceflinger/Client.h @@ -50,18 +50,18 @@ private: virtual status_t createSurface(const String8& name, uint32_t w, uint32_t h, PixelFormat format, uint32_t flags, const sp<IBinder>& parent, LayerMetadata metadata, sp<IBinder>* handle, - sp<IGraphicBufferProducer>* gbp, int32_t* outId, + sp<IGraphicBufferProducer>* gbp, int32_t* outLayerId, uint32_t* outTransformHint = nullptr); virtual status_t createWithSurfaceParent(const String8& name, uint32_t w, uint32_t h, PixelFormat format, uint32_t flags, const sp<IGraphicBufferProducer>& parent, LayerMetadata metadata, sp<IBinder>* handle, - sp<IGraphicBufferProducer>* gbp, int32_t* outId, + sp<IGraphicBufferProducer>* gbp, int32_t* outLayerId, uint32_t* outTransformHint = nullptr); status_t mirrorSurface(const sp<IBinder>& mirrorFromHandle, sp<IBinder>* handle, - int32_t* outId); + int32_t* outLayerId); virtual status_t clearLayerFrameStats(const sp<IBinder>& handle) const; diff --git a/services/surfaceflinger/RefreshRateOverlay.cpp b/services/surfaceflinger/RefreshRateOverlay.cpp index 99d061daa3..f676d5b44b 100644 --- a/services/surfaceflinger/RefreshRateOverlay.cpp +++ b/services/surfaceflinger/RefreshRateOverlay.cpp @@ -176,12 +176,13 @@ RefreshRateOverlay::RefreshRateOverlay(SurfaceFlinger& flinger, bool showSpinner } bool RefreshRateOverlay::createLayer() { + int32_t layerId; const status_t ret = mFlinger.createLayer(String8("RefreshRateOverlay"), mClient, SevenSegmentDrawer::getWidth(), SevenSegmentDrawer::getHeight(), PIXEL_FORMAT_RGBA_8888, ISurfaceComposerClient::eFXSurfaceBufferState, LayerMetadata(), - &mIBinder, &mGbp, nullptr); + &mIBinder, &mGbp, nullptr, &layerId); if (ret) { ALOGE("failed to create buffer state layer"); return false; diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index bf33e5edef..498859ba28 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -3846,7 +3846,7 @@ uint32_t SurfaceFlinger::addInputWindowCommands(const InputWindowCommands& input } status_t SurfaceFlinger::mirrorLayer(const sp<Client>& client, const sp<IBinder>& mirrorFromHandle, - sp<IBinder>* outHandle, int32_t* outId) { + sp<IBinder>* outHandle, int32_t* outLayerId) { if (!mirrorFromHandle) { return NAME_NOT_FOUND; } @@ -3871,7 +3871,7 @@ status_t SurfaceFlinger::mirrorLayer(const sp<Client>& client, const sp<IBinder> mirrorLayer->mClonedChild = mirrorFrom->createClone(); } - *outId = mirrorLayer->sequence; + *outLayerId = mirrorLayer->sequence; return addClientLayer(client, *outHandle, nullptr, mirrorLayer, nullptr, nullptr, false, nullptr /* outTransformHint */); } @@ -3880,8 +3880,8 @@ status_t SurfaceFlinger::createLayer(const String8& name, const sp<Client>& clie uint32_t h, PixelFormat format, uint32_t flags, LayerMetadata metadata, sp<IBinder>* handle, sp<IGraphicBufferProducer>* gbp, - const sp<IBinder>& parentHandle, const sp<Layer>& parentLayer, - int32_t* outId, uint32_t* outTransformHint) { + const sp<IBinder>& parentHandle, int32_t* outLayerId, + const sp<Layer>& parentLayer, uint32_t* outTransformHint) { if (int32_t(w|h) < 0) { ALOGE("createLayer() failed, w or h is negative (w=%d, h=%d)", int(w), int(h)); @@ -3947,9 +3947,7 @@ status_t SurfaceFlinger::createLayer(const String8& name, const sp<Client>& clie mInterceptor->saveSurfaceCreation(layer); setTransactionFlags(eTransactionNeeded); - if (outId) { - *outId = layer->sequence; - } + *outLayerId = layer->sequence; return result; } diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h index e50ecf0493..99d0232e59 100644 --- a/services/surfaceflinger/SurfaceFlinger.h +++ b/services/surfaceflinger/SurfaceFlinger.h @@ -752,8 +752,9 @@ private: status_t createLayer(const String8& name, const sp<Client>& client, uint32_t w, uint32_t h, PixelFormat format, uint32_t flags, LayerMetadata metadata, sp<IBinder>* handle, sp<IGraphicBufferProducer>* gbp, - const sp<IBinder>& parentHandle, const sp<Layer>& parentLayer = nullptr, - int32_t* outId = nullptr, uint32_t* outTransformHint = nullptr); + const sp<IBinder>& parentHandle, int32_t* outLayerId, + const sp<Layer>& parentLayer = nullptr, + uint32_t* outTransformHint = nullptr); status_t createBufferQueueLayer(const sp<Client>& client, std::string name, uint32_t w, uint32_t h, uint32_t flags, LayerMetadata metadata, @@ -773,7 +774,7 @@ private: sp<IBinder>* outHandle, sp<Layer>* outLayer); status_t mirrorLayer(const sp<Client>& client, const sp<IBinder>& mirrorFromHandle, - sp<IBinder>* outHandle, int32_t* outId); + sp<IBinder>* outHandle, int32_t* outLayerId); std::string getUniqueLayerName(const char* name); |