summaryrefslogtreecommitdiff
path: root/libs/gui/LayerState.cpp
diff options
context:
space:
mode:
author chaviw <chaviw@google.com> 2017-06-27 12:40:18 -0700
committer chaviw <chaviw@google.com> 2017-09-21 18:10:21 -0700
commit13fdc49516d17f41e64e62e73c313b0928bf13cc (patch)
tree556fefa10d7612c1577cacf0d954715829b791a2 /libs/gui/LayerState.cpp
parentdda5d5d7914297adb42e251e8aadaece4dc3e65a (diff)
Added native functionality to create a color layer.
Added a new layer that can draw a specified color and specified alpha. This will replace creating a dim layer and allow any colors, not just black, to be set for this layer. Test: Added tests to Transaction_test.cpp to test with a color and a color layer with alpha. Change-Id: I00a38d1bbc01093026f088c3347454281bdc2b8c
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 3418a4983e..fcee73f445 100644
--- a/libs/gui/LayerState.cpp
+++ b/libs/gui/LayerState.cpp
@@ -46,6 +46,9 @@ status_t layer_state_t::write(Parcel& output) const
output.writeStrongBinder(IInterface::asBinder(barrierGbp));
output.writeStrongBinder(relativeLayerHandle);
output.writeStrongBinder(parentHandleForChild);
+ output.writeFloat(color.r);
+ output.writeFloat(color.g);
+ output.writeFloat(color.b);
output.write(transparentRegion);
return NO_ERROR;
}
@@ -79,6 +82,9 @@ status_t layer_state_t::read(const Parcel& input)
interface_cast<IGraphicBufferProducer>(input.readStrongBinder());
relativeLayerHandle = input.readStrongBinder();
parentHandleForChild = input.readStrongBinder();
+ color.r = input.readFloat();
+ color.g = input.readFloat();
+ color.b = input.readFloat();
input.read(transparentRegion);
return NO_ERROR;
}