Bug 1495025 - P4. Add COLOR_16 type r=nical
☠☠ backed out by a22ea1fdf4cb ☠ ☠
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 04 Oct 2018 09:47:57 +0000
changeset 439545 25895d283d47e1f2de38776c18f278a82ee330c1
parent 439544 c3b43ee1092e7156c355d8e02911e9ea87b038c8
child 439546 528dbc463c225f21580d651431c08b63913f2da7
push id34778
push usernbeleuzu@mozilla.com
push dateThu, 04 Oct 2018 15:22:02 +0000
treeherdermozilla-central@01634947caab [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1495025
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1495025 - P4. Add COLOR_16 type r=nical Depends on D7296 Differential Revision: https://phabricator.services.mozilla.com/D7316
gfx/2d/Tools.h
gfx/2d/Types.h
gfx/webrender_bindings/WebRenderTypes.h
--- a/gfx/2d/Tools.h
+++ b/gfx/2d/Tools.h
@@ -113,16 +113,17 @@ static inline SurfaceFormat
 SurfaceFormatForColorDepth(ColorDepth aColorDepth)
 {
   SurfaceFormat format = SurfaceFormat::A8;
   switch (aColorDepth) {
     case ColorDepth::COLOR_8:
       break;
     case ColorDepth::COLOR_10:
     case ColorDepth::COLOR_12:
+    case ColorDepth::COLOR_16:
       format = SurfaceFormat::A16;
       break;
     case ColorDepth::UNKNOWN:
       MOZ_ASSERT_UNREACHABLE("invalid color depth value");
   }
   return format;
 }
 
@@ -134,16 +135,19 @@ BitDepthForColorDepth(ColorDepth aColorD
     case ColorDepth::COLOR_8:
       break;
     case ColorDepth::COLOR_10:
       depth = 10;
       break;
     case ColorDepth::COLOR_12:
       depth = 12;
       break;
+    case ColorDepth::COLOR_16:
+      depth = 16;
+      break;
     case ColorDepth::UNKNOWN:
       MOZ_ASSERT_UNREACHABLE("invalid color depth value");
   }
   return depth;
 }
 
 static inline ColorDepth
 ColorDepthForBitDepth(uint8_t aBitDepth)
@@ -153,16 +157,19 @@ ColorDepthForBitDepth(uint8_t aBitDepth)
     case 8:
       break;
     case 10:
       depth = ColorDepth::COLOR_10;
       break;
     case 12:
       depth = ColorDepth::COLOR_12;
       break;
+    case 16:
+      depth = ColorDepth::COLOR_16;
+      break;
     default:
       MOZ_ASSERT_UNREACHABLE("invalid color depth value");
   }
   return depth;
 }
 
 // 10 and 12 bits color depth image are using 16 bits integers for storage
 // As such we need to rescale the value from 10 or 12 bits to 16.
@@ -174,16 +181,18 @@ RescalingFactorForColorDepth(ColorDepth 
     case ColorDepth::COLOR_8:
       break;
     case ColorDepth::COLOR_10:
       factor = 64;
       break;
     case ColorDepth::COLOR_12:
       factor = 16;
       break;
+    case ColorDepth::COLOR_16:
+      break;
     case ColorDepth::UNKNOWN:
       MOZ_ASSERT_UNREACHABLE("invalid color depth value");
   }
   return factor;
 }
 
 static inline bool
 IsOpaqueFormat(SurfaceFormat aFormat) {
--- a/gfx/2d/Types.h
+++ b/gfx/2d/Types.h
@@ -101,16 +101,17 @@ inline bool IsOpaque(SurfaceFormat aForm
     return false;
   }
 }
 
 enum class ColorDepth : uint8_t {
   COLOR_8,
   COLOR_10,
   COLOR_12,
+  COLOR_16,
   UNKNOWN
 };
 
 enum class FilterType : int8_t {
   BLEND = 0,
   TRANSFORM,
   MORPHOLOGY,
   COLOR_MATRIX,
--- a/gfx/webrender_bindings/WebRenderTypes.h
+++ b/gfx/webrender_bindings/WebRenderTypes.h
@@ -858,16 +858,18 @@ static inline wr::WrYuvColorSpace ToWrYu
 static inline wr::WrColorDepth ToWrColorDepth(gfx::ColorDepth aColorDepth) {
   switch (aColorDepth) {
     case gfx::ColorDepth::COLOR_8:
       return wr::WrColorDepth::Color8;
     case gfx::ColorDepth::COLOR_10:
       return wr::WrColorDepth::Color10;
     case gfx::ColorDepth::COLOR_12:
       return wr::WrColorDepth::Color12;
+    case gfx::ColorDepth::COLOR_16:
+      return wr::WrColorDepth::Color16;
     default:
       MOZ_ASSERT_UNREACHABLE("Tried to convert invalid color depth value.");
   }
   return wr::WrColorDepth::Color8;
 }
 
 static inline wr::SyntheticItalics DegreesToSyntheticItalics(float aDegrees) {
   wr::SyntheticItalics synthetic_italics;