Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(105)

Unified Diff: ui/gfx/color_space.cc

Issue 2728173004: HDR: Do nonlinear blending in the compositor (Closed)
Patch Set: Roll in sRGB-extended Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/gfx/color_space.cc
diff --git a/ui/gfx/color_space.cc b/ui/gfx/color_space.cc
index 8b311a718b76a6e90c66a7015108bd9406e4b97a..45afbee4c0df3516d6ee4f7eb8bc346269f4e519 100644
--- a/ui/gfx/color_space.cc
+++ b/ui/gfx/color_space.cc
@@ -201,6 +201,12 @@ ColorSpace ColorSpace::CreateSRGB() {
}
// static
+ColorSpace ColorSpace::CreateExtendedSRGB() {
+ return ColorSpace(PrimaryID::BT709, TransferID::IEC61966_2_1_HDR,
+ MatrixID::RGB, RangeID::FULL);
+}
+
+// static
ColorSpace ColorSpace::CreateCustom(const SkMatrix44& to_XYZD50,
const SkColorSpaceTransferFn& fn) {
ColorSpace result(ColorSpace::PrimaryID::CUSTOM,
@@ -272,7 +278,8 @@ bool ColorSpace::operator==(const ColorSpace& other) const {
bool ColorSpace::IsHDR() const {
return transfer_ == TransferID::SMPTEST2084 ||
transfer_ == TransferID::ARIB_STD_B67 ||
- transfer_ == TransferID::LINEAR_HDR;
+ transfer_ == TransferID::LINEAR_HDR ||
+ transfer_ == TransferID::IEC61966_2_1_HDR;
}
bool ColorSpace::operator!=(const ColorSpace& other) const {
@@ -616,6 +623,7 @@ bool ColorSpace::GetTransferFunction(SkColorSpaceTransferFn* fn) const {
fn->fG = 2.222222222222f;
return true;
case ColorSpace::TransferID::IEC61966_2_1:
+ case ColorSpace::TransferID::IEC61966_2_1_HDR:
fn->fA = 0.947867345704f;
fn->fB = 0.052132654296f;
fn->fC = 0.077399380805f;
@@ -651,6 +659,11 @@ bool ColorSpace::GetInverseTransferFunction(SkColorSpaceTransferFn* fn) const {
return true;
}
+bool ColorSpace::HasExtendedSkTransferFn() const {
+ return transfer_ == TransferID::LINEAR_HDR ||
+ transfer_ == TransferID::IEC61966_2_1_HDR;
+}
+
void ColorSpace::GetTransferMatrix(SkMatrix44* matrix) const {
float Kr = 0;
float Kb = 0;
« ui/gfx/color_space.h ('K') | « ui/gfx/color_space.h ('k') | ui/gfx/color_transform.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698