Bug 1892398 - Rename unclipped_surface_rect and add comments about incorrect/missing pieces. r=gw

No behavior change in this patch.

Differential Revision: https://phabricator.services.mozilla.com/D209665
This commit is contained in:
Nicolas Silva 2024-05-13 08:23:58 +00:00
Родитель f684ccba1d
Коммит cfb3aee8db
1 изменённых файлов: 17 добавлений и 6 удалений

Просмотреть файл

@ -191,7 +191,7 @@ pub fn push_quad(
);
}
QuadRenderStrategy::Tiled { x_tiles, y_tiles } => {
let unclipped_surface_rect = surface
let clip_coverage_rect = surface
.map_to_device_rect(&clip_chain.pic_coverage_rect, frame_context.spatial_tree);
scratch.quad_indirect_segments.clear();
@ -260,14 +260,14 @@ pub fn push_quad(
pattern,
is_masked,
prim_instance_index,
unclipped_surface_rect.cast_unit(),
clip_coverage_rect.cast_unit(),
frame_state,
targets,
&scratch.quad_indirect_segments,
);
}
QuadRenderStrategy::NinePatch { clip_rect, radius } => {
let unclipped_surface_rect = surface
let clip_coverage_rect = surface
.map_to_device_rect(&clip_chain.pic_coverage_rect, frame_context.spatial_tree);
let local_corner_0 = LayoutRect::new(
@ -379,10 +379,18 @@ pub fn push_quad(
}
if !scratch.quad_direct_segments.is_empty() {
let clip_rect = clip_coverage_rect.cast_unit();
// TODO(1892398): This is not correct. Patterns rely on the origin of the primitive
// rect to work in coordinates relative to the primitive. Passing a rectangle
// which is affected by clips causes patterns to shift as the clip changes the
// primitive origin.
let rect = clip_rect;
add_pattern_prim(
pattern,
prim_instance_index,
unclipped_surface_rect.cast_unit(),
rect,
clip_rect,
pattern.is_opaque,
frame_state,
targets,
@ -396,7 +404,7 @@ pub fn push_quad(
pattern,
is_masked,
prim_instance_index,
unclipped_surface_rect.cast_unit(),
clip_coverage_rect.cast_unit(),
frame_state,
targets,
&scratch.quad_indirect_segments,
@ -534,7 +542,10 @@ fn add_render_task_with_mask(
fn add_pattern_prim(
pattern: &Pattern,
prim_instance_index: PrimitiveInstanceIndex,
// TODO(1892398): At the moment we pass the rect and clip rect either in layout or device
// coordinates, which causes some issues.
rect: LayoutRect,
clip_rect: LayoutRect,
is_opaque: bool,
frame_state: &mut FrameBuildingState,
targets: &[CommandBufferIndex],
@ -543,7 +554,7 @@ fn add_pattern_prim(
let prim_address = write_prim_blocks(
&mut frame_state.frame_gpu_data.f32,
rect,
rect,
clip_rect,
pattern.base_color,
segments,
);