Bug 1430829 - Update for removal of ImageFormat::Invalid in WR PR 2317. r=jrmuizel
authorKartikaya Gupta <kgupta@mozilla.com>
Fri, 19 Jan 2018 12:33:58 -0500
changeset 400046 6a281573abf459341b264101e4d6d04ee5f3185f
parent 400045 ce7010ea6de73ec16081ff6ae3e47924cf2519ee
child 400047 6d9dc65ca0ed1a374dde7592a5b4191a7a10759c
push id33288
push userrgurzau@mozilla.com
push dateSat, 20 Jan 2018 09:37:19 +0000
treeherdermozilla-central@b59b5e6e7070 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1430829
milestone59.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 1430829 - Update for removal of ImageFormat::Invalid in WR PR 2317. r=jrmuizel MozReview-Commit-ID: 5TFM7B652qG
gfx/layers/wr/WebRenderMessageUtils.h
gfx/webrender_bindings/WebRenderTypes.h
gfx/webrender_bindings/src/bindings.rs
gfx/webrender_bindings/webrender_ffi_generated.h
--- a/gfx/layers/wr/WebRenderMessageUtils.h
+++ b/gfx/layers/wr/WebRenderMessageUtils.h
@@ -109,17 +109,17 @@ struct ParamTraits<mozilla::wr::Pipeline
   : public PlainOldDataSerializer<mozilla::wr::PipelineId>
 {
 };
 
 template<>
 struct ParamTraits<mozilla::wr::ImageFormat>
   : public ContiguousEnumSerializer<
         mozilla::wr::ImageFormat,
-        mozilla::wr::ImageFormat::Invalid,
+        mozilla::wr::ImageFormat::R8,
         mozilla::wr::ImageFormat::Sentinel>
 {
 };
 
 template<>
 struct ParamTraits<mozilla::wr::LayoutSize>
   : public PlainOldDataSerializer<mozilla::wr::LayoutSize>
 {
--- a/gfx/webrender_bindings/WebRenderTypes.h
+++ b/gfx/webrender_bindings/WebRenderTypes.h
@@ -75,17 +75,16 @@ SurfaceFormatToImageFormat(gfx::SurfaceF
       // have it yet (cf. issue #732).
     case gfx::SurfaceFormat::B8G8R8A8:
       return Some(wr::ImageFormat::BGRA8);
     case gfx::SurfaceFormat::A8:
       return Some(wr::ImageFormat::R8);
     case gfx::SurfaceFormat::R8G8:
       return Some(wr::ImageFormat::RG8);
     case gfx::SurfaceFormat::UNKNOWN:
-      return Some(wr::ImageFormat::Invalid);
     default:
       return Nothing();
   }
 }
 
 inline gfx::SurfaceFormat
 ImageFormatToSurfaceFormat(ImageFormat aFormat) {
   switch (aFormat) {
@@ -97,17 +96,17 @@ ImageFormatToSurfaceFormat(ImageFormat a
       return gfx::SurfaceFormat::UNKNOWN;
   }
 }
 
 struct ImageDescriptor: public wr::WrImageDescriptor {
   // We need a default constructor for ipdl serialization.
   ImageDescriptor()
   {
-    format = wr::ImageFormat::Invalid;
+    format = (ImageFormat)0;
     width = 0;
     height = 0;
     stride = 0;
     is_opaque = false;
   }
 
   ImageDescriptor(const gfx::IntSize& aSize, gfx::SurfaceFormat aFormat)
   {
--- a/gfx/webrender_bindings/src/bindings.rs
+++ b/gfx/webrender_bindings/src/bindings.rs
@@ -542,17 +542,17 @@ pub unsafe extern "C" fn wr_renderer_rea
                                               dst_buffer: *mut u8,
                                               buffer_size: usize) {
     assert!(is_in_render_thread());
 
     let mut slice = make_slice_mut(dst_buffer, buffer_size);
     renderer.read_pixels_into(DeviceUintRect::new(
                                 DeviceUintPoint::new(0, 0),
                                 DeviceUintSize::new(width, height)),
-                              ReadPixelsFormat::Bgra8,
+                              ReadPixelsFormat::Standard(ImageFormat::BGRA8),
                               &mut slice);
 }
 
 /// cbindgen:field-names=[mBits]
 #[repr(C)]
 pub struct WrDebugFlags {
     bits: u32,
 }
--- a/gfx/webrender_bindings/webrender_ffi_generated.h
+++ b/gfx/webrender_bindings/webrender_ffi_generated.h
@@ -90,17 +90,16 @@ enum class FontRenderMode : uint32_t {
   Mono = 0,
   Alpha = 1,
   Subpixel = 2,
 
   Sentinel /* this must be last for serialization purposes. */
 };
 
 enum class ImageFormat : uint32_t {
-  Invalid = 0,
   R8 = 1,
   BGRA8 = 3,
   RGBAF32 = 4,
   RG8 = 5,
 
   Sentinel /* this must be last for serialization purposes. */
 };