[SurfaceFlinger] Replace android_dataspace with Dataspace.
This patch replaces all android_dataspace in SurfaceFlinger with Dataspace
V1.1. 3 commands in sequence are used to do the conversion:
find ./ -type f -exec sed -i -e 's/android_dataspace_t/Dataspace/g' {} \;
find ./ -type f -exec sed -i -e 's/android_dataspace/Dataspace/g' {} \;
find ./ -type f -exec sed -i -e 's/HAL_DATASPACE_/Dataspace::/g' {} \;
With some minor tweak because most of the APIs in frameworks/native are still
accepting android_dataspace/android_dataspace_t.
Next step is to convert the rest of android_dataspace usage to Dataspace in
frameworks/native as well as frameworks/base.
BUG: 77156734
Test: Build and flash
Change-Id: I2304c7014cb49a1c9f67c4563603fb55e8dbd679
diff --git a/services/surfaceflinger/DisplayDevice.cpp b/services/surfaceflinger/DisplayDevice.cpp
index 8281ce0..58a774b 100644
--- a/services/surfaceflinger/DisplayDevice.cpp
+++ b/services/surfaceflinger/DisplayDevice.cpp
@@ -278,9 +278,9 @@
return mColorTransform;
}
-void DisplayDevice::setCompositionDataSpace(android_dataspace dataspace) {
+void DisplayDevice::setCompositionDataSpace(ui::Dataspace dataspace) {
ANativeWindow* const window = mNativeWindow.get();
- native_window_set_buffers_data_space(window, dataspace);
+ native_window_set_buffers_data_space(window, static_cast<android_dataspace>(dataspace));
}
// ----------------------------------------------------------------------------
@@ -463,12 +463,11 @@
mScissor.top, mScissor.right, mScissor.bottom, tr[0][0], tr[1][0], tr[2][0],
tr[0][1], tr[1][1], tr[2][1], tr[0][2], tr[1][2], tr[2][2]);
auto const surface = static_cast<Surface*>(window);
- android_dataspace dataspace = surface->getBuffersDataSpace();
+ ui::Dataspace dataspace = surface->getBuffersDataSpace();
result.appendFormat(" wideColor=%d, hdr=%d, colorMode=%s, dataspace: %s (%d)\n",
mDisplayHasWideColor, mDisplayHasHdr,
decodeColorMode(mActiveColorMode).c_str(),
- dataspaceDetails(dataspace).c_str(), dataspace);
-
+ dataspaceDetails(static_cast<android_dataspace>(dataspace)).c_str(), dataspace);
String8 surfaceDump;
mDisplaySurface->dumpAsString(surfaceDump);