summaryrefslogtreecommitdiff
path: root/libs/hwui/pipeline/skia/SkiaVulkanPipeline.cpp
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/pipeline/skia/SkiaVulkanPipeline.cpp
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/pipeline/skia/SkiaVulkanPipeline.cpp')
-rw-r--r--libs/hwui/pipeline/skia/SkiaVulkanPipeline.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/libs/hwui/pipeline/skia/SkiaVulkanPipeline.cpp b/libs/hwui/pipeline/skia/SkiaVulkanPipeline.cpp
index 611a34c069d4..5cbe33debbce 100644
--- a/libs/hwui/pipeline/skia/SkiaVulkanPipeline.cpp
+++ b/libs/hwui/pipeline/skia/SkiaVulkanPipeline.cpp
@@ -63,8 +63,7 @@ Frame SkiaVulkanPipeline::getFrame() {
bool SkiaVulkanPipeline::draw(const Frame& frame, const SkRect& screenDirty, const SkRect& dirty,
const LightGeometry& lightGeometry,
LayerUpdateQueue* layerUpdateQueue, const Rect& contentDrawBounds,
- bool opaque, bool wideColorGamut,
- const LightInfo& lightInfo,
+ bool opaque, const LightInfo& lightInfo,
const std::vector<sp<RenderNode>>& renderNodes,
FrameInfoVisualizer* profiler) {
sk_sp<SkSurface> backBuffer = mVkSurface->getBackBufferSurface();
@@ -72,8 +71,7 @@ bool SkiaVulkanPipeline::draw(const Frame& frame, const SkRect& screenDirty, con
return false;
}
SkiaPipeline::updateLighting(lightGeometry, lightInfo);
- renderFrame(*layerUpdateQueue, dirty, renderNodes, opaque, wideColorGamut, contentDrawBounds,
- backBuffer);
+ renderFrame(*layerUpdateQueue, dirty, renderNodes, opaque, contentDrawBounds, backBuffer);
layerUpdateQueue->clear();
// Draw visual debugging features
@@ -139,6 +137,14 @@ bool SkiaVulkanPipeline::isContextReady() {
return CC_LIKELY(mVkManager.hasVkContext());
}
+SkColorType SkiaVulkanPipeline::getSurfaceColorType() const {
+ return mVkManager.getSurfaceColorType();
+}
+
+sk_sp<SkColorSpace> SkiaVulkanPipeline::getSurfaceColorSpace() {
+ return mVkManager.getSurfaceColorSpace();
+}
+
void SkiaVulkanPipeline::invokeFunctor(const RenderThread& thread, Functor* functor) {
// TODO: we currently don't support OpenGL WebView's
DrawGlInfo::Mode mode = DrawGlInfo::kModeProcessNoContext;