diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2019-02-11 20:36:39 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-02-11 20:36:39 +0000 |
commit | 5ea4f3ce4e8b4c0bede17a4ded9c74cd193e691d (patch) | |
tree | 436b2557ec89cc18b000bf3d9680395cb18563c8 /native/android | |
parent | 3d6592b7dcafc89016f602f41699964845a17396 (diff) | |
parent | 7f24f79bc8788e41442c3ead05743127ff43ff5f (diff) |
Merge "ASurfaceControl: dataspace (1/2)"
Diffstat (limited to 'native/android')
-rw-r--r-- | native/android/libandroid.map.txt | 1 | ||||
-rw-r--r-- | native/android/surface_control.cpp | 14 |
2 files changed, 15 insertions, 0 deletions
diff --git a/native/android/libandroid.map.txt b/native/android/libandroid.map.txt index 51afbc7d91b0..730c409a91fb 100644 --- a/native/android/libandroid.map.txt +++ b/native/android/libandroid.map.txt @@ -230,6 +230,7 @@ LIBANDROID { ASurfaceTransaction_reparent; # introduced=29 ASurfaceTransaction_setBuffer; # introduced=29 ASurfaceTransaction_setBufferAlpha; # introduced=29 + ASurfaceTransaction_setBufferDataSpace; # introduced=29 ASurfaceTransaction_setBufferTransparency; # introduced=29 ASurfaceTransaction_setColor; # introduced=29 ASurfaceTransaction_setDamageRegion; # introduced=29 diff --git a/native/android/surface_control.cpp b/native/android/surface_control.cpp index 7d2934b8554e..d07052bb3b3f 100644 --- a/native/android/surface_control.cpp +++ b/native/android/surface_control.cpp @@ -440,6 +440,20 @@ void ASurfaceTransaction_setBufferAlpha(ASurfaceTransaction* aSurfaceTransaction transaction->setAlpha(surfaceControl, alpha); } +void ASurfaceTransaction_setBufferDataSpace(ASurfaceTransaction* aSurfaceTransaction, + ASurfaceControl* aSurfaceControl, + ADataSpace aDataSpace) { + CHECK_NOT_NULL(aSurfaceTransaction); + CHECK_NOT_NULL(aSurfaceControl); + + sp<SurfaceControl> surfaceControl = ASurfaceControl_to_SurfaceControl(aSurfaceControl); + LOG_ALWAYS_FATAL_IF(!isDataSpaceValid(surfaceControl, aDataSpace), "invalid dataspace"); + + Transaction* transaction = ASurfaceTransaction_to_Transaction(aSurfaceTransaction); + + transaction->setDataspace(surfaceControl, static_cast<ui::Dataspace>(aDataSpace)); +} + void ASurfaceTransaction_setHdrMetadata_smpte2086(ASurfaceTransaction* aSurfaceTransaction, ASurfaceControl* aSurfaceControl, struct AHdrMetadata_smpte2086* metadata) { |