summaryrefslogtreecommitdiff
path: root/libs/gui/LayerState.cpp
diff options
context:
space:
mode:
author Mathias Agopian <mathias@google.com> 2013-02-11 16:40:36 -0800
committer Mathias Agopian <mathias@google.com> 2013-02-13 15:27:08 -0800
commitac9fa427d4a86745e60a5f7fd8e3ea340c4db907 (patch)
tree657e6ec979339bc0e291247310af356e6a19ef7e /libs/gui/LayerState.cpp
parentb997f6ef0f3fa7cf67fd7487b88e5d6ac0bb15e9 (diff)
get rid of Surface identity and token
we use the IBinder instead. Change-Id: I4aa0b58869ba43f19980013620051e5a261b062d
Diffstat (limited to 'libs/gui/LayerState.cpp')
-rw-r--r--libs/gui/LayerState.cpp50
1 files changed, 31 insertions, 19 deletions
diff --git a/libs/gui/LayerState.cpp b/libs/gui/LayerState.cpp
index 5e5edcd2db..acdbd77161 100644
--- a/libs/gui/LayerState.cpp
+++ b/libs/gui/LayerState.cpp
@@ -24,29 +24,41 @@ namespace android {
status_t layer_state_t::write(Parcel& output) const
{
- status_t err;
-
- err = output.write(transparentRegion);
- if (err < NO_ERROR) return err;
-
- // NOTE: regions are at the end of the structure
- size_t size = sizeof(layer_state_t);
- size -= sizeof(transparentRegion);
- err = output.write(this, size);
- return err;
+ output.writeStrongBinder(surface);
+ output.writeInt32(what);
+ output.writeFloat(x);
+ output.writeFloat(y);
+ output.writeInt32(z);
+ output.writeInt32(w);
+ output.writeInt32(h);
+ output.writeInt32(layerStack);
+ output.writeFloat(alpha);
+ output.writeInt32(flags);
+ output.writeInt32(mask);
+ *reinterpret_cast<layer_state_t::matrix22_t *>(
+ output.writeInplace(sizeof(layer_state_t::matrix22_t))) = matrix;
+ output.write(crop);
+ output.write(transparentRegion);
+ return NO_ERROR;
}
status_t layer_state_t::read(const Parcel& input)
{
- status_t err;
-
- err = input.read(transparentRegion);
- if (err < NO_ERROR) return err;
-
- // NOTE: regions are at the end of the structure
- size_t size = sizeof(layer_state_t);
- size -= sizeof(transparentRegion);
- input.read(this, size);
+ surface = input.readStrongBinder();
+ what = input.readInt32();
+ x = input.readFloat();
+ y = input.readFloat();
+ z = input.readInt32();
+ w = input.readInt32();
+ h = input.readInt32();
+ layerStack = input.readInt32();
+ alpha = input.readFloat();
+ flags = input.readInt32();
+ mask = input.readInt32();
+ matrix = *reinterpret_cast<layer_state_t::matrix22_t const *>(
+ input.readInplace(sizeof(layer_state_t::matrix22_t)));
+ input.read(crop);
+ input.read(transparentRegion);
return NO_ERROR;
}