From 1a2bdc8c65f9c4bd30033f6c931e4b637bf44d45 Mon Sep 17 00:00:00 2001 From: Chris Blume Date: Fri, 11 Jan 2019 16:52:12 -0800 Subject: [PATCH] Put HWUI & Webview color space in a struct The color space parameters are currently separate members. This was making passing color space parameters to functions a bit messy. This CL puts the color space parameters into their own struct which can be cleanly passed to functions. Test: Builds locally Change-Id: I3709b88dbdedb9616d4905ee973c3099f95b3ca7 --- libs/hwui/private/hwui/DrawVkInfo.h | 13 ++----------- native/webview/plat_support/draw_fn.h | 11 +++++++++-- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/libs/hwui/private/hwui/DrawVkInfo.h b/libs/hwui/private/hwui/DrawVkInfo.h index b2351fc026def..fd824bd957fd3 100644 --- a/libs/hwui/private/hwui/DrawVkInfo.h +++ b/libs/hwui/private/hwui/DrawVkInfo.h @@ -52,17 +52,8 @@ struct DrawVkInfo { // Input: Format of the destination surface. VkFormat format; - // Input: Color space transfer params - float g; - float a; - float b; - float c; - float d; - float e; - float f; - - // Input: Color space transformation from linear RGB to D50-adapted XYZ - float colorSpaceTransform[9]; + // Input: Color space + const SkColorSpace* colorSpaceInfo; // Input: current clip rect int clipLeft; diff --git a/native/webview/plat_support/draw_fn.h b/native/webview/plat_support/draw_fn.h index 6afd8837594c6..bb2ee9b5da04e 100644 --- a/native/webview/plat_support/draw_fn.h +++ b/native/webview/plat_support/draw_fn.h @@ -109,8 +109,15 @@ struct AwDrawFn_DrawVkParams { // Input: Format of the destination surface. VkFormat format; - // Input: Color space transformation from linear RGB to D50-adapted XYZ - float matrix[9]; + // Input: Color space parameters. + float transfer_function_g; + float transfer_function_a; + float transfer_function_b; + float transfer_function_c; + float transfer_function_d; + float transfer_function_e; + float transfer_function_f; + float color_space_toXYZD50[9]; // Input: current clip rect int clip_left;