SurfaceFlinger: Expose construction of container layers.
WindowManager will imminently use them as Buffer-less Surfaces for catching
input. They can also be used for the existing hierarchy layers that the WM
adds to solely act as containers.
Bug: 111440400
Test: None
Change-Id: Ic7d9234d7fd8be74b77dfbc3daa6ca0e52f25768
Merged-In: Ic7d9234d7fd8be74b77dfbc3daa6ca0e52f25768
diff --git a/libs/gui/include/gui/ISurfaceComposerClient.h b/libs/gui/include/gui/ISurfaceComposerClient.h
index 8dfc99a..b4fd956 100644
--- a/libs/gui/include/gui/ISurfaceComposerClient.h
+++ b/libs/gui/include/gui/ISurfaceComposerClient.h
@@ -42,6 +42,7 @@
eFXSurfaceNormal = 0x00000000,
eFXSurfaceColor = 0x00020000,
+ eFXSurfaceContainer = 0x00080000,
eFXSurfaceMask = 0x000F0000,
};
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index cf53930..38e83f1 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -3628,6 +3628,11 @@
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;
@@ -3719,6 +3724,16 @@
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
diff --git a/services/surfaceflinger/SurfaceFlinger.h b/services/surfaceflinger/SurfaceFlinger.h
index 8f724e9..4b9e9cb 100644
--- a/services/surfaceflinger/SurfaceFlinger.h
+++ b/services/surfaceflinger/SurfaceFlinger.h
@@ -540,6 +540,10 @@
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