summaryrefslogtreecommitdiff
path: root/libs/gui/LayerState.cpp
diff options
context:
space:
mode:
author Siarhei Vishniakou <svv@google.com> 2021-02-01 23:09:26 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2021-02-01 23:09:26 +0000
commit782536816d4d963b2c3dd21d3313d57f436c6e81 (patch)
tree67a16fb421b5275122bde8908ad09ab16f0c2aed /libs/gui/LayerState.cpp
parentb89b51a0a1926ea7e33e6f0b89bea42609a7b617 (diff)
parentfc434acf530cbde198c8936bf1bc09fad5861031 (diff)
Merge "Add inputEventId to SurfaceFrame" into sc-dev
Diffstat (limited to 'libs/gui/LayerState.cpp')
-rw-r--r--libs/gui/LayerState.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/libs/gui/LayerState.cpp b/libs/gui/LayerState.cpp
index ab20725936..3f314cd9de 100644
--- a/libs/gui/LayerState.cpp
+++ b/libs/gui/LayerState.cpp
@@ -63,7 +63,7 @@ layer_state_t::layer_state_t()
shouldBeSeamless(true),
fixedTransformHint(ui::Transform::ROT_INVALID),
frameNumber(0),
- frameTimelineVsyncId(ISurfaceComposer::INVALID_VSYNC_ID),
+ frameTimelineInfo(),
autoRefresh(false) {
matrix.dsdx = matrix.dtdy = 1.0f;
matrix.dsdy = matrix.dtdx = 0.0f;
@@ -151,7 +151,7 @@ status_t layer_state_t::write(Parcel& output) const
SAFE_PARCEL(output.writeBool, shouldBeSeamless);
SAFE_PARCEL(output.writeUint32, fixedTransformHint);
SAFE_PARCEL(output.writeUint64, frameNumber);
- SAFE_PARCEL(output.writeInt64, frameTimelineVsyncId);
+ SAFE_PARCEL(frameTimelineInfo.write, output);
SAFE_PARCEL(output.writeBool, autoRefresh);
SAFE_PARCEL(output.writeUint32, blurRegions.size());
@@ -270,7 +270,7 @@ status_t layer_state_t::read(const Parcel& input)
SAFE_PARCEL(input.readUint32, &tmpUint32);
fixedTransformHint = static_cast<ui::Transform::RotationFlags>(tmpUint32);
SAFE_PARCEL(input.readUint64, &frameNumber);
- SAFE_PARCEL(input.readInt64, &frameTimelineVsyncId);
+ SAFE_PARCEL(frameTimelineInfo.read, input);
SAFE_PARCEL(input.readBool, &autoRefresh);
uint32_t numRegions = 0;
@@ -537,15 +537,9 @@ void layer_state_t::merge(const layer_state_t& other) {
what |= eFrameNumberChanged;
frameNumber = other.frameNumber;
}
- if (other.what & eFrameTimelineVsyncChanged) {
- // When merging vsync Ids we take the oldest valid one
- if (frameTimelineVsyncId != ISurfaceComposer::INVALID_VSYNC_ID &&
- other.frameTimelineVsyncId != ISurfaceComposer::INVALID_VSYNC_ID) {
- frameTimelineVsyncId = std::max(frameTimelineVsyncId, other.frameTimelineVsyncId);
- } else if (frameTimelineVsyncId == ISurfaceComposer::INVALID_VSYNC_ID) {
- frameTimelineVsyncId = other.frameTimelineVsyncId;
- }
- what |= eFrameTimelineVsyncChanged;
+ if (other.what & eFrameTimelineInfoChanged) {
+ what |= eFrameTimelineInfoChanged;
+ frameTimelineInfo.merge(other.frameTimelineInfo);
}
if (other.what & eAutoRefreshChanged) {
what |= eAutoRefreshChanged;