summaryrefslogtreecommitdiff
path: root/libs/hwui/DeviceInfo.h
diff options
context:
space:
mode:
authorPeiyong Lin <lpy@google.com>2018-09-10 16:28:08 -0700
committerPeiyong Lin <lpy@google.com>2018-09-13 13:50:27 -0700
commit1f6aa122a59a1de79531da045cbc6d517255623d (patch)
treebd8129b0c9c8d119b2ffea265a3042b3e7cef4a4 /libs/hwui/DeviceInfo.h
parent7ee06167def672bf961d023fc281878400bf8806 (diff)
[HWUI] Implement legacy color mode.
Previously, HWUI always produces SRGB buffers. We introduced new APIs for SurfaceFlinger, a.k.a. the composer service to return to composition preference for data space, and pixel format. This patch makes HWUI query composition preference from composer service, and creates the corresponding EGL surface with the correct attributes. In legacy mode, HWUI will take the pixel value from source color space, and interpret it as pixel value in destination color space. BUG: 111436479 BUG: 113530681 Test: Build, flash, boot and check dumpsys SurfaceFlinger Change-Id: I64562d5ea6f653076c8b448feb56b5e0624bc81c
Diffstat (limited to 'libs/hwui/DeviceInfo.h')
-rw-r--r--libs/hwui/DeviceInfo.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/libs/hwui/DeviceInfo.h b/libs/hwui/DeviceInfo.h
index 297b2664414b..416af179eb21 100644
--- a/libs/hwui/DeviceInfo.h
+++ b/libs/hwui/DeviceInfo.h
@@ -17,6 +17,7 @@
#define DEVICEINFO_H
#include <ui/DisplayInfo.h>
+#include <ui/GraphicTypes.h>
#include "Extensions.h"
#include "utils/Macros.h"
@@ -39,6 +40,8 @@ public:
static void initialize(int maxTextureSize);
int maxTextureSize() const { return mMaxTextureSize; }
+ ui::Dataspace getTargetDataSpace() const { return mTargetDataSpace; }
+ ui::PixelFormat getTargetPixelFormat() const { return mTargetPixelFormat; }
const DisplayInfo& displayInfo() const { return mDisplayInfo; }
const Extensions& extensions() const { return mExtensions; }
@@ -50,6 +53,9 @@ public:
static DisplayInfo queryDisplayInfo();
private:
+ static void queryCompositionPreference(ui::Dataspace* dataSpace,
+ ui::PixelFormat* pixelFormat);
+
DeviceInfo() {}
~DeviceInfo() {}
@@ -58,6 +64,9 @@ private:
int mMaxTextureSize;
DisplayInfo mDisplayInfo;
Extensions mExtensions;
+ // TODO(lpy) Replace below with android_ prefix types.
+ ui::Dataspace mTargetDataSpace;
+ ui::PixelFormat mTargetPixelFormat;
};
} /* namespace uirenderer */