summaryrefslogtreecommitdiffstats
path: root/libs/gui/LayerState.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/gui/LayerState.cpp')
-rw-r--r--libs/gui/LayerState.cpp39
1 files changed, 27 insertions, 12 deletions
diff --git a/libs/gui/LayerState.cpp b/libs/gui/LayerState.cpp
index 224c305..e2604f8 100644
--- a/libs/gui/LayerState.cpp
+++ b/libs/gui/LayerState.cpp
@@ -17,6 +17,7 @@
#include <utils/Errors.h>
#include <binder/Parcel.h>
#include <gui/ISurfaceComposerClient.h>
+#include <gui/ISurfaceTexture.h>
#include <private/gui/LayerState.h>
namespace android {
@@ -25,14 +26,7 @@ status_t layer_state_t::write(Parcel& output) const
{
status_t err;
- size_t len = transparentRegion.write(NULL, 0);
- err = output.writeInt32(len);
- if (err < NO_ERROR) return err;
-
- void* buf = output.writeInplace(len);
- if (buf == NULL) return NO_MEMORY;
-
- err = transparentRegion.write(buf, len);
+ err = output.write(transparentRegion);
if (err < NO_ERROR) return err;
// NOTE: regions are at the end of the structure
@@ -45,11 +39,8 @@ status_t layer_state_t::write(Parcel& output) const
status_t layer_state_t::read(const Parcel& input)
{
status_t err;
- size_t len = input.readInt32();
- void const* buf = input.readInplace(len);
- if (buf == NULL) return NO_MEMORY;
- err = transparentRegion.read(buf);
+ err = input.read(transparentRegion);
if (err < NO_ERROR) return err;
// NOTE: regions are at the end of the structure
@@ -69,4 +60,28 @@ status_t ComposerState::read(const Parcel& input) {
return state.read(input);
}
+
+status_t DisplayState::write(Parcel& output) const {
+ output.writeStrongBinder(token);
+ output.writeStrongBinder(surface->asBinder());
+ output.writeInt32(what);
+ output.writeInt32(layerStack);
+ output.writeInt32(orientation);
+ output.write(viewport);
+ output.write(frame);
+ return NO_ERROR;
+}
+
+status_t DisplayState::read(const Parcel& input) {
+ token = input.readStrongBinder();
+ surface = interface_cast<ISurfaceTexture>(input.readStrongBinder());
+ what = input.readInt32();
+ layerStack = input.readInt32();
+ orientation = input.readInt32();
+ input.read(viewport);
+ input.read(frame);
+ return NO_ERROR;
+}
+
+
}; // namespace android