diff options
| author | 2019-03-01 15:00:23 -0800 | |
|---|---|---|
| committer | 2019-03-04 10:47:53 -0800 | |
| commit | c502cb751508dd2008ee5e0601d4aae31cbaf6ca (patch) | |
| tree | 3178c4ae249d49189a8e731aafed509ac8d49331 /libs/gui/SurfaceComposerClient.cpp | |
| parent | cb20ccaa611fbde0fcbade5a0b667d183c405b4f (diff) | |
[SurfaceFlinger] Add setColorSpaceAgnostic API.
Some layers, for example ScreenDecorOverlay*, only carry black, white or gray
with some transpanrency, these values are special as they are color space
agnostic. We don't need to do color conversion on them, instead we want to
intercept the color space before we send to hardware composer for validation.
This patch adds an API to allow this to happen.
BUG: 126616348
Test: Build, flash and boot. Verify by calling in Letterbox.
Change-Id: I62c9bf4feb320b466584a90df707c2b04213339c
Diffstat (limited to 'libs/gui/SurfaceComposerClient.cpp')
| -rw-r--r-- | libs/gui/SurfaceComposerClient.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp index 050ba8736b..0a4ad462d9 100644 --- a/libs/gui/SurfaceComposerClient.cpp +++ b/libs/gui/SurfaceComposerClient.cpp @@ -989,6 +989,20 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setDesir return *this; } +SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setColorSpaceAgnostic( + const sp<SurfaceControl>& sc, const bool agnostic) { + layer_state_t* s = getLayerState(sc); + if (!s) { + mStatus = BAD_INDEX; + return *this; + } + s->what |= layer_state_t::eColorSpaceAgnosticChanged; + s->colorSpaceAgnostic = agnostic; + + registerSurfaceControlForCallback(sc); + return *this; +} + SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::addTransactionCompletedCallback( TransactionCompletedCallbackTakesContext callback, void* callbackContext) { |