Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3ff826cd authored by Marissa Wall's avatar Marissa Wall
Browse files

ASurfaceControl: dataspace (2/2)

Allow dataspace to be set on the SurfaceControl.

Test: atest CtsViewTestCases:android.view.cts.ASurfaceControlTest
Bug: 80477568
Change-Id: I70b2109e4691c039899c9e8a3606c46c69428a3f
parent df93796a
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@

#include <sys/cdefs.h>

#include <android/data_space.h>
#include <android/hardware_buffer.h>
#include <android/hdr_metadata.h>
#include <android/native_window.h>
@@ -316,6 +317,15 @@ void ASurfaceTransaction_setBufferAlpha(ASurfaceTransaction* transaction,
                                        ASurfaceControl* surface_control, float alpha)
                                        __INTRODUCED_IN(29);

/**
 * Sets the data space of the surface_control's buffers.
 *
 * If no data space is set, the surface control defaults to ADATASPACE_SRGB.
 */
void ASurfaceTransaction_setBufferDataSpace(ASurfaceTransaction* transaction,
                                            ASurfaceControl* surface_control, ADataSpace data_space)
                                            __INTRODUCED_IN(29);

/*
 * SMPTE ST 2086 "Mastering Display Color Volume" static metadata
 *
+1 −0
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ const std::array<float, 16> BufferStateLayer::IDENTITY_MATRIX{

BufferStateLayer::BufferStateLayer(const LayerCreationArgs& args) : BufferLayer(args) {
    mOverrideScalingMode = NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW;
    mCurrentState.dataspace = ui::Dataspace::V0_SRGB;
}
BufferStateLayer::~BufferStateLayer() = default;