summaryrefslogtreecommitdiff
path: root/libs/gui/LayerState.cpp
diff options
context:
space:
mode:
author Alec Mouri <alecmouri@google.com> 2023-02-11 00:25:24 +0000
committer Alec Mouri <alecmouri@google.com> 2023-02-17 17:51:42 +0000
commitf4af03ed9592dae0f2355dfff92c3c75c1b980d4 (patch)
tree2bacf9cb633a2b8eb445ad845b99493ce0939899 /libs/gui/LayerState.cpp
parent5fc135bf77a1d4379aca32d2b400cd3ff864d6fc (diff)
Add CachingHint into SurfaceFlinger
Some system layers may need to be excluded from surfaceflinger caching for a variety of reasons, including power or image quality considerations. This provides a mechanism for those system layers to never be cached on the GPU. Bug: 259311918 Test: libcompositionengine_test Test: run test app and inspect planner state Change-Id: I35418ad5a41cb2546e3b27b0af290bf3c31a0180
Diffstat (limited to 'libs/gui/LayerState.cpp')
-rw-r--r--libs/gui/LayerState.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/libs/gui/LayerState.cpp b/libs/gui/LayerState.cpp
index a6276e500c..f6bba16899 100644
--- a/libs/gui/LayerState.cpp
+++ b/libs/gui/LayerState.cpp
@@ -189,6 +189,7 @@ status_t layer_state_t::write(Parcel& output) const
SAFE_PARCEL(output.writeParcelable, trustedPresentationListener);
SAFE_PARCEL(output.writeFloat, currentSdrHdrRatio);
SAFE_PARCEL(output.writeFloat, desiredSdrHdrRatio);
+ SAFE_PARCEL(output.writeInt32, static_cast<int32_t>(cachingHint))
return NO_ERROR;
}
@@ -328,6 +329,10 @@ status_t layer_state_t::read(const Parcel& input)
SAFE_PARCEL(input.readFloat, &tmpFloat);
desiredSdrHdrRatio = tmpFloat;
+ int32_t tmpInt32;
+ SAFE_PARCEL(input.readInt32, &tmpInt32);
+ cachingHint = static_cast<gui::CachingHint>(tmpInt32);
+
return NO_ERROR;
}
@@ -580,6 +585,10 @@ void layer_state_t::merge(const layer_state_t& other) {
desiredSdrHdrRatio = other.desiredSdrHdrRatio;
currentSdrHdrRatio = other.currentSdrHdrRatio;
}
+ if (other.what & eCachingHintChanged) {
+ what |= eCachingHintChanged;
+ cachingHint = other.cachingHint;
+ }
if (other.what & eHdrMetadataChanged) {
what |= eHdrMetadataChanged;
hdrMetadata = other.hdrMetadata;
@@ -731,6 +740,7 @@ uint64_t layer_state_t::diff(const layer_state_t& other) const {
CHECK_DIFF(diff, eDataspaceChanged, other, dataspace);
CHECK_DIFF2(diff, eExtendedRangeBrightnessChanged, other, currentSdrHdrRatio,
desiredSdrHdrRatio);
+ CHECK_DIFF(diff, eCachingHintChanged, other, cachingHint);
CHECK_DIFF(diff, eHdrMetadataChanged, other, hdrMetadata);
if (other.what & eSurfaceDamageRegionChanged &&
(!surfaceDamageRegion.hasSameRects(other.surfaceDamageRegion))) {