Skip to content

Commit 1ed7dec

Browse files
author
Sally Qi
committed
[Lut] in client composition, we should pass hwc.luts into lutShader to
render the layer Bug: 380894872 Test: libcompositionengine_test Flag: EXEMPT the lut is protected under the pointer Change-Id: I3c326ba4dd3e4c42dcdd776a229495d446f97562
1 parent a17adea commit 1ed7dec

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

services/surfaceflinger/CompositionEngine/include/compositionengine/LayerFE.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ class LayerFE : public virtual RefBase {
121121

122122
// True if layers with 170M dataspace should be overridden to sRGB.
123123
const bool treat170mAsSrgb;
124+
125+
std::shared_ptr<gui::DisplayLuts> luts;
124126
};
125127

126128
// A superset of LayerSettings required by RenderEngine to compose a layer

services/surfaceflinger/CompositionEngine/src/Output.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1564,7 +1564,9 @@ std::vector<LayerFE::LayerSettings> Output::generateClientCompositionRequests(
15641564
.clearContent = !clientComposition,
15651565
.blurSetting = blurSetting,
15661566
.whitePointNits = layerState.whitePointNits,
1567-
.treat170mAsSrgb = outputState.treat170mAsSrgb};
1567+
.treat170mAsSrgb = outputState.treat170mAsSrgb,
1568+
.luts = layer->getState().hwc ? layer->getState().hwc->luts
1569+
: nullptr};
15681570
if (auto clientCompositionSettings =
15691571
layerFE.prepareClientComposition(targetSettings)) {
15701572
clientCompositionLayers.push_back(std::move(*clientCompositionSettings));

services/surfaceflinger/LayerFE.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ std::optional<compositionengine::LayerFE::LayerSettings> LayerFE::prepareClientC
173173
layerSettings.edgeExtensionEffect = mSnapshot->edgeExtensionEffect;
174174
// Record the name of the layer for debugging further down the stack.
175175
layerSettings.name = mSnapshot->name;
176-
layerSettings.luts = mSnapshot->luts;
176+
layerSettings.luts = mSnapshot->luts ? mSnapshot->luts : targetSettings.luts;
177177

178178
if (hasEffect() && !hasBufferOrSidebandStream()) {
179179
prepareEffectsClientComposition(layerSettings, targetSettings);

0 commit comments

Comments
 (0)