Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync changes from mozilla-central gfx/wr #4848

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
73985ff
Bug 1884145 - Document the quad rendering strategy. r=gw
nical Mar 8, 2024
ae18367
Bug 1883336 - Extract the quad pattern logic into specific entry poin…
nical Mar 8, 2024
bdd4539
Backed out changeset f61047c33e3e (bug 1883336) for causing webrender…
Mar 8, 2024
5e19307
Bug 1884403 - WebRender should only depend on `glean` when building f…
mrobinson Mar 9, 2024
944d370
Bug 1884881 - Update Glean to v58.1.0. r=perry.mcmanis,supply-chain-r…
badboy Mar 13, 2024
1919645
Bug 1883873 - Make SurfaceInfo::get_surface_rect return a DeviceIntRe…
nical Mar 13, 2024
18420ac
Bug 1883863 - Assert that the device pixel scale is valid in get_surf…
nical Mar 13, 2024
6242655
Bug 1769492 - Ensure that get_surface_rect does not produce a zero-si…
nical Mar 13, 2024
b06c997
Bug 1769492 - Don't assume that get_surface_rect returns a non-empty …
nical Mar 13, 2024
6e4ff49
Backed out 4 changesets (bug 1883863, bug 1883873, bug 1769492) for c…
Mar 13, 2024
491e5a9
Bug 1884583 - Make some of cs_border_segment's varyings highp. r=gw
jamienicol Mar 14, 2024
757bf06
Bug 1883873 - Make SurfaceInfo::get_surface_rect return a DeviceIntRe…
nical Mar 17, 2024
b50c2b2
Bug 1883863 - Assert that the device pixel scale is valid in get_surf…
nical Mar 17, 2024
9daaf08
Bug 1769492 - Ensure that get_surface_rect does not produce a zero-si…
nical Mar 17, 2024
ee690f3
Bug 1769492 - Don't assume that get_surface_rect returns a non-empty …
nical Mar 17, 2024
57d904f
Bug 1884791 - Avoid shader miscompilation on some Adreno drivers. r=gw
jamienicol Mar 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions webrender/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ serialize_program = ["serde", "webrender_build/serialize_program"]
dynamic_freetype = ["glyph_rasterizer/dynamic_freetype"]
static_freetype = ["glyph_rasterizer/static_freetype"]
leak_checks = []
gecko = ["firefox-on-glean", "glyph_rasterizer/gecko"]
gecko = ["firefox-on-glean", "glean", "glyph_rasterizer/gecko"]
sw_compositor = ["swgl"]

[build-dependencies]
Expand Down Expand Up @@ -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 = "58.0.0"
glean = { version = "58.1.0", optional = true }
firefox-on-glean = { version = "0.1.0", optional = true }
swgl = { path = "../swgl", optional = true }
topological-sort = "0.1"
Expand Down
8 changes: 4 additions & 4 deletions webrender/res/cs_border_segment.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ flat varying mediump vec4 vColor11;

// A point + tangent defining the line where the edge
// transition occurs. Used for corners only.
flat varying mediump vec4 vColorLine;
flat varying highp vec4 vColorLine;

// x: segment, y: clip mode
// We cast these to/from floats rather than using an ivec due to a driver bug
Expand All @@ -31,13 +31,13 @@ flat varying highp vec4 vClipCenter_Sign;

// An outer and inner elliptical radii for border
// corner clipping.
flat varying mediump vec4 vClipRadii;
flat varying highp vec4 vClipRadii;

// Reference point for determine edge clip lines.
flat varying mediump vec4 vEdgeReference;
flat varying highp vec4 vEdgeReference;

// Stores widths/2 and widths/3 to save doing this in FS.
flat varying mediump vec4 vPartialWidths;
flat varying highp vec4 vPartialWidths;

// Clipping parameters for dot or dash.
flat varying mediump vec4 vClipParams1;
Expand Down
23 changes: 12 additions & 11 deletions webrender/res/render_task.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,22 @@ struct ClipArea {
};

ClipArea fetch_clip_area(int index) {
ClipArea area;

RenderTaskData task_data;
if (index >= CLIP_TASK_EMPTY) {
area.task_rect = RectWithEndpoint(vec2(0.0), vec2(0.0));
area.device_pixel_scale = 0.0;
area.screen_origin = vec2(0.0);
// We deliberately create a dummy RenderTaskData here then convert to a
// ClipArea after this if-else statement, rather than initialize the
// ClipArea in separate branches, to avoid a miscompile in some Adreno
// drivers. See bug 1884791. Unfortunately the specific details of the bug
// are unknown, so please take extra care not to regress this when
// refactoring.
task_data = RenderTaskData(RectWithEndpoint(vec2(0.0), vec2(0.0)),
vec4(0.0));
} else {
RenderTaskData task_data = fetch_render_task_data(index);

area.task_rect = task_data.task_rect;
area.device_pixel_scale = task_data.user_data.x;
area.screen_origin = task_data.user_data.yz;
task_data = fetch_render_task_data(index);
}

return area;
return ClipArea(task_data.task_rect, task_data.user_data.x,
task_data.user_data.yz);
}

#endif //WR_VERTEX_SHADER
19 changes: 15 additions & 4 deletions webrender/src/picture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,11 @@ use std::collections::hash_map::Entry;
use std::ops::Range;
use crate::picture_textures::PictureCacheTextureHandle;
use crate::util::{MaxRect, VecHelper, MatrixHelpers, Recycler, ScaleOffset};
use crate::filterdata::{FilterDataHandle};
use crate::filterdata::FilterDataHandle;
use crate::tile_cache::{SliceDebugInfo, TileDebugInfo, DirtyTileDebugInfo};
use crate::visibility::{PrimitiveVisibilityFlags, FrameVisibilityContext};
use crate::visibility::{VisibilityState, FrameVisibilityState};
use crate::scene_building::{SliceFlags};
use crate::scene_building::SliceFlags;

// Maximum blur radius for blur filter (different than box-shadow blur).
// Taken from FilterNodeSoftware.cpp in Gecko.
Expand Down Expand Up @@ -3951,7 +3951,7 @@ impl SurfaceInfo {
&self,
local_rect: &PictureRect,
spatial_tree: &SpatialTree,
) -> Option<DeviceRect> {
) -> Option<DeviceIntRect> {
let local_rect = match local_rect.intersection(&self.clipping_rect) {
Some(rect) => rect,
None => return None,
Expand All @@ -3969,10 +3969,21 @@ impl SurfaceInfo {

local_to_world.map(&local_rect).unwrap()
} else {
// The content should have been culled out earlier.
assert!(self.device_pixel_scale.0 > 0.0);

local_rect.cast_unit()
};

Some((raster_rect * self.device_pixel_scale).round_out())
let surface_rect = (raster_rect * self.device_pixel_scale).round_out().to_i32();
if surface_rect.is_empty() {
// The local_rect computed above may have non-empty size that is very
// close to zero. Due to limited arithmetic precision, the SpaceMapper
// might transform the near-zero-sized rect into a zero-sized one.
return None;
}

Some(surface_rect)
}
}

Expand Down