summaryrefslogtreecommitdiff
path: root/libs/gui/LayerState.cpp
diff options
context:
space:
mode:
author Vishnu Nair <vishnun@google.com> 2023-02-27 02:46:29 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2023-02-27 02:46:29 +0000
commitb304b2f1177251c5deb904306ba5ad820e1c119d (patch)
tree46251b8670b80de40f4c5526b82c7b7469ddf733 /libs/gui/LayerState.cpp
parent26b34d62057135dd0dddc3396b401fe77f0d404a (diff)
parentfccd6362efb3c58c72ada640b46580af03bcdd76 (diff)
Merge changes Iddd5754a,I245702f8,I7abe5e9c,Id9ff8a03 into udc-dev
* changes: [sf] destroy unreachable snapshots [sf] fix snapshot updates for mirror layers [sf] Add fps, meta data and opaque to layer snapshots SF: Frontend fixes for issues surfaced by SurfaceFlinger_test
Diffstat (limited to 'libs/gui/LayerState.cpp')
-rw-r--r--libs/gui/LayerState.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/libs/gui/LayerState.cpp b/libs/gui/LayerState.cpp
index f6bba16899..b391337d1d 100644
--- a/libs/gui/LayerState.cpp
+++ b/libs/gui/LayerState.cpp
@@ -74,7 +74,7 @@ layer_state_t::layer_state_t()
surfaceDamageRegion(),
api(-1),
colorTransform(mat4()),
- bgColorAlpha(0),
+ bgColor(0),
bgColorDataspace(ui::Dataspace::UNKNOWN),
colorSpaceAgnostic(false),
shadowRadius(0.0f),
@@ -140,7 +140,10 @@ status_t layer_state_t::write(Parcel& output) const
SAFE_PARCEL(output.writeFloat, cornerRadius);
SAFE_PARCEL(output.writeUint32, backgroundBlurRadius);
SAFE_PARCEL(output.writeParcelable, metadata);
- SAFE_PARCEL(output.writeFloat, bgColorAlpha);
+ SAFE_PARCEL(output.writeFloat, bgColor.r);
+ SAFE_PARCEL(output.writeFloat, bgColor.g);
+ SAFE_PARCEL(output.writeFloat, bgColor.b);
+ SAFE_PARCEL(output.writeFloat, bgColor.a);
SAFE_PARCEL(output.writeUint32, static_cast<uint32_t>(bgColorDataspace));
SAFE_PARCEL(output.writeBool, colorSpaceAgnostic);
SAFE_PARCEL(output.writeVectorSize, listeners);
@@ -259,7 +262,14 @@ status_t layer_state_t::read(const Parcel& input)
SAFE_PARCEL(input.readUint32, &backgroundBlurRadius);
SAFE_PARCEL(input.readParcelable, &metadata);
- SAFE_PARCEL(input.readFloat, &bgColorAlpha);
+ SAFE_PARCEL(input.readFloat, &tmpFloat);
+ bgColor.r = tmpFloat;
+ SAFE_PARCEL(input.readFloat, &tmpFloat);
+ bgColor.g = tmpFloat;
+ SAFE_PARCEL(input.readFloat, &tmpFloat);
+ bgColor.b = tmpFloat;
+ SAFE_PARCEL(input.readFloat, &tmpFloat);
+ bgColor.a = tmpFloat;
SAFE_PARCEL(input.readUint32, &tmpUint32);
bgColorDataspace = static_cast<ui::Dataspace>(tmpUint32);
SAFE_PARCEL(input.readBool, &colorSpaceAgnostic);
@@ -618,8 +628,7 @@ void layer_state_t::merge(const layer_state_t& other) {
}
if (other.what & eBackgroundColorChanged) {
what |= eBackgroundColorChanged;
- color.rgb = other.color.rgb;
- bgColorAlpha = other.bgColorAlpha;
+ bgColor = other.bgColor;
bgColorDataspace = other.bgColorDataspace;
}
if (other.what & eMetadataChanged) {
@@ -752,7 +761,7 @@ uint64_t layer_state_t::diff(const layer_state_t& other) const {
CHECK_DIFF(diff, eColorTransformChanged, other, colorTransform);
if (other.what & eHasListenerCallbacksChanged) diff |= eHasListenerCallbacksChanged;
if (other.what & eInputInfoChanged) diff |= eInputInfoChanged;
- CHECK_DIFF3(diff, eBackgroundColorChanged, other, color.rgb, bgColorAlpha, bgColorDataspace);
+ CHECK_DIFF2(diff, eBackgroundColorChanged, other, bgColor, bgColorDataspace);
if (other.what & eMetadataChanged) diff |= eMetadataChanged;
CHECK_DIFF(diff, eShadowRadiusChanged, other, shadowRadius);
CHECK_DIFF3(diff, eRenderBorderChanged, other, borderEnabled, borderWidth, borderColor);