summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/Client.cpp
diff options
context:
space:
mode:
author Evan Rosky <erosky@google.com> 2018-12-06 10:47:26 -0800
committer Evan Rosky <erosky@google.com> 2019-01-25 09:26:29 -0800
commit1f6d6d5db93ef4c3bbaeb5241eede30635fa5ff1 (patch)
treecc086700fc2736de362636bfc5f918f947fa06bd /services/surfaceflinger/Client.cpp
parent57ba2f1942f1fae1bd195b8c0f7fda8adbf9c41e (diff)
Add metadata store to surfaces
This adds a key/value metadata storage mechanism to surfaces that allows the windowmanager to pass information to the surfaceflinger frontend. This then moves the existing metadata (window type and ownerUID) into this metadata structure. Bug: 122925737 Test: Phone boots and surfaces fling. Some unittests Change-Id: I72c574737b7f75be2311a341812b15d385f507ed
Diffstat (limited to 'services/surfaceflinger/Client.cpp')
-rw-r--r--services/surfaceflinger/Client.cpp21
1 files changed, 8 insertions, 13 deletions
diff --git a/services/surfaceflinger/Client.cpp b/services/surfaceflinger/Client.cpp
index 0e447d87f2..0ca3759f07 100644
--- a/services/surfaceflinger/Client.cpp
+++ b/services/surfaceflinger/Client.cpp
@@ -73,14 +73,10 @@ sp<Layer> Client::getLayerUser(const sp<IBinder>& handle) const
return lbc;
}
-
-status_t Client::createSurface(
- const String8& name,
- uint32_t w, uint32_t h, PixelFormat format, uint32_t flags,
- const sp<IBinder>& parentHandle, int32_t windowType, int32_t ownerUid,
- sp<IBinder>* handle,
- sp<IGraphicBufferProducer>* gbp)
-{
+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) {
sp<Layer> parent = nullptr;
if (parentHandle != nullptr) {
auto layerHandle = reinterpret_cast<Layer::Handle*>(parentHandle.get());
@@ -91,14 +87,14 @@ status_t Client::createSurface(
}
// We rely on createLayer to check permissions.
- return mFlinger->createLayer(name, this, w, h, format, flags, windowType,
- ownerUid, handle, gbp, &parent);
+ return mFlinger->createLayer(name, this, w, h, format, flags, std::move(metadata), handle, gbp,
+ &parent);
}
status_t Client::createWithSurfaceParent(const String8& name, uint32_t w, uint32_t h,
PixelFormat format, uint32_t flags,
const sp<IGraphicBufferProducer>& parent,
- int32_t windowType, int32_t ownerUid, sp<IBinder>* handle,
+ LayerMetadata metadata, sp<IBinder>* handle,
sp<IGraphicBufferProducer>* gbp) {
if (mFlinger->authenticateSurfaceTexture(parent) == false) {
return BAD_VALUE;
@@ -111,8 +107,7 @@ status_t Client::createWithSurfaceParent(const String8& name, uint32_t w, uint32
sp<IBinder> parentHandle = layer->getHandle();
- return createSurface(name, w, h, format, flags, parentHandle, windowType, ownerUid, handle,
- gbp);
+ return createSurface(name, w, h, format, flags, parentHandle, std::move(metadata), handle, gbp);
}
status_t Client::clearLayerFrameStats(const sp<IBinder>& handle) const {