Skip to content

Commit f9fc9e7

Browse files
Sally QiAndroid (Google) Code Review
authored andcommitted
Merge "[Lut] in client composition, we should pass hwc.luts into lutShader to render the layer" into main
2 parents a29a2d1 + 1ed7dec commit f9fc9e7

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
@@ -125,6 +125,8 @@ class LayerFE : public virtual RefBase {
125125

126126
// True if layers with 170M dataspace should be overridden to sRGB.
127127
const bool treat170mAsSrgb;
128+
129+
std::shared_ptr<gui::DisplayLuts> luts;
128130
};
129131

130132
// 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)