From dec368e3afe48e1542edfb8a54a032e64290e5b0 Mon Sep 17 00:00:00 2001 From: mcarare Date: Tue, 16 Jan 2024 16:46:54 +0000 Subject: [PATCH 1/4] Bug 1873677 - GeckoView Android API 34 (Android 14) r=jgraham,jonalmeida Differential Revision: https://phabricator.services.mozilla.com/D198175 [ghsync] From https://hg.mozilla.org/mozilla-central/rev/18ac798fd2991ceb4a246a19cc4ff251c4208943 --- wrench/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wrench/Cargo.toml b/wrench/Cargo.toml index dfdb3ba57d..0dac41db9b 100644 --- a/wrench/Cargo.toml +++ b/wrench/Cargo.toml @@ -68,7 +68,7 @@ opengles_version_minor = 0 [package.metadata.android.sdk] # keep it in sync with android-sdk-version in android-sdk.configure -target_sdk_version = 33 +target_sdk_version = 34 min_sdk_version = 18 [package.metadata.android.application] From 245dc317327c23099ffaae4264461d9b779f8f9a Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Thu, 18 Jan 2024 04:59:37 +0000 Subject: [PATCH 2/4] Bug 1872776 - Avoid multiplying by NaN in draw_perspective. r=gfx-reviewers,ahale Differential Revision: https://phabricator.services.mozilla.com/D198772 [ghsync] From https://hg.mozilla.org/mozilla-central/rev/5608664350d824d3974f3026972afb0b23e5ee75 --- swgl/src/rasterize.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/swgl/src/rasterize.h b/swgl/src/rasterize.h index 9b49f25315..a4419c6555 100644 --- a/swgl/src/rasterize.h +++ b/swgl/src/rasterize.h @@ -1536,11 +1536,11 @@ static void draw_perspective(int nump, Interpolants interp_outs[4], for (int i = 0; i < nump; i++) { float w = 1.0f / p_clip[i].w; // If the W coord is essentially zero, small enough that division would - // result in Inf/NaN, then just set the reciprocal itself to zero so that - // the coordinates becomes zeroed out, as the only valid point that - // satisfies -W <= X/Y/Z <= W is all zeroes. - if (!isfinite(w)) w = 0.0f; - p_clip[i] = Point3D(p_clip[i].sel(X, Y, Z) * w * scale + offset, w); + // result in Inf/NaN, then just set the point to all zeroes, as the only + // point that satisfies -W <= X/Y/Z <= W is all zeroes. + p_clip[i] = isfinite(w) + ? Point3D(p_clip[i].sel(X, Y, Z) * w * scale + offset, w) + : Point3D(0.0f); } draw_perspective_clipped(nump, p_clip, interp_clip, colortex, depthtex); } From d67a2c345d2da13a91ac256dfda3ab81de44331b Mon Sep 17 00:00:00 2001 From: Perry McManis Date: Tue, 23 Jan 2024 05:49:41 +0000 Subject: [PATCH 3/4] Bug 1874923 - Update Glean to 56.1.0 r=janerik,supply-chain-reviewers,mach-reviewers,ahochheiden Differential Revision: https://phabricator.services.mozilla.com/D199093 [ghsync] From https://hg.mozilla.org/mozilla-central/rev/278693c1ad8192d883e523a24f36f112e22da417 --- Cargo.lock | 8 ++++---- webrender/Cargo.toml | 2 +- wr_glyph_rasterizer/Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index df288669f3..16c141824d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -996,9 +996,9 @@ dependencies = [ [[package]] name = "glean" -version = "56.0.0" +version = "56.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bd4421c9e77e098f774ce712128179069dd6a56904d3b95c9cf35b8418e3d6a" +checksum = "e12e51799c1e40ba51f24e0ff232d35ea321403920bea31dc11de1afaeb541ef" dependencies = [ "chrono", "crossbeam-channel", @@ -1016,9 +1016,9 @@ dependencies = [ [[package]] name = "glean-core" -version = "56.0.0" +version = "56.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a39d53b7dd7b0b81325273cd601f7ae19fba48e0916413c72952a3cf2b82293e" +checksum = "3f7570206325e7a20c45b60bf63f1f5b69c2ce0ee79ca0dc774e7c39eaab19aa" dependencies = [ "android_logger", "bincode", diff --git a/webrender/Cargo.toml b/webrender/Cargo.toml index 6b265b2ccb..0f3d14b456 100644 --- a/webrender/Cargo.toml +++ b/webrender/Cargo.toml @@ -52,7 +52,7 @@ svg_fmt = "0.4" tracy-rs = "0.1.2" derive_more = { version = "0.99", default-features = false, features = ["add_assign"] } etagere = "0.2.6" -glean = "56.0.0" +glean = "56.1.0" firefox-on-glean = { version = "0.1.0", optional = true } swgl = { path = "../swgl", optional = true } topological-sort = "0.1" diff --git a/wr_glyph_rasterizer/Cargo.toml b/wr_glyph_rasterizer/Cargo.toml index 93a47048c7..ea9d157ef8 100644 --- a/wr_glyph_rasterizer/Cargo.toml +++ b/wr_glyph_rasterizer/Cargo.toml @@ -25,7 +25,7 @@ tracy-rs = "0.1.2" log = "0.4" lazy_static = "1" fxhash = "0.2.1" -glean = { version = "56.0.0", optional = true } +glean = { version = "56.1.0", optional = true } firefox-on-glean = { version = "0.1.0", optional = true } serde = { optional = true, version = "1.0", features = ["serde_derive"] } From edef1db22d36223bb1465fd0ca291decfc00af18 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Wed, 31 Jan 2024 05:20:33 +0000 Subject: [PATCH 4/4] Bug 1874035 - Add custom Debug derives for bitflags with custom derives. r=gfx-reviewers,emilio,ErichDonGubler bitflags 2 has a shortcoming with using custom derives: you can't use custom derives (for e.g. MallocSizeOf) at the same time as bitflags's for the derives it supports. See https://github.com/bitflags/bitflags/issues/395 Differential Revision: https://phabricator.services.mozilla.com/D199941 [ghsync] From https://hg.mozilla.org/mozilla-central/rev/45bd6cc1bf7490f80630afce7550706e9b064f81 --- webrender/src/clip.rs | 12 +++++++++++- webrender/src/gpu_types.rs | 12 +++++++++++- webrender/src/segment.rs | 12 +++++++++++- webrender_api/src/display_item.rs | 24 ++++++++++++++++++++++-- webrender_api/src/font.rs | 12 +++++++++++- webrender_api/src/lib.rs | 24 ++++++++++++++++++++++-- 6 files changed, 88 insertions(+), 8 deletions(-) diff --git a/webrender/src/clip.rs b/webrender/src/clip.rs index 5292d0dafe..b8dd67981c 100644 --- a/webrender/src/clip.rs +++ b/webrender/src/clip.rs @@ -894,7 +894,7 @@ impl From for ClipNode { // Flags that are attached to instances of clip nodes. #[cfg_attr(feature = "capture", derive(Serialize))] #[cfg_attr(feature = "replay", derive(Deserialize))] -#[derive(Debug, Copy, PartialEq, Eq, Clone, PartialOrd, Ord, Hash, MallocSizeOf)] +#[derive(Copy, PartialEq, Eq, Clone, PartialOrd, Ord, Hash, MallocSizeOf)] pub struct ClipNodeFlags(u8); bitflags! { @@ -905,6 +905,16 @@ bitflags! { } } +impl core::fmt::Debug for ClipNodeFlags { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + if self.is_empty() { + write!(f, "{:#x}", Self::empty().bits()) + } else { + bitflags::parser::to_writer(self, f) + } + } +} + // When a clip node is found to be valid for a // clip chain instance, it's stored in an index // buffer style structure. This struct contains diff --git a/webrender/src/gpu_types.rs b/webrender/src/gpu_types.rs index 8ff7fc66f7..f6d24b2e39 100644 --- a/webrender/src/gpu_types.rs +++ b/webrender/src/gpu_types.rs @@ -612,7 +612,7 @@ pub struct MaskInstance { /// code should process this instance. #[cfg_attr(feature = "capture", derive(Serialize))] #[cfg_attr(feature = "replay", derive(Deserialize))] -#[derive(Debug, Copy, PartialEq, Eq, Clone, PartialOrd, Ord, Hash, MallocSizeOf)] +#[derive(Copy, PartialEq, Eq, Clone, PartialOrd, Ord, Hash, MallocSizeOf)] pub struct BrushFlags(u16); bitflags! { @@ -646,6 +646,16 @@ bitflags! { } } +impl core::fmt::Debug for BrushFlags { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + if self.is_empty() { + write!(f, "{:#x}", Self::empty().bits()) + } else { + bitflags::parser::to_writer(self, f) + } + } +} + /// Convenience structure to encode into PrimitiveInstanceData. pub struct BrushInstance { pub prim_header_index: PrimitiveHeaderIndex, diff --git a/webrender/src/segment.rs b/webrender/src/segment.rs index 31385d0cab..d53a49641f 100644 --- a/webrender/src/segment.rs +++ b/webrender/src/segment.rs @@ -70,7 +70,7 @@ const MAX_SEGMENTS: usize = 64; /// `write_transform_vertex()` function. #[cfg_attr(feature = "capture", derive(Serialize))] #[cfg_attr(feature = "replay", derive(Deserialize))] -#[derive(Debug, Copy, PartialEq, Eq, Clone, PartialOrd, Ord, Hash, MallocSizeOf)] +#[derive(Copy, PartialEq, Eq, Clone, PartialOrd, Ord, Hash, MallocSizeOf)] pub struct EdgeAaSegmentMask(u8); bitflags! { @@ -86,6 +86,16 @@ bitflags! { } } +impl core::fmt::Debug for EdgeAaSegmentMask { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + if self.is_empty() { + write!(f, "{:#x}", Self::empty().bits()) + } else { + bitflags::parser::to_writer(self, f) + } + } +} + bitflags! { #[derive(Debug, Copy, PartialEq, Eq, Clone, PartialOrd, Ord, Hash)] pub struct ItemFlags: u8 { diff --git a/webrender_api/src/display_item.rs b/webrender_api/src/display_item.rs index 4b7d4c5a8d..190d36ccba 100644 --- a/webrender_api/src/display_item.rs +++ b/webrender_api/src/display_item.rs @@ -35,7 +35,7 @@ pub type ItemTag = (u64, u16); pub type ItemKey = u16; #[repr(C)] -#[derive(Debug, Copy, PartialEq, Eq, Clone, PartialOrd, Ord, Hash, Deserialize, MallocSizeOf, Serialize, PeekPoke)] +#[derive(Copy, PartialEq, Eq, Clone, PartialOrd, Ord, Hash, Deserialize, MallocSizeOf, Serialize, PeekPoke)] pub struct PrimitiveFlags(u8); bitflags! { @@ -59,6 +59,16 @@ bitflags! { } } +impl core::fmt::Debug for PrimitiveFlags { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + if self.is_empty() { + write!(f, "{:#x}", Self::empty().bits()) + } else { + bitflags::parser::to_writer(self, f) + } + } +} + impl Default for PrimitiveFlags { fn default() -> Self { PrimitiveFlags::IS_BACKFACE_VISIBLE @@ -933,7 +943,7 @@ impl Hash for RasterSpace { } #[repr(C)] -#[derive(Debug, Copy, PartialEq, Eq, Clone, PartialOrd, Ord, Hash, Deserialize, MallocSizeOf, Serialize, PeekPoke)] +#[derive(Copy, PartialEq, Eq, Clone, PartialOrd, Ord, Hash, Deserialize, MallocSizeOf, Serialize, PeekPoke)] pub struct StackingContextFlags(u8); bitflags! { @@ -948,6 +958,16 @@ bitflags! { } } +impl core::fmt::Debug for StackingContextFlags { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + if self.is_empty() { + write!(f, "{:#x}", Self::empty().bits()) + } else { + bitflags::parser::to_writer(self, f) + } + } +} + impl Default for StackingContextFlags { fn default() -> Self { StackingContextFlags::empty() diff --git a/webrender_api/src/font.rs b/webrender_api/src/font.rs index c3c3871b35..d4f3057a7c 100644 --- a/webrender_api/src/font.rs +++ b/webrender_api/src/font.rs @@ -182,7 +182,7 @@ impl Default for GlyphOptions { } #[repr(C)] -#[derive(Debug, Copy, PartialEq, Eq, Clone, PartialOrd, Ord, Hash, Deserialize, MallocSizeOf, Serialize, PeekPoke)] +#[derive(Copy, PartialEq, Eq, Clone, PartialOrd, Ord, Hash, Deserialize, MallocSizeOf, Serialize, PeekPoke)] pub struct FontInstanceFlags(u32); bitflags! { @@ -220,6 +220,16 @@ bitflags! { } } +impl core::fmt::Debug for FontInstanceFlags { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + if self.is_empty() { + write!(f, "{:#x}", Self::empty().bits()) + } else { + bitflags::parser::to_writer(self, f) + } + } +} + impl Default for FontInstanceFlags { #[cfg(target_os = "windows")] fn default() -> FontInstanceFlags { diff --git a/webrender_api/src/lib.rs b/webrender_api/src/lib.rs index d3b641dfa2..fb8aba5e58 100644 --- a/webrender_api/src/lib.rs +++ b/webrender_api/src/lib.rs @@ -595,7 +595,7 @@ pub enum IntParameter { /// Flags to track why we are rendering. #[repr(C)] -#[derive(Debug, Copy, PartialEq, Eq, Clone, PartialOrd, Ord, Hash, Default, Deserialize, MallocSizeOf, Serialize)] +#[derive(Copy, PartialEq, Eq, Clone, PartialOrd, Ord, Hash, Default, Deserialize, MallocSizeOf, Serialize)] pub struct RenderReasons(u32); bitflags! { @@ -633,13 +633,23 @@ bitflags! { } } +impl core::fmt::Debug for RenderReasons { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + if self.is_empty() { + write!(f, "{:#x}", Self::empty().bits()) + } else { + bitflags::parser::to_writer(self, f) + } + } +} + impl RenderReasons { pub const NUM_BITS: u32 = 17; } /// Flags to enable/disable various builtin debugging tools. #[repr(C)] -#[derive(Debug, Copy, PartialEq, Eq, Clone, PartialOrd, Ord, Hash, Default, Deserialize, MallocSizeOf, Serialize)] +#[derive(Copy, PartialEq, Eq, Clone, PartialOrd, Ord, Hash, Default, Deserialize, MallocSizeOf, Serialize)] pub struct DebugFlags(u32); bitflags! { @@ -713,6 +723,16 @@ bitflags! { } } +impl core::fmt::Debug for DebugFlags { + fn fmt(&self, f: &mut core::fmt::Formatter) -> core::fmt::Result { + if self.is_empty() { + write!(f, "{:#x}", Self::empty().bits()) + } else { + bitflags::parser::to_writer(self, f) + } + } +} + /// Information specific to a primitive type that /// uniquely identifies a primitive template by key. #[derive(Debug, Clone, Eq, MallocSizeOf, PartialEq, Hash, Serialize, Deserialize)]