summaryrefslogtreecommitdiff
path: root/libs/gui/LayerState.cpp
diff options
context:
space:
mode:
author Mathias Agopian <mathias@google.com> 2012-07-24 20:43:54 -0700
committer Mathias Agopian <mathias@google.com> 2012-07-24 20:43:54 -0700
commit8b33f032327f8de0dcc0e6d0d43ed80f834b51f6 (patch)
treed6228a0088740fe5f5c73f405f353bffd121bbae /libs/gui/LayerState.cpp
parent921e6ac4b7610a178285898d191eb0e3afe906c0 (diff)
update SF binder protocol to support setting display attributes
no change of functionality -- the old behavior is implemented on top of this new protocol. this new protocol will allow, eventually, to pass informations about displays and layer stacks. Change-Id: Ic6c2295e61ec8ecbc8ce01ab7664e35d928202fc
Diffstat (limited to 'libs/gui/LayerState.cpp')
-rw-r--r--libs/gui/LayerState.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/libs/gui/LayerState.cpp b/libs/gui/LayerState.cpp
index 224c30587c..25c773c3a6 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 {
@@ -69,4 +70,26 @@ status_t ComposerState::read(const Parcel& input) {
return state.read(input);
}
+
+status_t DisplayState::write(Parcel& output) const {
+ output.writeStrongBinder(surface->asBinder());
+ output.writeInt32(displayId);
+ output.writeInt32(layerStack);
+ output.writeInt32(orientation);
+ memcpy(output.writeInplace(sizeof(Rect)), &viewport, sizeof(Rect));
+ memcpy(output.writeInplace(sizeof(Rect)), &frame, sizeof(Rect));
+ return NO_ERROR;
+}
+
+status_t DisplayState::read(const Parcel& input) {
+ surface = interface_cast<ISurfaceTexture>(input.readStrongBinder());
+ displayId = input.readInt32();
+ layerStack = input.readInt32();
+ orientation = input.readInt32();
+ memcpy(&viewport, input.readInplace(sizeof(Rect)), sizeof(Rect));
+ memcpy(&frame, input.readInplace(sizeof(Rect)), sizeof(Rect));
+ return NO_ERROR;
+}
+
+
}; // namespace android