summaryrefslogtreecommitdiff
path: root/libs/gui/LayerState.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 /libs/gui/LayerState.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 'libs/gui/LayerState.cpp')
-rw-r--r--libs/gui/LayerState.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/libs/gui/LayerState.cpp b/libs/gui/LayerState.cpp
index ab929731f3..6091d3f08a 100644
--- a/libs/gui/LayerState.cpp
+++ b/libs/gui/LayerState.cpp
@@ -96,6 +96,7 @@ status_t layer_state_t::write(Parcel& output) const
output.writeStrongBinder(cachedBuffer.token);
output.writeInt32(cachedBuffer.bufferId);
+ output.writeParcelable(metadata);
output.writeFloat(colorAlpha);
output.writeUint32(static_cast<uint32_t>(colorDataspace));
@@ -172,6 +173,7 @@ status_t layer_state_t::read(const Parcel& input)
cachedBuffer.token = input.readStrongBinder();
cachedBuffer.bufferId = input.readInt32();
+ input.readParcelable(&metadata);
colorAlpha = input.readFloat();
colorDataspace = static_cast<ui::Dataspace>(input.readUint32());
@@ -396,6 +398,10 @@ void layer_state_t::merge(const layer_state_t& other) {
what |= eColorDataspaceChanged;
colorDataspace = other.colorDataspace;
}
+ if (other.what & eMetadataChanged) {
+ what |= eMetadataChanged;
+ metadata.merge(other.metadata);
+ }
if ((other.what & what) != other.what) {
ALOGE("Unmerged SurfaceComposer Transaction properties. LayerState::merge needs updating? "
"other.what=0x%" PRIu64 " what=0x%" PRIu64,