зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1613260 - Support per-task scale for local space rasterization r=gw,aosmond
Differential Revision: https://phabricator.services.mozilla.com/D63434 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
127fcd7b52
Коммит
447713c3c6
|
@ -606,6 +606,8 @@ static void WebRenderDebugPrefChangeCallback(const char* aPrefName, void*) {
|
|||
wr::DebugFlags::DISABLE_GRADIENT_PRIMS)
|
||||
GFX_WEBRENDER_DEBUG(".obscure-images", wr::DebugFlags::OBSCURE_IMAGES)
|
||||
GFX_WEBRENDER_DEBUG(".glyph-flashing", wr::DebugFlags::GLYPH_FLASHING)
|
||||
GFX_WEBRENDER_DEBUG(".disable-raster-root-scaling",
|
||||
wr::DebugFlags::DISABLE_RASTER_ROOT_SCALING)
|
||||
#undef GFX_WEBRENDER_DEBUG
|
||||
|
||||
gfx::gfxVars::SetWebRenderDebugFlags(flags.bits);
|
||||
|
|
|
@ -38,16 +38,18 @@ void mix_blend_brush_vs(
|
|||
V_OP = prim_user_data.x;
|
||||
|
||||
PictureTask src_task = fetch_picture_task(prim_user_data.z);
|
||||
vec2 src_uv = device_pos +
|
||||
vec2 src_device_pos = vi.world_pos.xy * (src_task.device_pixel_scale / max(0.0, vi.world_pos.w));
|
||||
vec2 src_uv = src_device_pos +
|
||||
src_task.common_data.task_rect.p0 -
|
||||
src_task.content_origin;
|
||||
V_SRC_UV = src_uv / texture_size;
|
||||
V_SRC_LAYER = src_task.common_data.texture_layer_index;
|
||||
|
||||
RenderTaskCommonData backdrop_task = fetch_render_task_common_data(prim_user_data.y);
|
||||
float src_to_backdrop_scale = pic_task.device_pixel_scale / src_task.device_pixel_scale;
|
||||
vec2 backdrop_uv = device_pos +
|
||||
backdrop_task.task_rect.p0 -
|
||||
src_task.content_origin;
|
||||
src_task.content_origin * src_to_backdrop_scale;
|
||||
V_BACKDROP_UV = backdrop_uv / texture_size;
|
||||
V_BACKDROP_LAYER = backdrop_task.texture_layer_index;
|
||||
}
|
||||
|
|
|
@ -3602,6 +3602,13 @@ pub struct RasterConfig {
|
|||
pub surface_index: SurfaceIndex,
|
||||
/// Whether this picture establishes a rasterization root.
|
||||
pub establishes_raster_root: bool,
|
||||
/// Scaling factor applied to fit within MAX_SURFACE_SIZE when
|
||||
/// establishing a raster root.
|
||||
/// Most code doesn't need to know about it, since it is folded
|
||||
/// into device_pixel_scale when the rendertask is set up.
|
||||
/// However e.g. text rasterization uses it to ensure consistent
|
||||
/// on-screen font size.
|
||||
pub root_scaling_factor: f32,
|
||||
}
|
||||
|
||||
bitflags! {
|
||||
|
@ -4316,14 +4323,14 @@ impl PicturePrimitive {
|
|||
};
|
||||
|
||||
match self.raster_config {
|
||||
Some(ref raster_config) => {
|
||||
Some(ref mut raster_config) => {
|
||||
let pic_rect = PictureRect::from_untyped(&self.precise_local_rect.to_untyped());
|
||||
|
||||
let device_pixel_scale = frame_state
|
||||
let mut device_pixel_scale = frame_state
|
||||
.surfaces[raster_config.surface_index.0]
|
||||
.device_pixel_scale;
|
||||
|
||||
let (clipped, unclipped) = match get_raster_rects(
|
||||
let (mut clipped, mut unclipped) = match get_raster_rects(
|
||||
pic_rect,
|
||||
&map_pic_to_raster,
|
||||
&map_raster_to_world,
|
||||
|
@ -4337,11 +4344,68 @@ impl PicturePrimitive {
|
|||
};
|
||||
let transform = map_pic_to_raster.get_transform();
|
||||
|
||||
/// If the picture (raster_config) establishes a raster root,
|
||||
/// its requested resolution won't be clipped by the parent or
|
||||
/// viewport; so we need to make sure the requested resolution is
|
||||
/// "reasonable", ie. <= MAX_SURFACE_SIZE. If not, scale the
|
||||
/// picture down until it fits that limit. This results in a new
|
||||
/// device_rect, a new unclipped rect, and a new device_pixel_scale.
|
||||
///
|
||||
/// Since the adjusted device_pixel_scale is passed into the
|
||||
/// RenderTask (and then the shader via RenderTaskData) this mostly
|
||||
/// works transparently, reusing existing support for variable DPI
|
||||
/// support. The on-the-fly scaling can be seen as on-the-fly,
|
||||
/// per-task DPI adjustment. Logical pixels are unaffected.
|
||||
///
|
||||
/// The scaling factor is returned to the caller; blur radius,
|
||||
/// font size, etc. need to be scaled accordingly.
|
||||
fn adjust_scale_for_max_surface_size(
|
||||
raster_config: &RasterConfig,
|
||||
pic_rect: PictureRect,
|
||||
map_pic_to_raster: &SpaceMapper<PicturePixel, RasterPixel>,
|
||||
map_raster_to_world: &SpaceMapper<RasterPixel, WorldPixel>,
|
||||
clipped_prim_bounding_rect: WorldRect,
|
||||
device_pixel_scale : &mut DevicePixelScale,
|
||||
device_rect: &mut DeviceIntRect,
|
||||
unclipped: &mut DeviceRect) -> Option<f32>
|
||||
{
|
||||
if raster_config.establishes_raster_root &&
|
||||
(device_rect.size.width > (MAX_SURFACE_SIZE as i32) ||
|
||||
device_rect.size.height > (MAX_SURFACE_SIZE as i32))
|
||||
{
|
||||
// round_out will grow by 1 integer pixel if origin is on a
|
||||
// fractional position, so keep that margin for error with -1:
|
||||
let scale = (MAX_SURFACE_SIZE as f32 - 1.0) /
|
||||
(i32::max(device_rect.size.width, device_rect.size.height) as f32);
|
||||
*device_pixel_scale = *device_pixel_scale * Scale::new(scale);
|
||||
let new_device_rect = device_rect.to_f32() * Scale::new(scale);
|
||||
*device_rect = new_device_rect.round_out().try_cast::<i32>().unwrap();
|
||||
|
||||
*unclipped = match get_raster_rects(
|
||||
pic_rect,
|
||||
&map_pic_to_raster,
|
||||
&map_raster_to_world,
|
||||
clipped_prim_bounding_rect,
|
||||
*device_pixel_scale
|
||||
) {
|
||||
Some(info) => info.1,
|
||||
None => {
|
||||
return None
|
||||
}
|
||||
};
|
||||
Some(scale)
|
||||
}
|
||||
else
|
||||
{
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
let dep_info = match raster_config.composite_mode {
|
||||
PictureCompositeMode::Filter(Filter::Blur(blur_radius)) => {
|
||||
let blur_std_deviation = blur_radius * device_pixel_scale.0;
|
||||
let scale_factors = scale_factors(&transform);
|
||||
let blur_std_deviation = DeviceSize::new(
|
||||
let mut blur_std_deviation = DeviceSize::new(
|
||||
blur_std_deviation * scale_factors.0,
|
||||
blur_std_deviation * scale_factors.1
|
||||
);
|
||||
|
@ -4374,7 +4438,7 @@ impl PicturePrimitive {
|
|||
clipped
|
||||
};
|
||||
|
||||
let original_size = device_rect.size;
|
||||
let mut original_size = device_rect.size;
|
||||
|
||||
// Adjust the size to avoid introducing sampling errors during the down-scaling passes.
|
||||
// what would be even better is to rasterize the picture at the down-scaled size
|
||||
|
@ -4384,6 +4448,16 @@ impl PicturePrimitive {
|
|||
blur_std_deviation,
|
||||
);
|
||||
|
||||
if let Some(scale) = adjust_scale_for_max_surface_size(
|
||||
raster_config, pic_rect, &map_pic_to_raster, &map_raster_to_world,
|
||||
clipped_prim_bounding_rect,
|
||||
&mut device_pixel_scale, &mut device_rect, &mut unclipped)
|
||||
{
|
||||
blur_std_deviation = blur_std_deviation * scale;
|
||||
original_size = (original_size.to_f32() * scale).try_cast::<i32>().unwrap();
|
||||
raster_config.root_scaling_factor = scale;
|
||||
}
|
||||
|
||||
let uv_rect_kind = calculate_uv_rect_kind(
|
||||
&pic_rect,
|
||||
&transform,
|
||||
|
@ -4446,6 +4520,15 @@ impl PicturePrimitive {
|
|||
DeviceSize::new(max_std_deviation, max_std_deviation),
|
||||
);
|
||||
|
||||
if let Some(scale) = adjust_scale_for_max_surface_size(
|
||||
raster_config, pic_rect, &map_pic_to_raster, &map_raster_to_world,
|
||||
clipped_prim_bounding_rect,
|
||||
&mut device_pixel_scale, &mut device_rect, &mut unclipped)
|
||||
{
|
||||
// std_dev adjusts automatically from using device_pixel_scale
|
||||
raster_config.root_scaling_factor = scale;
|
||||
}
|
||||
|
||||
let uv_rect_kind = calculate_uv_rect_kind(
|
||||
&pic_rect,
|
||||
&transform,
|
||||
|
@ -4536,6 +4619,15 @@ impl PicturePrimitive {
|
|||
Some((render_task_id, render_task_id))
|
||||
}
|
||||
PictureCompositeMode::Filter(..) => {
|
||||
|
||||
if let Some(scale) = adjust_scale_for_max_surface_size(
|
||||
raster_config, pic_rect, &map_pic_to_raster, &map_raster_to_world,
|
||||
clipped_prim_bounding_rect,
|
||||
&mut device_pixel_scale, &mut clipped, &mut unclipped)
|
||||
{
|
||||
raster_config.root_scaling_factor = scale;
|
||||
}
|
||||
|
||||
let uv_rect_kind = calculate_uv_rect_kind(
|
||||
&pic_rect,
|
||||
&transform,
|
||||
|
@ -4561,6 +4653,14 @@ impl PicturePrimitive {
|
|||
Some((render_task_id, render_task_id))
|
||||
}
|
||||
PictureCompositeMode::ComponentTransferFilter(..) => {
|
||||
if let Some(scale) = adjust_scale_for_max_surface_size(
|
||||
raster_config, pic_rect, &map_pic_to_raster, &map_raster_to_world,
|
||||
clipped_prim_bounding_rect,
|
||||
&mut device_pixel_scale, &mut clipped, &mut unclipped)
|
||||
{
|
||||
raster_config.root_scaling_factor = scale;
|
||||
}
|
||||
|
||||
let uv_rect_kind = calculate_uv_rect_kind(
|
||||
&pic_rect,
|
||||
&transform,
|
||||
|
@ -4856,6 +4956,14 @@ impl PicturePrimitive {
|
|||
}
|
||||
PictureCompositeMode::MixBlend(..) |
|
||||
PictureCompositeMode::Blit(_) => {
|
||||
if let Some(scale) = adjust_scale_for_max_surface_size(
|
||||
raster_config, pic_rect, &map_pic_to_raster, &map_raster_to_world,
|
||||
clipped_prim_bounding_rect,
|
||||
&mut device_pixel_scale, &mut clipped, &mut unclipped)
|
||||
{
|
||||
raster_config.root_scaling_factor = scale;
|
||||
}
|
||||
|
||||
let uv_rect_kind = calculate_uv_rect_kind(
|
||||
&pic_rect,
|
||||
&transform,
|
||||
|
@ -4881,6 +4989,15 @@ impl PicturePrimitive {
|
|||
Some((render_task_id, render_task_id))
|
||||
}
|
||||
PictureCompositeMode::SvgFilter(ref primitives, ref filter_datas) => {
|
||||
|
||||
if let Some(scale) = adjust_scale_for_max_surface_size(
|
||||
raster_config, pic_rect, &map_pic_to_raster, &map_raster_to_world,
|
||||
clipped_prim_bounding_rect,
|
||||
&mut device_pixel_scale, &mut clipped, &mut unclipped)
|
||||
{
|
||||
raster_config.root_scaling_factor = scale;
|
||||
}
|
||||
|
||||
let uv_rect_kind = calculate_uv_rect_kind(
|
||||
&pic_rect,
|
||||
&transform,
|
||||
|
@ -5325,6 +5442,7 @@ impl PicturePrimitive {
|
|||
composite_mode,
|
||||
establishes_raster_root,
|
||||
surface_index: state.push_surface(surface),
|
||||
root_scaling_factor: 1.0,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -5477,7 +5595,9 @@ impl PicturePrimitive {
|
|||
// Check if any of the surfaces can't be rasterized in local space but want to.
|
||||
if raster_config.establishes_raster_root
|
||||
&& (surface_rect.size.width > MAX_SURFACE_SIZE
|
||||
|| surface_rect.size.height > MAX_SURFACE_SIZE) {
|
||||
|| surface_rect.size.height > MAX_SURFACE_SIZE)
|
||||
&& frame_context.debug_flags.contains(DebugFlags::DISABLE_RASTER_ROOT_SCALING)
|
||||
{
|
||||
raster_config.establishes_raster_root = false;
|
||||
state.are_raster_roots_assigned = false;
|
||||
}
|
||||
|
|
|
@ -2968,6 +2968,10 @@ impl PrimitiveStore {
|
|||
let raster_space = pic.get_raster_space(frame_context.spatial_tree);
|
||||
let surface = &frame_state.surfaces[pic_context.surface_index.0];
|
||||
let prim_info = &scratch.prim_info[prim_instance.visibility_info.0 as usize];
|
||||
let root_scaling_factor = match pic.raster_config {
|
||||
Some(ref raster_config) => raster_config.root_scaling_factor,
|
||||
None => 1.0
|
||||
};
|
||||
|
||||
run.request_resources(
|
||||
prim_offset,
|
||||
|
@ -2978,6 +2982,7 @@ impl PrimitiveStore {
|
|||
surface,
|
||||
prim_spatial_node_index,
|
||||
raster_space,
|
||||
root_scaling_factor,
|
||||
&pic_context.subpixel_mode,
|
||||
frame_state.resource_cache,
|
||||
frame_state.gpu_cache,
|
||||
|
|
|
@ -229,6 +229,7 @@ impl TextRunPrimitive {
|
|||
subpixel_mode: &SubpixelMode,
|
||||
raster_space: RasterSpace,
|
||||
prim_rect: PictureRect,
|
||||
root_scaling_factor: f32,
|
||||
spatial_tree: &SpatialTree,
|
||||
) -> bool {
|
||||
// If local raster space is specified, include that in the scale
|
||||
|
@ -239,7 +240,10 @@ impl TextRunPrimitive {
|
|||
// will no longer be required.
|
||||
|
||||
let raster_scale = raster_space.local_scale().unwrap_or(1.0).max(0.001);
|
||||
let dps = surface.device_pixel_scale.0;
|
||||
// root_scaling_factor is used to scale very large pictures that establish
|
||||
// a raster root back to something sane, thus scale the device size accordingly.
|
||||
// to the shader it looks like a change in DPI which it already supports.
|
||||
let dps = surface.device_pixel_scale.0 * root_scaling_factor;
|
||||
let glyph_raster_scale = dps * raster_scale;
|
||||
let font_size = specified_font.size.to_f32_px();
|
||||
let device_font_size = font_size * glyph_raster_scale;
|
||||
|
@ -365,6 +369,7 @@ impl TextRunPrimitive {
|
|||
surface: &SurfaceInfo,
|
||||
spatial_node_index: SpatialNodeIndex,
|
||||
raster_space: RasterSpace,
|
||||
root_scaling_factor: f32,
|
||||
subpixel_mode: &SubpixelMode,
|
||||
resource_cache: &mut ResourceCache,
|
||||
gpu_cache: &mut GpuCache,
|
||||
|
@ -380,6 +385,7 @@ impl TextRunPrimitive {
|
|||
subpixel_mode,
|
||||
raster_space,
|
||||
prim_rect,
|
||||
root_scaling_factor,
|
||||
spatial_tree,
|
||||
);
|
||||
|
||||
|
|
|
@ -142,7 +142,7 @@ pub struct PictureTask {
|
|||
pub uv_rect_handle: GpuCacheHandle,
|
||||
pub surface_spatial_node_index: SpatialNodeIndex,
|
||||
uv_rect_kind: UvRectKind,
|
||||
device_pixel_scale: DevicePixelScale,
|
||||
pub device_pixel_scale: DevicePixelScale,
|
||||
/// A bitfield that describes which dirty regions should be included
|
||||
/// in batches built for this picture task.
|
||||
pub vis_mask: PrimitiveVisibilityMask,
|
||||
|
|
|
@ -3799,8 +3799,8 @@ impl Renderer {
|
|||
// composite operation in this batch.
|
||||
let (readback_rect, readback_layer) = readback.get_target_rect();
|
||||
let (backdrop_rect, _) = backdrop.get_target_rect();
|
||||
let backdrop_screen_origin = match backdrop.kind {
|
||||
RenderTaskKind::Picture(ref task_info) => task_info.content_origin,
|
||||
let (backdrop_screen_origin, backdrop_scale) = match backdrop.kind {
|
||||
RenderTaskKind::Picture(ref task_info) => (task_info.content_origin, task_info.device_pixel_scale),
|
||||
_ => panic!("bug: composite on non-picture?"),
|
||||
};
|
||||
let source_screen_origin = match source.kind {
|
||||
|
@ -3818,8 +3818,10 @@ impl Renderer {
|
|||
false,
|
||||
);
|
||||
|
||||
let source_in_backdrop_space = source_screen_origin.to_f32() * backdrop_scale.0;
|
||||
|
||||
let mut src = DeviceIntRect::new(
|
||||
source_screen_origin + (backdrop_rect.origin - backdrop_screen_origin),
|
||||
(source_in_backdrop_space + (backdrop_rect.origin - backdrop_screen_origin).to_f32()).to_i32(),
|
||||
readback_rect.size,
|
||||
);
|
||||
let mut dest = readback_rect.to_i32();
|
||||
|
|
|
@ -1427,6 +1427,10 @@ bitflags! {
|
|||
const INVALIDATION_DBG = 1 << 28;
|
||||
/// Log tile cache to memory for later saving as part of wr-capture
|
||||
const TILE_CACHE_LOGGING_DBG = 1 << 29;
|
||||
/// For debugging, force-disable automatic scaling of establishes_raster_root
|
||||
/// pictures that are too large (ie go back to old behavior that prevents those
|
||||
/// large pictures from establishing a raster root).
|
||||
const DISABLE_RASTER_ROOT_SCALING = 1 << 30;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,385 @@
|
|||
root:
|
||||
items:
|
||||
- type: "stacking-context"
|
||||
transform: scale(0.125)
|
||||
items:
|
||||
- type: "stacking-context"
|
||||
perspective: 100
|
||||
perspective-origin: 100 50
|
||||
items:
|
||||
- image: checkerboard(0, 512, 16);
|
||||
bounds: [1600, 1600, 8192, 8192]
|
||||
- type: rect
|
||||
color: [180, 140, 120, 0.4]
|
||||
bounds: 2400 2400 8192 8192
|
||||
- type: "stacking-context"
|
||||
bounds: [0, 0, 8192, 8192]
|
||||
filters: [invert(1)]
|
||||
mix-blend-mode: exclusion
|
||||
complex-clip:
|
||||
rect: [1920, 1920, 4096, 4096]
|
||||
radius: [2048, 2048]
|
||||
items:
|
||||
- type: "stacking-context"
|
||||
transform: scale(24)
|
||||
items:
|
||||
- type: line
|
||||
baseline: 16
|
||||
start: 16
|
||||
end: 208
|
||||
width: 1
|
||||
orientation: horizontal
|
||||
color: black
|
||||
style: solid
|
||||
- type: line
|
||||
baseline: 24
|
||||
start: 16
|
||||
end: 208
|
||||
width: 1
|
||||
orientation: horizontal
|
||||
color: blue
|
||||
style: dashed
|
||||
- type: line
|
||||
baseline: 32
|
||||
start: 16
|
||||
end: 208
|
||||
width: 1
|
||||
orientation: horizontal
|
||||
color: green
|
||||
style: dotted
|
||||
- type: line
|
||||
baseline: 40
|
||||
start: 16
|
||||
end: 208
|
||||
width: 4
|
||||
thickness: 1
|
||||
orientation: horizontal
|
||||
color: red
|
||||
style: wavy
|
||||
|
||||
- type: line
|
||||
baseline: 48
|
||||
start: 16
|
||||
end: 208
|
||||
width: 2
|
||||
orientation: horizontal
|
||||
color: black
|
||||
style: solid
|
||||
- type: line
|
||||
baseline: 64
|
||||
start: 16
|
||||
end: 208
|
||||
width: 2
|
||||
orientation: horizontal
|
||||
color: blue
|
||||
style: dashed
|
||||
- type: line
|
||||
baseline: 80
|
||||
start: 16
|
||||
end: 207 # pruposefully cut off
|
||||
width: 2
|
||||
orientation: horizontal
|
||||
color: green
|
||||
style: dotted
|
||||
- type: line
|
||||
baseline: 96
|
||||
start: 16
|
||||
end: 208
|
||||
width: 6
|
||||
thickness: 2
|
||||
orientation: horizontal
|
||||
color: red
|
||||
style: wavy
|
||||
|
||||
-
|
||||
type: "shadow"
|
||||
bounds: [8, 100, 225, 50]
|
||||
blur-radius: 0
|
||||
offset: [2, 2]
|
||||
color: red
|
||||
- type: line
|
||||
baseline: 112
|
||||
start: 16
|
||||
end: 208
|
||||
width: 1
|
||||
orientation: horizontal
|
||||
color: [0,0,0,0]
|
||||
style: solid
|
||||
- type: line
|
||||
baseline: 120
|
||||
start: 16
|
||||
end: 208
|
||||
width: 1
|
||||
orientation: horizontal
|
||||
color: [0,0,0,0]
|
||||
style: dashed
|
||||
- type: line
|
||||
baseline: 128
|
||||
start: 16
|
||||
end: 209
|
||||
width: 1
|
||||
orientation: horizontal
|
||||
color: [0,0,0,0]
|
||||
style: dotted
|
||||
- type: line
|
||||
baseline: 136
|
||||
start: 16
|
||||
end: 208
|
||||
width: 4
|
||||
thickness: 1
|
||||
orientation: horizontal
|
||||
color: [0,0,0,0]
|
||||
style: wavy
|
||||
-
|
||||
type: pop-all-shadows
|
||||
|
||||
-
|
||||
type: "shadow"
|
||||
bounds: [8, 145, 225, 65]
|
||||
blur-radius: 1
|
||||
offset: [2, 3]
|
||||
color: red
|
||||
- type: line
|
||||
baseline: 160
|
||||
start: 16
|
||||
end: 208
|
||||
width: 2
|
||||
orientation: horizontal
|
||||
color: black
|
||||
style: solid
|
||||
- type: line
|
||||
baseline: 168
|
||||
start: 16
|
||||
end: 208
|
||||
width: 2
|
||||
orientation: horizontal
|
||||
color: blue
|
||||
style: dashed
|
||||
- type: line
|
||||
baseline: 184
|
||||
start: 16
|
||||
end: 207 # purposefully cut off
|
||||
width: 2
|
||||
orientation: horizontal
|
||||
color: green
|
||||
style: dotted
|
||||
- type: line
|
||||
baseline: 192
|
||||
start: 16
|
||||
end: 208
|
||||
width: 6
|
||||
thickness: 2
|
||||
orientation: horizontal
|
||||
color: red
|
||||
style: wavy
|
||||
-
|
||||
type: pop-all-shadows
|
||||
|
||||
-
|
||||
type: "shadow"
|
||||
bounds: [8, 220, 225, 40]
|
||||
blur-radius: 0
|
||||
offset: [5, 7]
|
||||
color: red
|
||||
- type: line
|
||||
baseline: 232
|
||||
start: 16
|
||||
end: 208
|
||||
width: 8
|
||||
orientation: horizontal
|
||||
color: black
|
||||
style: solid
|
||||
- type: line
|
||||
baseline: 248
|
||||
start: 16
|
||||
end: 208
|
||||
width: 8
|
||||
orientation: horizontal
|
||||
color: blue
|
||||
style: dashed
|
||||
- type: line
|
||||
baseline: 272
|
||||
start: 16
|
||||
end: 205 # purposefully cut off
|
||||
width: 8
|
||||
orientation: horizontal
|
||||
color: green
|
||||
style: dotted
|
||||
- type: line
|
||||
baseline: 296
|
||||
start: 16
|
||||
end: 208
|
||||
width: 12
|
||||
thickness: 3
|
||||
orientation: horizontal
|
||||
color: black
|
||||
style: wavy
|
||||
-
|
||||
type: "pop-all-shadows"
|
||||
|
||||
-
|
||||
type: "shadow"
|
||||
bounds: [0, 320, 240, 140]
|
||||
blur-radius: 3
|
||||
offset: [5, 7]
|
||||
color: red
|
||||
- type: line
|
||||
baseline: 320
|
||||
start: 16
|
||||
end: 208
|
||||
width: 8
|
||||
orientation: horizontal
|
||||
color: black
|
||||
style: solid
|
||||
- type: line
|
||||
baseline: 352
|
||||
start: 16
|
||||
end: 208
|
||||
width: 8
|
||||
orientation: horizontal
|
||||
color: blue
|
||||
style: dashed
|
||||
- type: line
|
||||
baseline: 368
|
||||
start: 16
|
||||
end: 205 # purposefully cut off
|
||||
width: 8
|
||||
orientation: horizontal
|
||||
color: green
|
||||
style: dotted
|
||||
- type: line
|
||||
baseline: 392
|
||||
start: 16
|
||||
end: 208
|
||||
width: 16
|
||||
thickness: 4
|
||||
orientation: horizontal
|
||||
color: black
|
||||
style: wavy
|
||||
-
|
||||
type: "pop-all-shadows"
|
||||
|
||||
- type: line
|
||||
baseline: 224
|
||||
start: 16
|
||||
end: 208
|
||||
width: 1
|
||||
orientation: vertical
|
||||
color: black
|
||||
style: solid
|
||||
- type: line
|
||||
baseline: 232
|
||||
start: 16
|
||||
end: 208
|
||||
width: 1
|
||||
orientation: vertical
|
||||
color: blue
|
||||
style: dashed
|
||||
- type: line
|
||||
baseline: 240
|
||||
start: 16
|
||||
end: 208
|
||||
width: 1
|
||||
orientation: vertical
|
||||
color: green
|
||||
style: dotted
|
||||
- type: line
|
||||
baseline: 256
|
||||
start: 16
|
||||
end: 208
|
||||
thickness: 1
|
||||
width: 4
|
||||
orientation: vertical
|
||||
color: red
|
||||
style: wavy
|
||||
|
||||
- type: line
|
||||
baseline: 272
|
||||
start: 16
|
||||
end: 208
|
||||
width: 2
|
||||
orientation: vertical
|
||||
color: black
|
||||
style: solid
|
||||
- type: line
|
||||
baseline: 296
|
||||
start: 16
|
||||
end: 208
|
||||
width: 2
|
||||
orientation: vertical
|
||||
color: blue
|
||||
style: dashed
|
||||
- type: line
|
||||
baseline: 320
|
||||
start: 16
|
||||
end: 207 # purposefully cut off
|
||||
width: 2
|
||||
orientation: vertical
|
||||
color: green
|
||||
style: dotted
|
||||
- type: line
|
||||
baseline: 336
|
||||
start: 16
|
||||
end: 208
|
||||
thickness: 2
|
||||
width: 6
|
||||
orientation: vertical
|
||||
color: red
|
||||
style: wavy
|
||||
|
||||
-
|
||||
type: "shadow"
|
||||
bounds: [350, 0, 120, 240]
|
||||
blur-radius: 3
|
||||
offset: [5, 2]
|
||||
color: black
|
||||
- type: line
|
||||
baseline: 384
|
||||
start: 16
|
||||
end: 208
|
||||
width: 8
|
||||
orientation: vertical
|
||||
color: yellow
|
||||
style: solid
|
||||
- type: line
|
||||
baseline: 400
|
||||
start: 16
|
||||
end: 208
|
||||
width: 8
|
||||
orientation: vertical
|
||||
color: blue
|
||||
style: dashed
|
||||
- type: line
|
||||
baseline: 416
|
||||
start: 16
|
||||
end: 205 # purposefully cut off
|
||||
width: 8
|
||||
orientation: vertical
|
||||
color: green
|
||||
style: dotted
|
||||
- type: line
|
||||
baseline: 440
|
||||
start: 16
|
||||
end: 208
|
||||
thickness: 4
|
||||
width: 16
|
||||
orientation: vertical
|
||||
color: red
|
||||
style: wavy
|
||||
-
|
||||
type: "pop-all-shadows"
|
||||
- text: "side-left"
|
||||
origin: 80 120
|
||||
size: 32
|
||||
transpose: true
|
||||
flip-x: true
|
||||
font: "VeraBd.ttf"
|
||||
color: [40,40,40,1.0]
|
||||
- text: "side-right"
|
||||
origin: 240 240
|
||||
size: 32
|
||||
color: [190,180,200,1.0]
|
||||
transpose: true
|
||||
flip-y: true
|
||||
font: "FreeSans.ttf"
|
||||
|
|
@ -0,0 +1,385 @@
|
|||
root:
|
||||
items:
|
||||
- type: "stacking-context"
|
||||
transform: scale(0.5)
|
||||
items:
|
||||
- type: "stacking-context"
|
||||
perspective: 100
|
||||
perspective-origin: 100 50
|
||||
items:
|
||||
- image: checkerboard(0, 128, 16);
|
||||
bounds: [400, 400, 2048, 2048]
|
||||
- type: rect
|
||||
color: [180, 140, 120, 0.4]
|
||||
bounds: 600 600 2048 2048
|
||||
- type: "stacking-context"
|
||||
bounds: [0, 0, 2048, 2048]
|
||||
filters: [invert(1)]
|
||||
mix-blend-mode: exclusion
|
||||
complex-clip:
|
||||
rect: [480, 480, 1024, 1024]
|
||||
radius: [512, 512]
|
||||
items:
|
||||
- type: "stacking-context"
|
||||
transform: scale(6)
|
||||
items:
|
||||
- type: line
|
||||
baseline: 16
|
||||
start: 16
|
||||
end: 208
|
||||
width: 1
|
||||
orientation: horizontal
|
||||
color: black
|
||||
style: solid
|
||||
- type: line
|
||||
baseline: 24
|
||||
start: 16
|
||||
end: 208
|
||||
width: 1
|
||||
orientation: horizontal
|
||||
color: blue
|
||||
style: dashed
|
||||
- type: line
|
||||
baseline: 32
|
||||
start: 16
|
||||
end: 208
|
||||
width: 1
|
||||
orientation: horizontal
|
||||
color: green
|
||||
style: dotted
|
||||
- type: line
|
||||
baseline: 40
|
||||
start: 16
|
||||
end: 208
|
||||
width: 4
|
||||
thickness: 1
|
||||
orientation: horizontal
|
||||
color: red
|
||||
style: wavy
|
||||
|
||||
- type: line
|
||||
baseline: 48
|
||||
start: 16
|
||||
end: 208
|
||||
width: 2
|
||||
orientation: horizontal
|
||||
color: black
|
||||
style: solid
|
||||
- type: line
|
||||
baseline: 64
|
||||
start: 16
|
||||
end: 208
|
||||
width: 2
|
||||
orientation: horizontal
|
||||
color: blue
|
||||
style: dashed
|
||||
- type: line
|
||||
baseline: 80
|
||||
start: 16
|
||||
end: 207 # pruposefully cut off
|
||||
width: 2
|
||||
orientation: horizontal
|
||||
color: green
|
||||
style: dotted
|
||||
- type: line
|
||||
baseline: 96
|
||||
start: 16
|
||||
end: 208
|
||||
width: 6
|
||||
thickness: 2
|
||||
orientation: horizontal
|
||||
color: red
|
||||
style: wavy
|
||||
|
||||
-
|
||||
type: "shadow"
|
||||
bounds: [8, 100, 225, 50]
|
||||
blur-radius: 0
|
||||
offset: [2, 2]
|
||||
color: red
|
||||
- type: line
|
||||
baseline: 112
|
||||
start: 16
|
||||
end: 208
|
||||
width: 1
|
||||
orientation: horizontal
|
||||
color: [0,0,0,0]
|
||||
style: solid
|
||||
- type: line
|
||||
baseline: 120
|
||||
start: 16
|
||||
end: 208
|
||||
width: 1
|
||||
orientation: horizontal
|
||||
color: [0,0,0,0]
|
||||
style: dashed
|
||||
- type: line
|
||||
baseline: 128
|
||||
start: 16
|
||||
end: 209
|
||||
width: 1
|
||||
orientation: horizontal
|
||||
color: [0,0,0,0]
|
||||
style: dotted
|
||||
- type: line
|
||||
baseline: 136
|
||||
start: 16
|
||||
end: 208
|
||||
width: 4
|
||||
thickness: 1
|
||||
orientation: horizontal
|
||||
color: [0,0,0,0]
|
||||
style: wavy
|
||||
-
|
||||
type: pop-all-shadows
|
||||
|
||||
-
|
||||
type: "shadow"
|
||||
bounds: [8, 145, 225, 65]
|
||||
blur-radius: 1
|
||||
offset: [2, 3]
|
||||
color: red
|
||||
- type: line
|
||||
baseline: 160
|
||||
start: 16
|
||||
end: 208
|
||||
width: 2
|
||||
orientation: horizontal
|
||||
color: black
|
||||
style: solid
|
||||
- type: line
|
||||
baseline: 168
|
||||
start: 16
|
||||
end: 208
|
||||
width: 2
|
||||
orientation: horizontal
|
||||
color: blue
|
||||
style: dashed
|
||||
- type: line
|
||||
baseline: 184
|
||||
start: 16
|
||||
end: 207 # purposefully cut off
|
||||
width: 2
|
||||
orientation: horizontal
|
||||
color: green
|
||||
style: dotted
|
||||
- type: line
|
||||
baseline: 192
|
||||
start: 16
|
||||
end: 208
|
||||
width: 6
|
||||
thickness: 2
|
||||
orientation: horizontal
|
||||
color: red
|
||||
style: wavy
|
||||
-
|
||||
type: pop-all-shadows
|
||||
|
||||
-
|
||||
type: "shadow"
|
||||
bounds: [8, 220, 225, 40]
|
||||
blur-radius: 0
|
||||
offset: [5, 7]
|
||||
color: red
|
||||
- type: line
|
||||
baseline: 232
|
||||
start: 16
|
||||
end: 208
|
||||
width: 8
|
||||
orientation: horizontal
|
||||
color: black
|
||||
style: solid
|
||||
- type: line
|
||||
baseline: 248
|
||||
start: 16
|
||||
end: 208
|
||||
width: 8
|
||||
orientation: horizontal
|
||||
color: blue
|
||||
style: dashed
|
||||
- type: line
|
||||
baseline: 272
|
||||
start: 16
|
||||
end: 205 # purposefully cut off
|
||||
width: 8
|
||||
orientation: horizontal
|
||||
color: green
|
||||
style: dotted
|
||||
- type: line
|
||||
baseline: 296
|
||||
start: 16
|
||||
end: 208
|
||||
width: 12
|
||||
thickness: 3
|
||||
orientation: horizontal
|
||||
color: black
|
||||
style: wavy
|
||||
-
|
||||
type: "pop-all-shadows"
|
||||
|
||||
-
|
||||
type: "shadow"
|
||||
bounds: [0, 320, 240, 140]
|
||||
blur-radius: 3
|
||||
offset: [5, 7]
|
||||
color: red
|
||||
- type: line
|
||||
baseline: 320
|
||||
start: 16
|
||||
end: 208
|
||||
width: 8
|
||||
orientation: horizontal
|
||||
color: black
|
||||
style: solid
|
||||
- type: line
|
||||
baseline: 352
|
||||
start: 16
|
||||
end: 208
|
||||
width: 8
|
||||
orientation: horizontal
|
||||
color: blue
|
||||
style: dashed
|
||||
- type: line
|
||||
baseline: 368
|
||||
start: 16
|
||||
end: 205 # purposefully cut off
|
||||
width: 8
|
||||
orientation: horizontal
|
||||
color: green
|
||||
style: dotted
|
||||
- type: line
|
||||
baseline: 392
|
||||
start: 16
|
||||
end: 208
|
||||
width: 16
|
||||
thickness: 4
|
||||
orientation: horizontal
|
||||
color: black
|
||||
style: wavy
|
||||
-
|
||||
type: "pop-all-shadows"
|
||||
|
||||
- type: line
|
||||
baseline: 224
|
||||
start: 16
|
||||
end: 208
|
||||
width: 1
|
||||
orientation: vertical
|
||||
color: black
|
||||
style: solid
|
||||
- type: line
|
||||
baseline: 232
|
||||
start: 16
|
||||
end: 208
|
||||
width: 1
|
||||
orientation: vertical
|
||||
color: blue
|
||||
style: dashed
|
||||
- type: line
|
||||
baseline: 240
|
||||
start: 16
|
||||
end: 208
|
||||
width: 1
|
||||
orientation: vertical
|
||||
color: green
|
||||
style: dotted
|
||||
- type: line
|
||||
baseline: 256
|
||||
start: 16
|
||||
end: 208
|
||||
thickness: 1
|
||||
width: 4
|
||||
orientation: vertical
|
||||
color: red
|
||||
style: wavy
|
||||
|
||||
- type: line
|
||||
baseline: 272
|
||||
start: 16
|
||||
end: 208
|
||||
width: 2
|
||||
orientation: vertical
|
||||
color: black
|
||||
style: solid
|
||||
- type: line
|
||||
baseline: 296
|
||||
start: 16
|
||||
end: 208
|
||||
width: 2
|
||||
orientation: vertical
|
||||
color: blue
|
||||
style: dashed
|
||||
- type: line
|
||||
baseline: 320
|
||||
start: 16
|
||||
end: 207 # purposefully cut off
|
||||
width: 2
|
||||
orientation: vertical
|
||||
color: green
|
||||
style: dotted
|
||||
- type: line
|
||||
baseline: 336
|
||||
start: 16
|
||||
end: 208
|
||||
thickness: 2
|
||||
width: 6
|
||||
orientation: vertical
|
||||
color: red
|
||||
style: wavy
|
||||
|
||||
-
|
||||
type: "shadow"
|
||||
bounds: [350, 0, 120, 240]
|
||||
blur-radius: 3
|
||||
offset: [5, 2]
|
||||
color: black
|
||||
- type: line
|
||||
baseline: 384
|
||||
start: 16
|
||||
end: 208
|
||||
width: 8
|
||||
orientation: vertical
|
||||
color: yellow
|
||||
style: solid
|
||||
- type: line
|
||||
baseline: 400
|
||||
start: 16
|
||||
end: 208
|
||||
width: 8
|
||||
orientation: vertical
|
||||
color: blue
|
||||
style: dashed
|
||||
- type: line
|
||||
baseline: 416
|
||||
start: 16
|
||||
end: 205 # purposefully cut off
|
||||
width: 8
|
||||
orientation: vertical
|
||||
color: green
|
||||
style: dotted
|
||||
- type: line
|
||||
baseline: 440
|
||||
start: 16
|
||||
end: 208
|
||||
thickness: 4
|
||||
width: 16
|
||||
orientation: vertical
|
||||
color: red
|
||||
style: wavy
|
||||
-
|
||||
type: "pop-all-shadows"
|
||||
- text: "side-left"
|
||||
origin: 80 120
|
||||
size: 32
|
||||
transpose: true
|
||||
flip-x: true
|
||||
font: "VeraBd.ttf"
|
||||
color: [40,40,40,1.0]
|
||||
- text: "side-right"
|
||||
origin: 240 240
|
||||
size: 32
|
||||
color: [190,180,200,1.0]
|
||||
transpose: true
|
||||
flip-y: true
|
||||
font: "FreeSans.ttf"
|
||||
|
|
@ -75,3 +75,9 @@ fuzzy(1,39) options(disable-subpixel) == raster-space-snap.yaml raster-space-sna
|
|||
# == intermediate-transform.yaml intermediate-transform-ref.yaml # fails because of AA inavailable with an intermediate surface
|
||||
platform(linux) allow_sacrificing_subpixel_aa(false) == text-fixed-slice.yaml text-fixed-slice-slow.png
|
||||
platform(linux) allow_sacrificing_subpixel_aa(true) == text-fixed-slice.yaml text-fixed-slice-fast.png
|
||||
|
||||
# a 8544×8544 raster root vs. 2136×2136
|
||||
# most pixels are off by a small amount, but a few pixels on the edge vary by a lot, pushing up the fuzzy max-diff;
|
||||
# the main goal of the test is that everything is in the same place, at the same scale, clipped the same way,
|
||||
# despite 4x on-the-fly scale change.
|
||||
skip_on(android) fuzzy(115,23498) == raster_root_C_8192.yaml raster_root_C_ref.yaml
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
root:
|
||||
items:
|
||||
- type: "stacking-context"
|
||||
transform: scale(0.125)
|
||||
items:
|
||||
- type: "stacking-context"
|
||||
perspective: 100
|
||||
perspective-origin: 100 50
|
||||
items:
|
||||
- image: checkerboard(0, 512, 16);
|
||||
bounds: [1600, 1600, 8192, 8192]
|
||||
- type: "stacking-context"
|
||||
bounds: [0, 0, 8192, 8192]
|
||||
mix-blend-mode: difference
|
||||
complex-clip:
|
||||
rect: [2048, 2048, 4096, 4096]
|
||||
radius: [1024, 1024]
|
||||
items:
|
||||
- image: checkerboard(0, 4096, 2);
|
||||
bounds: [0, 0, 8192, 8192]
|
|
@ -0,0 +1,20 @@
|
|||
root:
|
||||
items:
|
||||
- type: "stacking-context"
|
||||
transform: scale(0.5)
|
||||
items:
|
||||
- type: "stacking-context"
|
||||
perspective: 100
|
||||
perspective-origin: 100 50
|
||||
items:
|
||||
- image: checkerboard(0, 128, 16);
|
||||
bounds: 400 400 2048 2048
|
||||
- type: "stacking-context"
|
||||
bounds: [0, 0, 2048, 2048]
|
||||
mix-blend-mode: difference
|
||||
complex-clip:
|
||||
rect: [512, 512, 1024, 1024]
|
||||
radius: [256, 256]
|
||||
items:
|
||||
- image: checkerboard(0, 1024, 2);
|
||||
bounds: [0, 0, 2048, 2048]
|
|
@ -0,0 +1,14 @@
|
|||
root:
|
||||
items:
|
||||
- type: stacking-context
|
||||
bounds: [0, 0, 600, 600]
|
||||
perspective: 100
|
||||
items:
|
||||
- type: stacking-context
|
||||
transform: rotate-z(20) rotate-x(60)
|
||||
filters: [invert(1)]
|
||||
mix-blend-mode: difference
|
||||
items:
|
||||
- type: rect
|
||||
bounds: [0, 0, 20000, 100]
|
||||
color: [20, 120, 18, 1.0]
|
|
@ -0,0 +1,14 @@
|
|||
root:
|
||||
items:
|
||||
- type: stacking-context
|
||||
bounds: [0, 0, 600, 600]
|
||||
perspective: 100
|
||||
items:
|
||||
- type: stacking-context
|
||||
transform: rotate-z(20) rotate-x(60)
|
||||
filters: [invert(1)]
|
||||
mix-blend-mode: difference
|
||||
items:
|
||||
- type: rect
|
||||
bounds: [0, 0, 4000, 100]
|
||||
color: [20, 120, 18, 1.0]
|
|
@ -42,3 +42,8 @@ platform(linux,mac) fuzzy(1,74) == border-scale-4.yaml border-scale-4.png
|
|||
== flatten-twice.yaml flatten-twice-ref.yaml
|
||||
== strange-w.yaml strange-w-ref.yaml
|
||||
== big-axis-aligned-scale.yaml big-axis-aligned-scale-ref.yaml
|
||||
# Compare ~8K raster root (>MAX_SURFACE_SIZE) with ~2K raster root. fuzzy due to lerping on edges.
|
||||
skip_on(android) fuzzy(93,3692) == raster_root_A_8192.yaml raster_root_A_ref.yaml
|
||||
# Same as large-raster-root.yaml but resulting in a 10302×100 raster root (= >4096) vs 4000x100 in ref:
|
||||
skip_on(android) fuzzy(29,333) == raster_root_B_8192.yaml raster_root_B_ref.yaml
|
||||
|
||||
|
|
|
@ -686,6 +686,8 @@ pref("gfx.webrender.debug.primitives", false);
|
|||
pref("gfx.webrender.debug.small-screen", false);
|
||||
pref("gfx.webrender.debug.obscure-images", false);
|
||||
pref("gfx.webrender.debug.glyph-flashing", false);
|
||||
pref("gfx.webrender.debug.disable-raster-root-scale", false);
|
||||
|
||||
|
||||
pref("accessibility.warn_on_browsewithcaret", true);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче