diff options
author | Peiyong Lin <lpy@google.com> | 2019-03-01 15:00:23 -0800 |
---|---|---|
committer | Peiyong Lin <lpy@google.com> | 2019-03-04 10:47:53 -0800 |
commit | c502cb751508dd2008ee5e0601d4aae31cbaf6ca (patch) | |
tree | 3178c4ae249d49189a8e731aafed509ac8d49331 /libs/gui/include | |
parent | cb20ccaa611fbde0fcbade5a0b667d183c405b4f (diff) | |
download | android_frameworks_native-c502cb751508dd2008ee5e0601d4aae31cbaf6ca.tar.gz android_frameworks_native-c502cb751508dd2008ee5e0601d4aae31cbaf6ca.tar.bz2 android_frameworks_native-c502cb751508dd2008ee5e0601d4aae31cbaf6ca.zip |
[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/include')
-rw-r--r-- | libs/gui/include/gui/LayerState.h | 8 | ||||
-rw-r--r-- | libs/gui/include/gui/SurfaceComposerClient.h | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/libs/gui/include/gui/LayerState.h b/libs/gui/include/gui/LayerState.h index 32d739114..35e795c30 100644 --- a/libs/gui/include/gui/LayerState.h +++ b/libs/gui/include/gui/LayerState.h @@ -88,6 +88,7 @@ struct layer_state_t { eCachedBufferChanged = 0x2'00000000, eBackgroundColorChanged = 0x4'00000000, eMetadataChanged = 0x8'00000000, + eColorSpaceAgnosticChanged = 0x10'00000000, }; layer_state_t() @@ -115,7 +116,8 @@ struct layer_state_t { api(-1), colorTransform(mat4()), bgColorAlpha(0), - bgColorDataspace(ui::Dataspace::UNKNOWN) { + bgColorDataspace(ui::Dataspace::UNKNOWN), + colorSpaceAgnostic(false) { matrix.dsdx = matrix.dtdy = 1.0f; matrix.dsdy = matrix.dtdx = 0.0f; hdrMetadata.validTypes = 0; @@ -192,6 +194,10 @@ struct layer_state_t { // the background color layer float bgColorAlpha; ui::Dataspace bgColorDataspace; + + // A color space agnostic layer means the color of this layer can be + // interpreted in any color space. + bool colorSpaceAgnostic; }; struct ComposerState { diff --git a/libs/gui/include/gui/SurfaceComposerClient.h b/libs/gui/include/gui/SurfaceComposerClient.h index e0623399b..2c483eefb 100644 --- a/libs/gui/include/gui/SurfaceComposerClient.h +++ b/libs/gui/include/gui/SurfaceComposerClient.h @@ -360,6 +360,7 @@ public: Transaction& setSidebandStream(const sp<SurfaceControl>& sc, const sp<NativeHandle>& sidebandStream); Transaction& setDesiredPresentTime(nsecs_t desiredPresentTime); + Transaction& setColorSpaceAgnostic(const sp<SurfaceControl>& sc, const bool agnostic); Transaction& addTransactionCompletedCallback( TransactionCompletedCallbackTakesContext callback, void* callbackContext); |