From ac9fa427d4a86745e60a5f7fd8e3ea340c4db907 Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Mon, 11 Feb 2013 16:40:36 -0800 Subject: get rid of Surface identity and token we use the IBinder instead. Change-Id: I4aa0b58869ba43f19980013620051e5a261b062d --- libs/gui/LayerState.cpp | 50 ++++++++++++++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 19 deletions(-) (limited to 'libs/gui/LayerState.cpp') 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( + 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( + input.readInplace(sizeof(layer_state_t::matrix22_t))); + input.read(crop); + input.read(transparentRegion); return NO_ERROR; } -- cgit v1.2.3-59-g8ed1b