Skip to content

Commit 15769b5

Browse files
Sally QiAndroid (Google) Code Review
authored andcommitted
Merge "[Lut] Change setLuts function signature." into main
2 parents f863ba4 + 9e84811 commit 15769b5

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

libs/gui/SurfaceComposerClient.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1953,9 +1953,9 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setDesir
19531953
}
19541954

19551955
SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setLuts(
1956-
const sp<SurfaceControl>& sc, const base::unique_fd& lutFd,
1957-
const std::vector<int32_t>& offsets, const std::vector<int32_t>& dimensions,
1958-
const std::vector<int32_t>& sizes, const std::vector<int32_t>& samplingKeys) {
1956+
const sp<SurfaceControl>& sc, base::unique_fd&& lutFd, const std::vector<int32_t>& offsets,
1957+
const std::vector<int32_t>& dimensions, const std::vector<int32_t>& sizes,
1958+
const std::vector<int32_t>& samplingKeys) {
19591959
layer_state_t* s = getLayerState(sc);
19601960
if (!s) {
19611961
mStatus = BAD_INDEX;
@@ -1964,8 +1964,8 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setLuts(
19641964

19651965
s->what |= layer_state_t::eLutsChanged;
19661966
if (lutFd.ok()) {
1967-
s->luts = std::make_shared<gui::DisplayLuts>(base::unique_fd(dup(lutFd.get())), offsets,
1968-
dimensions, sizes, samplingKeys);
1967+
s->luts = std::make_shared<gui::DisplayLuts>(std::move(lutFd), offsets, dimensions, sizes,
1968+
samplingKeys);
19691969
} else {
19701970
s->luts = nullptr;
19711971
}

libs/gui/include/gui/SurfaceComposerClient.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ class SurfaceComposerClient : public RefBase
620620
Transaction& setExtendedRangeBrightness(const sp<SurfaceControl>& sc,
621621
float currentBufferRatio, float desiredRatio);
622622
Transaction& setDesiredHdrHeadroom(const sp<SurfaceControl>& sc, float desiredRatio);
623-
Transaction& setLuts(const sp<SurfaceControl>& sc, const base::unique_fd& lutFd,
623+
Transaction& setLuts(const sp<SurfaceControl>& sc, base::unique_fd&& lutFd,
624624
const std::vector<int32_t>& offsets,
625625
const std::vector<int32_t>& dimensions,
626626
const std::vector<int32_t>& sizes,

0 commit comments

Comments
 (0)