Bug 1430829 - Update for removal of ImageFormat::Invalid in WR PR 2317. r?jrmuizel
MozReview-Commit-ID: 5TFM7B652qG
--- 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. */
};