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/surface_control.cpp | |
parent | 3d6592b7dcafc89016f602f41699964845a17396 (diff) | |
parent | 7f24f79bc8788e41442c3ead05743127ff43ff5f (diff) |
Merge "ASurfaceControl: dataspace (1/2)"
Diffstat (limited to 'native/android/surface_control.cpp')
-rw-r--r-- | native/android/surface_control.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
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) { |