diff options
author | 2020-07-29 23:34:07 +0200 | |
---|---|---|
committer | 2020-08-11 16:44:07 +0200 | |
commit | 6ad317c0dfcf07723ee36ed33c3eb16585469f63 (patch) | |
tree | 728a95dad18752fd36d7510118ee9eca31637387 /libs/gui/LayerState.cpp | |
parent | 141959209922a15acd27ee66e1408525f541a9dc (diff) |
[SF, CE] Rename viewport, frame and destinationClip
This change introduces a new class ProjectionSpace and uses
it in OutputCompositionState to describe the layer stack space,
the physical display space and the oriented display space.
We rename viewport to layerStackSpaceRect, frame to
orientedDisplaySpaceRect and destinationClip displaySpaceRect.
This aims to provide better readibility of the code and
it's also consistent with SurfaceControl.setDisplayProjction
where layerStackRect and displayRect are used for viewport
and frame.
Bug: 161793589
Bug: 160404780
Test: m && flash device
Test: atest libsurfaceflinger_unittest libcompositionengine_test
Test: adb shell dumpsys SurfaceFlinger
Change-Id: Iee20b908157cbef4de4d9addf429f98356ec942d
Diffstat (limited to 'libs/gui/LayerState.cpp')
-rw-r--r-- | libs/gui/LayerState.cpp | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/libs/gui/LayerState.cpp b/libs/gui/LayerState.cpp index 7742503575..725d3cdfd5 100644 --- a/libs/gui/LayerState.cpp +++ b/libs/gui/LayerState.cpp @@ -61,7 +61,7 @@ status_t layer_state_t::write(Parcel& output) const output.writeUint32(transform); output.writeBool(transformToDisplayInverse); output.write(crop); - output.write(frame); + output.write(orientedDisplaySpaceRect); if (buffer) { output.writeBool(true); output.write(*buffer); @@ -159,7 +159,7 @@ status_t layer_state_t::read(const Parcel& input) transform = input.readUint32(); transformToDisplayInverse = input.readBool(); input.read(crop); - input.read(frame); + input.read(orientedDisplaySpaceRect); buffer = new GraphicBuffer(); if (input.readBool()) { input.read(*buffer); @@ -216,15 +216,13 @@ status_t ComposerState::read(const Parcel& input) { return state.read(input); } - -DisplayState::DisplayState() : - what(0), - layerStack(0), - viewport(Rect::EMPTY_RECT), - frame(Rect::EMPTY_RECT), - width(0), - height(0) { -} +DisplayState::DisplayState() + : what(0), + layerStack(0), + layerStackSpaceRect(Rect::EMPTY_RECT), + orientedDisplaySpaceRect(Rect::EMPTY_RECT), + width(0), + height(0) {} status_t DisplayState::write(Parcel& output) const { output.writeStrongBinder(token); @@ -232,8 +230,8 @@ status_t DisplayState::write(Parcel& output) const { output.writeUint32(what); output.writeUint32(layerStack); output.writeUint32(toRotationInt(orientation)); - output.write(viewport); - output.write(frame); + output.write(layerStackSpaceRect); + output.write(orientedDisplaySpaceRect); output.writeUint32(width); output.writeUint32(height); return NO_ERROR; @@ -245,8 +243,8 @@ status_t DisplayState::read(const Parcel& input) { what = input.readUint32(); layerStack = input.readUint32(); orientation = ui::toRotation(input.readUint32()); - input.read(viewport); - input.read(frame); + input.read(layerStackSpaceRect); + input.read(orientedDisplaySpaceRect); width = input.readUint32(); height = input.readUint32(); return NO_ERROR; @@ -264,8 +262,8 @@ void DisplayState::merge(const DisplayState& other) { if (other.what & eDisplayProjectionChanged) { what |= eDisplayProjectionChanged; orientation = other.orientation; - viewport = other.viewport; - frame = other.frame; + layerStackSpaceRect = other.layerStackSpaceRect; + orientedDisplaySpaceRect = other.orientedDisplaySpaceRect; } if (other.what & eDisplaySizeChanged) { what |= eDisplaySizeChanged; @@ -368,7 +366,7 @@ void layer_state_t::merge(const layer_state_t& other) { } if (other.what & eFrameChanged) { what |= eFrameChanged; - frame = other.frame; + orientedDisplaySpaceRect = other.orientedDisplaySpaceRect; } if (other.what & eBufferChanged) { what |= eBufferChanged; |