Bug 1535976 - Add a fast path for common rounded rect clips to WR. r=kvark
Most rounded rect clips in real content are (a) axis aligned and (b) have uniform radii. When these conditions are met, we can run a fast path for clip mask generation that uses significantly fewer ALU shader ops. This is not typically a bottleneck on desktop GPUs, but can have a large performance impact on mobile GPUs (and perhaps low end integrated GPUs). The Mali shader analyzer reports the slow path for the rounded rect clip shader to be 94 cycles per fragment, while the fast path is 10 cycles. Differential Revision: https://phabricator.services.mozilla.com/D23817 --HG-- extra : moz-landing-system : lando
|
@ -4,12 +4,17 @@
|
|||
|
||||
#include shared,clip_shared,ellipse
|
||||
|
||||
#ifdef WR_FEATURE_FAST_PATH
|
||||
varying vec2 vLocalPos;
|
||||
flat varying vec3 vClipParams; // xy = box size, z = radius
|
||||
#else
|
||||
varying vec3 vLocalPos;
|
||||
flat varying float vClipMode;
|
||||
flat varying vec4 vClipCenter_Radius_TL;
|
||||
flat varying vec4 vClipCenter_Radius_TR;
|
||||
flat varying vec4 vClipCenter_Radius_BL;
|
||||
flat varying vec4 vClipCenter_Radius_BR;
|
||||
#endif
|
||||
|
||||
#ifdef WR_VERTEX_SHADER
|
||||
struct ClipRect {
|
||||
|
@ -77,6 +82,15 @@ void main(void) {
|
|||
cmi.device_pixel_scale
|
||||
);
|
||||
|
||||
#ifdef WR_FEATURE_FAST_PATH
|
||||
// If the radii are all uniform, we can use a much simpler 2d
|
||||
// signed distance function to get a rounded rect clip.
|
||||
vec2 half_size = 0.5 * local_rect.size;
|
||||
float radius = clip.top_left.outer_inner_radius.x;
|
||||
vLocalPos = vi.local_pos.xy - half_size - cmi.local_pos;
|
||||
vClipParams.xy = half_size - vec2(radius);
|
||||
vClipParams.z = radius;
|
||||
#else
|
||||
vLocalPos = vi.local_pos;
|
||||
vClipMode = clip.rect.mode.x;
|
||||
|
||||
|
@ -98,17 +112,35 @@ void main(void) {
|
|||
vClipCenter_Radius_BL = vec4(clip_rect.p0.x + r_bl.x,
|
||||
clip_rect.p1.y - r_bl.y,
|
||||
r_bl);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef WR_FRAGMENT_SHADER
|
||||
void main(void) {
|
||||
vec2 local_pos = vLocalPos.xy / vLocalPos.z;
|
||||
|
||||
float alpha = init_transform_fs(local_pos.xy);
|
||||
#ifdef WR_FEATURE_FAST_PATH
|
||||
// See http://www.iquilezles.org/www/articles/distfunctions2d/distfunctions2d.htm
|
||||
float sdf_rounded_rect(vec2 pos, vec3 clip_params) {
|
||||
return length(max(abs(pos) - clip_params.xy, 0.0)) - clip_params.z;
|
||||
}
|
||||
#endif
|
||||
|
||||
void main(void) {
|
||||
#ifdef WR_FEATURE_FAST_PATH
|
||||
vec2 local_pos = vLocalPos.xy;
|
||||
#else
|
||||
vec2 local_pos = vLocalPos.xy / vLocalPos.z;
|
||||
#endif
|
||||
|
||||
float aa_range = compute_aa_range(local_pos.xy);
|
||||
|
||||
#ifdef WR_FEATURE_FAST_PATH
|
||||
float d = sdf_rounded_rect(local_pos, vClipParams);
|
||||
float f = distance_aa(aa_range, d);
|
||||
oFragColor = vec4(f);
|
||||
#else
|
||||
float alpha = init_transform_fs(local_pos.xy);
|
||||
|
||||
float clip_alpha = rounded_rect(local_pos.xy,
|
||||
vClipCenter_Radius_TL,
|
||||
vClipCenter_Radius_TR,
|
||||
|
@ -122,5 +154,6 @@ void main(void) {
|
|||
float final_alpha = mix(combined_alpha, 1.0 - combined_alpha, vClipMode);
|
||||
|
||||
oFragColor = vec4(final_alpha, 0.0, 0.0, 1.0);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -2660,7 +2660,8 @@ pub fn resolve_image(
|
|||
#[cfg_attr(feature = "replay", derive(Deserialize))]
|
||||
pub struct ClipBatchList {
|
||||
/// Rectangle draws fill up the rectangles with rounded corners.
|
||||
pub rectangles: Vec<ClipMaskInstance>,
|
||||
pub slow_rectangles: Vec<ClipMaskInstance>,
|
||||
pub fast_rectangles: Vec<ClipMaskInstance>,
|
||||
/// Image draws apply the image masking.
|
||||
pub images: FastHashMap<TextureSource, Vec<ClipMaskInstance>>,
|
||||
pub box_shadows: FastHashMap<TextureSource, Vec<ClipMaskInstance>>,
|
||||
|
@ -2669,7 +2670,8 @@ pub struct ClipBatchList {
|
|||
impl ClipBatchList {
|
||||
fn new() -> Self {
|
||||
ClipBatchList {
|
||||
rectangles: Vec::new(),
|
||||
slow_rectangles: Vec::new(),
|
||||
fast_rectangles: Vec::new(),
|
||||
images: FastHashMap::default(),
|
||||
box_shadows: FastHashMap::default(),
|
||||
}
|
||||
|
@ -2726,7 +2728,7 @@ impl ClipBatcher {
|
|||
device_pixel_scale,
|
||||
};
|
||||
|
||||
self.primary_clips.rectangles.push(instance);
|
||||
self.primary_clips.slow_rectangles.push(instance);
|
||||
}
|
||||
|
||||
/// Where appropriate, draw a clip rectangle as a small series of tiles,
|
||||
|
@ -2808,7 +2810,7 @@ impl ClipBatcher {
|
|||
// these pixels would be redundant - since this clip can't possibly
|
||||
// affect the pixels in this tile, skip them!
|
||||
if !world_device_rect.contains_rect(&world_sub_rect) {
|
||||
clip_list.rectangles.push(ClipMaskInstance {
|
||||
clip_list.slow_rectangles.push(ClipMaskInstance {
|
||||
clip_data_address: gpu_address,
|
||||
sub_rect: normalized_sub_rect,
|
||||
..*instance
|
||||
|
@ -2964,7 +2966,7 @@ impl ClipBatcher {
|
|||
let gpu_address =
|
||||
gpu_cache.get_address(&clip_node.gpu_cache_handle);
|
||||
self.get_batch_list(is_first_clip)
|
||||
.rectangles
|
||||
.slow_rectangles
|
||||
.push(ClipMaskInstance {
|
||||
clip_data_address: gpu_address,
|
||||
..instance
|
||||
|
@ -2990,7 +2992,7 @@ impl ClipBatcher {
|
|||
is_first_clip,
|
||||
) {
|
||||
self.get_batch_list(is_first_clip)
|
||||
.rectangles
|
||||
.slow_rectangles
|
||||
.push(ClipMaskInstance {
|
||||
clip_data_address: gpu_address,
|
||||
..instance
|
||||
|
@ -3003,12 +3005,16 @@ impl ClipBatcher {
|
|||
ClipItem::RoundedRectangle(..) => {
|
||||
let gpu_address =
|
||||
gpu_cache.get_address(&clip_node.gpu_cache_handle);
|
||||
self.get_batch_list(is_first_clip)
|
||||
.rectangles
|
||||
.push(ClipMaskInstance {
|
||||
clip_data_address: gpu_address,
|
||||
..instance
|
||||
});
|
||||
let batch_list = self.get_batch_list(is_first_clip);
|
||||
let instance = ClipMaskInstance {
|
||||
clip_data_address: gpu_address,
|
||||
..instance
|
||||
};
|
||||
if clip_instance.flags.contains(ClipNodeFlags::USE_FAST_PATH) {
|
||||
batch_list.fast_rectangles.push(instance);
|
||||
} else {
|
||||
batch_list.slow_rectangles.push(instance);
|
||||
}
|
||||
|
||||
true
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ use api::{BoxShadowClipMode, ImageKey, ImageRendering};
|
|||
use api::units::*;
|
||||
use border::{ensure_no_corner_overlap, BorderRadiusAu};
|
||||
use box_shadow::{BLUR_SAMPLE_SCALE, BoxShadowClipSource, BoxShadowCacheKey};
|
||||
use clip_scroll_tree::{ClipScrollTree, SpatialNodeIndex};
|
||||
use clip_scroll_tree::{CoordinateSystemId, ClipScrollTree, SpatialNodeIndex};
|
||||
use ellipse::Ellipse;
|
||||
use gpu_cache::{GpuCache, GpuCacheHandle, ToGpuBlocks};
|
||||
use gpu_types::{BoxShadowStretchMode};
|
||||
|
@ -180,6 +180,7 @@ bitflags! {
|
|||
pub struct ClipNodeFlags: u8 {
|
||||
const SAME_SPATIAL_NODE = 0x1;
|
||||
const SAME_COORD_SYSTEM = 0x2;
|
||||
const USE_FAST_PATH = 0x4;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -269,10 +270,11 @@ impl ClipNodeInfo {
|
|||
clipped_rect: &LayoutRect,
|
||||
gpu_cache: &mut GpuCache,
|
||||
resource_cache: &mut ResourceCache,
|
||||
clip_scroll_tree: &ClipScrollTree,
|
||||
) -> ClipNodeInstance {
|
||||
// Calculate some flags that are required for the segment
|
||||
// building logic.
|
||||
let flags = match self.conversion {
|
||||
let mut flags = match self.conversion {
|
||||
ClipSpaceConversion::Local => {
|
||||
ClipNodeFlags::SAME_SPATIAL_NODE | ClipNodeFlags::SAME_COORD_SYSTEM
|
||||
}
|
||||
|
@ -284,6 +286,19 @@ impl ClipNodeInfo {
|
|||
}
|
||||
};
|
||||
|
||||
// Some clip shaders support a fast path mode for simple clips.
|
||||
// For now, the fast path is only selected if:
|
||||
// - The clip item content supports fast path
|
||||
// - Both clip and primitive are in the root coordinate system (no need for AA along edges)
|
||||
// TODO(gw): We could also apply fast path when segments are created, since we only write
|
||||
// the mask for a single corner at a time then, so can always consider radii uniform.
|
||||
let clip_spatial_node = &clip_scroll_tree.spatial_nodes[self.spatial_node_index.0 as usize];
|
||||
if clip_spatial_node.coordinate_system_id == CoordinateSystemId::root() &&
|
||||
flags.contains(ClipNodeFlags::SAME_COORD_SYSTEM) &&
|
||||
node.item.supports_fast_path_rendering() {
|
||||
flags |= ClipNodeFlags::USE_FAST_PATH;
|
||||
}
|
||||
|
||||
let mut visible_tiles = None;
|
||||
|
||||
if let ClipItem::Image { size, image, repeat } = node.item {
|
||||
|
@ -664,6 +679,7 @@ impl ClipStore {
|
|||
&local_bounding_rect,
|
||||
gpu_cache,
|
||||
resource_cache,
|
||||
clip_scroll_tree,
|
||||
);
|
||||
|
||||
// As a special case, a partial accept of a clip rect that is
|
||||
|
@ -1020,6 +1036,24 @@ impl ClipItem {
|
|||
ClipItem::BoxShadow(source)
|
||||
}
|
||||
|
||||
/// Returns true if this clip mask can run through the fast path
|
||||
/// for the given clip item type.
|
||||
fn supports_fast_path_rendering(&self) -> bool {
|
||||
match *self {
|
||||
ClipItem::Rectangle(..) |
|
||||
ClipItem::RoundedRectangle(_, _, ClipMode::ClipOut) |
|
||||
ClipItem::Image { .. } |
|
||||
ClipItem::BoxShadow(..) => {
|
||||
false
|
||||
}
|
||||
ClipItem::RoundedRectangle(_, ref radius, ClipMode::Clip) => {
|
||||
// The rounded clip rect fast path shader can only work
|
||||
// if the radii are uniform.
|
||||
radius.is_uniform().is_some()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Get an optional clip rect that a clip source can provide to
|
||||
// reduce the size of a primitive region. This is typically
|
||||
// used to eliminate redundant clips, and reduce the size of
|
||||
|
|
|
@ -2382,13 +2382,23 @@ impl Renderer {
|
|||
);
|
||||
debug_target.add(
|
||||
debug_server::BatchKind::Clip,
|
||||
"Rectangles [p]",
|
||||
target.clip_batcher.primary_clips.rectangles.len(),
|
||||
"Slow Rectangles [p]",
|
||||
target.clip_batcher.primary_clips.slow_rectangles.len(),
|
||||
);
|
||||
debug_target.add(
|
||||
debug_server::BatchKind::Clip,
|
||||
"Rectangles [s]",
|
||||
target.clip_batcher.secondary_clips.rectangles.len(),
|
||||
"Fast Rectangles [p]",
|
||||
target.clip_batcher.primary_clips.fast_rectangles.len(),
|
||||
);
|
||||
debug_target.add(
|
||||
debug_server::BatchKind::Clip,
|
||||
"Slow Rectangles [s]",
|
||||
target.clip_batcher.secondary_clips.slow_rectangles.len(),
|
||||
);
|
||||
debug_target.add(
|
||||
debug_server::BatchKind::Clip,
|
||||
"Fast Rectangles [s]",
|
||||
target.clip_batcher.secondary_clips.fast_rectangles.len(),
|
||||
);
|
||||
for (_, items) in target.clip_batcher.primary_clips.images.iter() {
|
||||
debug_target.add(debug_server::BatchKind::Clip, "Image mask [p]", items.len());
|
||||
|
@ -3712,15 +3722,29 @@ impl Renderer {
|
|||
stats: &mut RendererStats,
|
||||
) {
|
||||
// draw rounded cornered rectangles
|
||||
if !list.rectangles.is_empty() {
|
||||
let _gm2 = self.gpu_profile.start_marker("clip rectangles");
|
||||
self.shaders.borrow_mut().cs_clip_rectangle.bind(
|
||||
if !list.slow_rectangles.is_empty() {
|
||||
let _gm2 = self.gpu_profile.start_marker("slow clip rectangles");
|
||||
self.shaders.borrow_mut().cs_clip_rectangle_slow.bind(
|
||||
&mut self.device,
|
||||
projection,
|
||||
&mut self.renderer_errors,
|
||||
);
|
||||
self.draw_instanced_batch(
|
||||
&list.rectangles,
|
||||
&list.slow_rectangles,
|
||||
VertexArrayKind::Clip,
|
||||
&BatchTextures::no_texture(),
|
||||
stats,
|
||||
);
|
||||
}
|
||||
if !list.fast_rectangles.is_empty() {
|
||||
let _gm2 = self.gpu_profile.start_marker("fast clip rectangles");
|
||||
self.shaders.borrow_mut().cs_clip_rectangle_fast.bind(
|
||||
&mut self.device,
|
||||
projection,
|
||||
&mut self.renderer_errors,
|
||||
);
|
||||
self.draw_instanced_batch(
|
||||
&list.fast_rectangles,
|
||||
VertexArrayKind::Clip,
|
||||
&BatchTextures::no_texture(),
|
||||
stats,
|
||||
|
|
|
@ -51,6 +51,7 @@ const ALPHA_FEATURE: &str = "ALPHA_PASS";
|
|||
const DEBUG_OVERDRAW_FEATURE: &str = "DEBUG_OVERDRAW";
|
||||
const DITHERING_FEATURE: &str = "DITHERING";
|
||||
const DUAL_SOURCE_FEATURE: &str = "DUAL_SOURCE_BLENDING";
|
||||
const FAST_PATH_FEATURE: &str = "FAST_PATH";
|
||||
|
||||
pub(crate) enum ShaderKind {
|
||||
Primitive,
|
||||
|
@ -125,27 +126,39 @@ impl LazilyCompiledShader {
|
|||
if self.program.is_none() {
|
||||
let program = match self.kind {
|
||||
ShaderKind::Primitive | ShaderKind::Brush | ShaderKind::Text => {
|
||||
create_prim_shader(self.name,
|
||||
device,
|
||||
&self.features)
|
||||
create_prim_shader(
|
||||
self.name,
|
||||
device,
|
||||
&self.features,
|
||||
)
|
||||
}
|
||||
ShaderKind::Cache(..) => {
|
||||
create_prim_shader(self.name,
|
||||
device,
|
||||
&self.features)
|
||||
create_prim_shader(
|
||||
self.name,
|
||||
device,
|
||||
&self.features,
|
||||
)
|
||||
}
|
||||
ShaderKind::VectorStencil => {
|
||||
create_prim_shader(self.name,
|
||||
device,
|
||||
&self.features)
|
||||
create_prim_shader(
|
||||
self.name,
|
||||
device,
|
||||
&self.features,
|
||||
)
|
||||
}
|
||||
ShaderKind::VectorCover => {
|
||||
create_prim_shader(self.name,
|
||||
device,
|
||||
&self.features)
|
||||
create_prim_shader(
|
||||
self.name,
|
||||
device,
|
||||
&self.features,
|
||||
)
|
||||
}
|
||||
ShaderKind::ClipCache => {
|
||||
create_clip_shader(self.name, device)
|
||||
create_clip_shader(
|
||||
self.name,
|
||||
device,
|
||||
&self.features,
|
||||
)
|
||||
}
|
||||
};
|
||||
self.program = Some(program?);
|
||||
|
@ -424,12 +437,20 @@ fn create_prim_shader(
|
|||
device.create_program(name, prefix)
|
||||
}
|
||||
|
||||
fn create_clip_shader(name: &'static str, device: &mut Device) -> Result<Program, ShaderError> {
|
||||
let prefix = format!(
|
||||
fn create_clip_shader(
|
||||
name: &'static str,
|
||||
device: &mut Device,
|
||||
features: &[&'static str],
|
||||
) -> Result<Program, ShaderError> {
|
||||
let mut prefix = format!(
|
||||
"#define WR_MAX_VERTEX_TEXTURE_WIDTH {}U\n",
|
||||
MAX_VERTEX_TEXTURE_WIDTH
|
||||
);
|
||||
|
||||
for feature in features {
|
||||
prefix.push_str(&format!("#define WR_FEATURE_{}\n", feature));
|
||||
}
|
||||
|
||||
debug!("ClipShader {}", name);
|
||||
|
||||
device.create_program(name, prefix)
|
||||
|
@ -462,7 +483,8 @@ pub struct Shaders {
|
|||
/// These are "cache clip shaders". These shaders are used to
|
||||
/// draw clip instances into the cached clip mask. The results
|
||||
/// of these shaders are also used by the primitive shaders.
|
||||
pub cs_clip_rectangle: LazilyCompiledShader,
|
||||
pub cs_clip_rectangle_slow: LazilyCompiledShader,
|
||||
pub cs_clip_rectangle_fast: LazilyCompiledShader,
|
||||
pub cs_clip_box_shadow: LazilyCompiledShader,
|
||||
pub cs_clip_image: LazilyCompiledShader,
|
||||
|
||||
|
@ -549,7 +571,7 @@ impl Shaders {
|
|||
options.precache_flags,
|
||||
)?;
|
||||
|
||||
let cs_clip_rectangle = LazilyCompiledShader::new(
|
||||
let cs_clip_rectangle_slow = LazilyCompiledShader::new(
|
||||
ShaderKind::ClipCache,
|
||||
"cs_clip_rectangle",
|
||||
&[],
|
||||
|
@ -557,6 +579,14 @@ impl Shaders {
|
|||
options.precache_flags,
|
||||
)?;
|
||||
|
||||
let cs_clip_rectangle_fast = LazilyCompiledShader::new(
|
||||
ShaderKind::ClipCache,
|
||||
"cs_clip_rectangle",
|
||||
&[FAST_PATH_FEATURE],
|
||||
device,
|
||||
options.precache_flags,
|
||||
)?;
|
||||
|
||||
let cs_clip_box_shadow = LazilyCompiledShader::new(
|
||||
ShaderKind::ClipCache,
|
||||
"cs_clip_box_shadow",
|
||||
|
@ -717,7 +747,8 @@ impl Shaders {
|
|||
brush_yuv_image,
|
||||
brush_radial_gradient,
|
||||
brush_linear_gradient,
|
||||
cs_clip_rectangle,
|
||||
cs_clip_rectangle_slow,
|
||||
cs_clip_rectangle_fast,
|
||||
cs_clip_box_shadow,
|
||||
cs_clip_image,
|
||||
ps_text_run,
|
||||
|
@ -787,7 +818,8 @@ impl Shaders {
|
|||
self.brush_mix_blend.deinit(device);
|
||||
self.brush_radial_gradient.deinit(device);
|
||||
self.brush_linear_gradient.deinit(device);
|
||||
self.cs_clip_rectangle.deinit(device);
|
||||
self.cs_clip_rectangle_slow.deinit(device);
|
||||
self.cs_clip_rectangle_fast.deinit(device);
|
||||
self.cs_clip_box_shadow.deinit(device);
|
||||
self.cs_clip_image.deinit(device);
|
||||
self.ps_text_run.deinit(device);
|
||||
|
|
|
@ -20,6 +20,7 @@ const SHADER_PREFIX: &str = "#define WR_MAX_VERTEX_TEXTURE_WIDTH 1024U\n";
|
|||
|
||||
const BRUSH_FEATURES: &[&str] = &["", "ALPHA_PASS"];
|
||||
const CLIP_FEATURES: &[&str] = &[""];
|
||||
const FAST_CLIP_FEATURES: &[&str] = &["FAST_PATH"];
|
||||
const CACHE_FEATURES: &[&str] = &[""];
|
||||
const GRADIENT_FEATURES: &[&str] = &[ "", "DITHERING", "ALPHA_PASS", "DITHERING,ALPHA_PASS" ];
|
||||
const PRIM_FEATURES: &[&str] = &[""];
|
||||
|
@ -30,6 +31,10 @@ const SHADERS: &[Shader] = &[
|
|||
name: "cs_clip_rectangle",
|
||||
features: CLIP_FEATURES,
|
||||
},
|
||||
Shader {
|
||||
name: "cs_clip_rectangle",
|
||||
features: FAST_CLIP_FEATURES,
|
||||
},
|
||||
Shader {
|
||||
name: "cs_clip_image",
|
||||
features: CLIP_FEATURES,
|
||||
|
|
Двоичные данные
gfx/wr/wrench/reftests/aa/rounded-rects-ref.png
До Ширина: | Высота: | Размер: 7.7 KiB После Ширина: | Высота: | Размер: 11 KiB |
Двоичные данные
gfx/wr/wrench/reftests/border/degenerate-curve.png
До Ширина: | Высота: | Размер: 21 KiB После Ширина: | Высота: | Размер: 21 KiB |
Двоичные данные
gfx/wr/wrench/reftests/boxshadow/box-shadow-spread.png
До Ширина: | Высота: | Размер: 7.4 KiB После Ширина: | Высота: | Размер: 7.4 KiB |
Двоичные данные
gfx/wr/wrench/reftests/boxshadow/box-shadow-stretch-mode-y.png
До Ширина: | Высота: | Размер: 6.1 KiB После Ширина: | Высота: | Размер: 6.1 KiB |
Двоичные данные
gfx/wr/wrench/reftests/boxshadow/box-shadow-suite-blur.png
До Ширина: | Высота: | Размер: 84 KiB После Ширина: | Высота: | Размер: 84 KiB |
Двоичные данные
gfx/wr/wrench/reftests/boxshadow/box-shadow-suite-no-blur.png
До Ширина: | Высота: | Размер: 20 KiB После Ширина: | Высота: | Размер: 21 KiB |
Двоичные данные
gfx/wr/wrench/reftests/boxshadow/boxshadow-spread-only-ref.png
До Ширина: | Высота: | Размер: 19 KiB После Ширина: | Высота: | Размер: 19 KiB |
Двоичные данные
gfx/wr/wrench/reftests/boxshadow/inset-border-radius.png
До Ширина: | Высота: | Размер: 3.6 KiB После Ширина: | Высота: | Размер: 3.6 KiB |
Двоичные данные
gfx/wr/wrench/reftests/boxshadow/inset-mask-region.png
До Ширина: | Высота: | Размер: 24 KiB После Ширина: | Высота: | Размер: 24 KiB |
Двоичные данные
gfx/wr/wrench/reftests/boxshadow/inset-no-blur-radius-ref.png
До Ширина: | Высота: | Размер: 708 B После Ширина: | Высота: | Размер: 692 B |
Двоичные данные
gfx/wr/wrench/reftests/clip/border-with-rounded-clip.png
До Ширина: | Высота: | Размер: 1.8 KiB После Ширина: | Высота: | Размер: 1.9 KiB |
Двоичные данные
gfx/wr/wrench/reftests/clip/clip-mode.png
До Ширина: | Высота: | Размер: 2.5 KiB После Ширина: | Высота: | Размер: 2.6 KiB |
|
@ -4,7 +4,7 @@ platform(linux,mac) == border-with-rounded-clip.yaml border-with-rounded-clip.pn
|
|||
platform(linux,mac) == clip-45-degree-rotation.yaml clip-45-degree-rotation-ref.png
|
||||
== clip-3d-transform.yaml clip-3d-transform-ref.yaml
|
||||
fuzzy(1,3) == clip-corner-overlap.yaml clip-corner-overlap-ref.yaml
|
||||
== custom-clip-chains.yaml custom-clip-chains-ref.yaml
|
||||
fuzzy(8,60) == custom-clip-chains.yaml custom-clip-chains-ref.yaml
|
||||
== custom-clip-chain-node-ancestors.yaml custom-clip-chain-node-ancestors-ref.yaml
|
||||
== fixed-position-clipping.yaml fixed-position-clipping-ref.yaml
|
||||
platform(linux,mac) == segmentation-with-other-coordinate-system-clip.yaml segmentation-with-other-coordinate-system-clip.png
|
||||
|
|
Двоичные данные
gfx/wr/wrench/reftests/filters/filter-drop-shadow-clip.png
До Ширина: | Высота: | Размер: 11 KiB После Ширина: | Высота: | Размер: 11 KiB |
Двоичные данные
gfx/wr/wrench/reftests/gradient/linear-aligned-border-radius.png
До Ширина: | Высота: | Размер: 6.5 KiB После Ширина: | Высота: | Размер: 6.7 KiB |
Двоичные данные
gfx/wr/wrench/reftests/gradient/repeat-border-radius.png
До Ширина: | Высота: | Размер: 19 KiB После Ширина: | Высота: | Размер: 19 KiB |
Двоичные данные
gfx/wr/wrench/reftests/image/segments.png
До Ширина: | Высота: | Размер: 6.9 KiB После Ширина: | Высота: | Размер: 7.0 KiB |
Двоичные данные
gfx/wr/wrench/reftests/mask/rounded-corners.png
До Ширина: | Высота: | Размер: 1.6 KiB После Ширина: | Высота: | Размер: 1.7 KiB |
Двоичные данные
gfx/wr/wrench/reftests/text/border-radius-alpha.png
До Ширина: | Высота: | Размер: 14 KiB После Ширина: | Высота: | Размер: 14 KiB |
Двоичные данные
gfx/wr/wrench/reftests/text/border-radius-subpx.png
До Ширина: | Высота: | Размер: 14 KiB После Ширина: | Высота: | Размер: 14 KiB |
|
@ -85,6 +85,10 @@ subcommands:
|
|||
help: The input YAML file
|
||||
required: true
|
||||
index: 1
|
||||
- OUTPUT:
|
||||
help: Optional output path to save to.
|
||||
required: false
|
||||
index: 2
|
||||
- show:
|
||||
about: show frame(s) described by YAML, binary recording, or capture
|
||||
aliases: ['load', 'replay']
|
||||
|
|
|
@ -512,8 +512,9 @@ fn main() {
|
|||
Some("gpu-cache") => png::ReadSurface::GpuCache,
|
||||
_ => panic!("Unknown surface argument value")
|
||||
};
|
||||
let output_path = subargs.value_of("OUTPUT").map(|s| PathBuf::from(s));
|
||||
let reader = YamlFrameReader::new_from_args(subargs);
|
||||
png::png(&mut wrench, surface, &mut window, reader, rx.unwrap());
|
||||
png::png(&mut wrench, surface, &mut window, reader, rx.unwrap(), output_path);
|
||||
} else if let Some(subargs) = args.subcommand_matches("reftest") {
|
||||
// Exit with an error code in order to ensure the CI job fails.
|
||||
process::exit(reftest(wrench, &mut window, subargs, rx.unwrap()) as _);
|
||||
|
|
|
@ -6,7 +6,7 @@ use {WindowWrapper, NotifierEvent};
|
|||
use image::png::PNGEncoder;
|
||||
use image::{self, ColorType, GenericImageView};
|
||||
use std::fs::File;
|
||||
use std::path::Path;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::sync::mpsc::Receiver;
|
||||
use webrender::api::units::*;
|
||||
use wrench::{Wrench, WrenchThing};
|
||||
|
@ -80,6 +80,7 @@ pub fn png(
|
|||
window: &mut WindowWrapper,
|
||||
mut reader: YamlFrameReader,
|
||||
rx: Receiver<NotifierEvent>,
|
||||
out_path: Option<PathBuf>,
|
||||
) {
|
||||
reader.do_frame(wrench);
|
||||
|
||||
|
@ -107,8 +108,11 @@ pub fn png(
|
|||
}
|
||||
};
|
||||
|
||||
let mut out_path = reader.yaml_path().clone();
|
||||
out_path.set_extension("png");
|
||||
let out_path = out_path.unwrap_or_else(|| {
|
||||
let mut path = reader.yaml_path().clone();
|
||||
path.set_extension("png");
|
||||
path
|
||||
});
|
||||
|
||||
save(out_path, data, fb_size, settings);
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@ skip-if(!asyncPan) == bg-fixed-cover-3.html bg-fixed-cover-3-ref.html
|
|||
skip-if(!asyncPan) == bg-fixed-child.html bg-fixed-child-ref.html
|
||||
skip-if(!asyncPan) == bg-fixed-child-clip-1.html bg-fixed-child-clip-ref.html
|
||||
skip-if(!asyncPan) == bg-fixed-child-clip-2.html bg-fixed-child-clip-ref.html
|
||||
fuzzy(0-1,0-246) fuzzy-if(skiaContent,0-2,0-170) fuzzy-if(browserIsRemote&&d2d,0-59,0-187) fuzzy-if(webrender,41-41,154-154) skip-if(!asyncPan) == bg-fixed-child-mask.html bg-fixed-child-mask-ref.html
|
||||
fuzzy(0-1,0-246) fuzzy-if(skiaContent,0-2,0-170) fuzzy-if(browserIsRemote&&d2d,0-59,0-187) fuzzy-if(webrender,41-41,166-166) skip-if(!asyncPan) == bg-fixed-child-mask.html bg-fixed-child-mask-ref.html
|
||||
skip-if(!asyncPan) == bg-fixed-in-opacity.html bg-fixed-in-opacity-ref.html
|
||||
# Passing the test below without WebRender would require implementing CSS filters in the Gecko compositor.
|
||||
fails-if(!webrender) skip-if(!asyncPan) fuzzy-if(webrender&>kWidget,0-1,0-87) fuzzy-if(webrender&&!gtkWidget,0-1,0-8) == bg-fixed-in-css-filter.html bg-fixed-in-css-filter-ref.html # bug 1454794 for webrender fuzziness
|
||||
|
|
|
@ -51,7 +51,7 @@ fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),0-1,0-5) == clipping-5-image
|
|||
fuzzy-if(skiaContent,0-1,0-77) == clipping-5-overflow-hidden.html clipping-5-ref.html
|
||||
fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),0-1,0-4) fuzzy-if(Android,0-5,0-21) fuzzy-if(skiaContent,0-1,0-97) == clipping-5-refi.html clipping-5-ref.html
|
||||
fuzzy-if(true,0-1,0-7) fuzzy-if(d2d,0-55,0-95) fuzzy-if(cocoaWidget,0-1,0-99) fuzzy-if(Android,0-99,0-115) fuzzy-if(skiaContent,0-1,0-77) == clipping-5-refc.html clipping-5-ref.html # bug 732535
|
||||
fuzzy-if(Android,0-8,0-469) fuzzy-if(skiaContent,0-21,0-76) fuzzy-if(winWidget,0-144,0-335) fuzzy-if(webrender&&cocoaWidget,117-117,284-284) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == clipping-6.html clipping-6-ref.html # PaintedLayer and MaskLayer with transforms that aren't identical, bug 1392106
|
||||
fuzzy-if(Android,0-8,0-469) fuzzy-if(skiaContent,0-21,0-76) fuzzy-if(winWidget,0-144,0-335) fuzzy-if(webrender&&cocoaWidget,117-117,292-292) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == clipping-6.html clipping-6-ref.html # PaintedLayer and MaskLayer with transforms that aren't identical, bug 1392106
|
||||
fuzzy-if(true,0-2,0-29) fuzzy-if(d2d,0-46,0-71) fuzzy-if(Android,0-255,0-586) fuzzy-if(skiaContent,0-28,0-97) == clipping-7.html clipping-7-ref.html # ColorLayer and MaskLayer with transforms that aren't identical. Reference image rendered without using layers (which causes fuzzy failures).
|
||||
fuzzy-if(/^Windows\x20NT\x206\.2/.test(http.oscpu),0-1,0-5) == clipping-and-zindex-1.html clipping-and-zindex-1-ref.html
|
||||
fuzzy-if(cocoaWidget,0-1,0-4) fuzzy-if(d2d,0-59,0-342) fuzzy-if(d3d11&&advancedLayers&&!d2d,0-30,0-3) == intersecting-clipping-1-canvas.html intersecting-clipping-1-refc.html
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
== box-decoration-break-1.html box-decoration-break-1-ref.html
|
||||
fuzzy(0-1,0-20) fuzzy-if(skiaContent,0-1,0-700) fuzzy-if(webrender,20-26,8908-12681) == box-decoration-break-with-inset-box-shadow-1.html box-decoration-break-with-inset-box-shadow-1-ref.html
|
||||
fuzzy(0-1,0-20) fuzzy-if(skiaContent,0-1,0-700) fuzzy-if(webrender,20-26,8906-12681) == box-decoration-break-with-inset-box-shadow-1.html box-decoration-break-with-inset-box-shadow-1-ref.html
|
||||
skip-if(verify) fuzzy(0-45,0-460) fuzzy-if(skiaContent,0-57,0-439) fuzzy-if(Android,0-57,0-1330) random-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)) == box-decoration-break-with-outset-box-shadow-1.html box-decoration-break-with-outset-box-shadow-1-ref.html # Bug 1386543, bug 1392106
|
||||
random-if(!gtkWidget) == box-decoration-break-border-image.html box-decoration-break-border-image-ref.html
|
||||
== box-decoration-break-block-border-padding.html box-decoration-break-block-border-padding-ref.html
|
||||
|
|
|
@ -20,9 +20,9 @@ fuzzy-if(d2d,0-255,0-24) == element-paint-transform-03.html element-paint-transf
|
|||
fuzzy-if(asyncPan,0-2,0-140) fuzzy-if(skiaContent,0-3,0-106) fuzzy-if(webrender&&!gtkWidget,134-222,1197-1588) == element-paint-native-widget.html element-paint-native-widget-ref.html # in -ref the scrollframe is active and layerized differently with APZ
|
||||
fails-if(usesRepeatResampling&&!(webrender&&winWidget)) == element-paint-subimage-sampling-restriction.html about:blank
|
||||
== element-paint-clippath.html element-paint-clippath-ref.html
|
||||
fuzzy-if(webrender,36-36,702-704) == element-paint-sharpness-01a.html element-paint-sharpness-01b.html
|
||||
fuzzy-if(webrender,36-36,712-715) == element-paint-sharpness-01a.html element-paint-sharpness-01b.html
|
||||
fuzzy-if(skiaContent,0-1,0-326) == element-paint-sharpness-01b.html element-paint-sharpness-01c.html
|
||||
fuzzy-if(webrender,36-36,702-704) == element-paint-sharpness-01c.html element-paint-sharpness-01d.html
|
||||
fuzzy-if(webrender,36-36,712-715) == element-paint-sharpness-01c.html element-paint-sharpness-01d.html
|
||||
== element-paint-sharpness-02a.html element-paint-sharpness-02b.html
|
||||
== element-paint-sharpness-02b.html element-paint-sharpness-02c.html
|
||||
== element-paint-paintserversize-rounding-01.html element-paint-paintserversize-rounding-01-ref.html
|
||||
|
|
|
@ -16,26 +16,26 @@
|
|||
== clip-path-polygon-012.html clip-path-stripes-001-ref.html
|
||||
fuzzy-if(skiaContent,0-1,0-20) fuzzy-if(webrender&>kWidget,8-8,20-20) fails-if(webrender&&!gtkWidget) == clip-path-polygon-013.html clip-path-stripes-003-ref.html
|
||||
|
||||
fuzzy-if(webrender,35-35,699-703) == clip-path-circle-001.html clip-path-circle-001-ref.html
|
||||
fuzzy-if(webrender,35-35,699-703) == clip-path-circle-002.html clip-path-circle-001-ref.html
|
||||
fuzzy-if(webrender,35-35,699-703) == clip-path-circle-003.html clip-path-circle-001-ref.html
|
||||
fuzzy-if(webrender,35-35,699-703) == clip-path-circle-004.html clip-path-circle-001-ref.html
|
||||
fuzzy-if(webrender,35-35,699-703) == clip-path-circle-005.html clip-path-circle-002-ref.html
|
||||
fuzzy-if(webrender,35-35,699-703) == clip-path-circle-006.html clip-path-circle-001-ref.html
|
||||
fuzzy-if(webrender,35-35,699-703) == clip-path-circle-007.html clip-path-circle-002-ref.html
|
||||
fuzzy-if(webrender,35-35,699-703) == clip-path-circle-008.html clip-path-circle-002-ref.html
|
||||
fuzzy-if(webrender,35-35,699-703) == clip-path-circle-009.html clip-path-circle-003-ref.html
|
||||
fuzzy-if(webrender,35-35,699-703) == clip-path-circle-010.html clip-path-circle-004-ref.html
|
||||
fuzzy-if(webrender,35-35,699-703) == clip-path-circle-011.html clip-path-circle-005-ref.html
|
||||
fuzzy-if(webrender,35-35,699-703) == clip-path-circle-012.html clip-path-circle-006-ref.html
|
||||
fuzzy-if(webrender,35-35,699-703) == clip-path-circle-013.html clip-path-circle-002-ref.html
|
||||
fuzzy-if(webrender,35-35,699-703) == clip-path-circle-014.html clip-path-circle-007-ref.html
|
||||
fuzzy-if(webrender,35-35,699-703) == clip-path-circle-015.html clip-path-circle-008-ref.html
|
||||
fuzzy-if(webrender,35-35,699-703) == clip-path-circle-016.html clip-path-circle-009-ref.html
|
||||
fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),0-16,0-9) fuzzy-if(webrender,35-35,699-703) == clip-path-circle-017.html clip-path-circle-007-ref.html
|
||||
fuzzy-if(webrender,35-35,699-703) == clip-path-circle-018.html clip-path-circle-010-ref.html
|
||||
fuzzy-if(webrender,35-35,699-703) == clip-path-circle-019.html clip-path-circle-002-ref.html
|
||||
fuzzy-if(webrender,35-35,699-703) == clip-path-circle-020.html clip-path-circle-002-ref.html
|
||||
fuzzy-if(webrender,35-35,699-708) == clip-path-circle-001.html clip-path-circle-001-ref.html
|
||||
fuzzy-if(webrender,35-35,699-708) == clip-path-circle-002.html clip-path-circle-001-ref.html
|
||||
fuzzy-if(webrender,35-35,699-708) == clip-path-circle-003.html clip-path-circle-001-ref.html
|
||||
fuzzy-if(webrender,35-35,699-708) == clip-path-circle-004.html clip-path-circle-001-ref.html
|
||||
fuzzy-if(webrender,35-35,699-708) == clip-path-circle-005.html clip-path-circle-002-ref.html
|
||||
fuzzy-if(webrender,35-35,699-708) == clip-path-circle-006.html clip-path-circle-001-ref.html
|
||||
fuzzy-if(webrender,35-35,699-708) == clip-path-circle-007.html clip-path-circle-002-ref.html
|
||||
fuzzy-if(webrender,35-35,699-708) == clip-path-circle-008.html clip-path-circle-002-ref.html
|
||||
fuzzy-if(webrender,35-35,699-708) == clip-path-circle-009.html clip-path-circle-003-ref.html
|
||||
fuzzy-if(webrender,35-35,699-708) == clip-path-circle-010.html clip-path-circle-004-ref.html
|
||||
fuzzy-if(webrender,35-35,699-708) == clip-path-circle-011.html clip-path-circle-005-ref.html
|
||||
fuzzy-if(webrender,35-35,699-708) == clip-path-circle-012.html clip-path-circle-006-ref.html
|
||||
fuzzy-if(webrender,35-35,699-708) == clip-path-circle-013.html clip-path-circle-002-ref.html
|
||||
fuzzy-if(webrender,35-35,699-708) == clip-path-circle-014.html clip-path-circle-007-ref.html
|
||||
fuzzy-if(webrender,35-35,699-708) == clip-path-circle-015.html clip-path-circle-008-ref.html
|
||||
fuzzy-if(webrender,35-35,699-708) == clip-path-circle-016.html clip-path-circle-009-ref.html
|
||||
fuzzy-if(/^Windows\x20NT\x2010\.0/.test(http.oscpu),0-16,0-9) fuzzy-if(webrender,35-35,699-708) == clip-path-circle-017.html clip-path-circle-007-ref.html
|
||||
fuzzy-if(webrender,35-35,699-708) == clip-path-circle-018.html clip-path-circle-010-ref.html
|
||||
fuzzy-if(webrender,35-35,699-708) == clip-path-circle-019.html clip-path-circle-002-ref.html
|
||||
fuzzy-if(webrender,35-35,699-708) == clip-path-circle-020.html clip-path-circle-002-ref.html
|
||||
fuzzy-if(webrender&&winWidget,0-1,0-5) == clip-path-circle-021.html clip-path-circle-021-ref.html
|
||||
|
||||
fuzzy-if(webrender,36-36,1099-1100) == clip-path-ellipse-001.html clip-path-ellipse-001-ref.html
|
||||
|
|
|
@ -81,8 +81,8 @@ fuzzy(0-1,0-10000) == opacity-preserve3d-3.html opacity-preserve3d-3-ref.html
|
|||
fuzzy(0-1,0-10000) == opacity-preserve3d-4.html opacity-preserve3d-4-ref.html
|
||||
== opacity-preserve3d-5.html opacity-preserve3d-5-ref.html
|
||||
== snap-perspective-1.html snap-perspective-1-ref.html
|
||||
== mask-layer-1.html mask-layer-ref.html
|
||||
== mask-layer-2.html mask-layer-ref.html
|
||||
fuzzy-if(webrender,8-9,32-32) == mask-layer-1.html mask-layer-ref.html
|
||||
fuzzy-if(webrender,8-9,32-32) == mask-layer-2.html mask-layer-ref.html
|
||||
fuzzy-if(webrender,0-16,0-100) == mask-layer-3.html mask-layer-ref.html
|
||||
== split-intersect1.html split-intersect1-ref.html
|
||||
fuzzy(0-255,0-150) == split-intersect2.html split-intersect2-ref.html
|
||||
|
|
|
@ -89,7 +89,7 @@ fails == mask-origin-2.html mask-origin-2-ref.html # bug 1260094
|
|||
|
||||
fuzzy-if(winWidget,0-1,0-27) fuzzy-if(skiaContent,0-1,0-60) fuzzy-if(webrender,0-64,0-371) == clip-path-contentBox-1a.html clip-path-geometryBox-1-ref.html
|
||||
fuzzy-if(winWidget,0-16,0-27) fuzzy-if(skiaContent,0-1,0-60) == clip-path-contentBox-1b.html clip-path-geometryBox-1-ref.html
|
||||
fuzzy-if(winWidget,0-16,0-27) fuzzy-if(skiaContent,0-1,0-60) fuzzy-if(webrender,35-35,360-360) == clip-path-contentBox-1c.html clip-path-geometryBox-1-ref.html
|
||||
fuzzy-if(winWidget,0-16,0-27) fuzzy-if(skiaContent,0-1,0-60) fuzzy-if(webrender,36-36,365-365) == clip-path-contentBox-1c.html clip-path-geometryBox-1-ref.html
|
||||
fuzzy-if(winWidget,0-16,0-27) fuzzy-if(skiaContent,0-1,0-60) fuzzy-if(webrender,0-64,0-371) == clip-path-paddingBox-1a.html clip-path-geometryBox-1-ref.html
|
||||
fuzzy-if(winWidget,0-16,0-27) fuzzy-if(skiaContent,0-1,0-60) == clip-path-paddingBox-1b.html clip-path-geometryBox-1-ref.html
|
||||
fuzzy-if(winWidget,0-16,0-27) fuzzy-if(skiaContent,0-1,0-60) fuzzy-if(webrender,0-64,0-371) == clip-path-paddingBox-1c.html clip-path-geometryBox-1-ref.html
|
||||
|
|
|
@ -5,3 +5,4 @@
|
|||
if not webrender and (os == "win") and (version == "10.0.17134"): FAIL
|
||||
if (os == "mac"): FAIL
|
||||
if (os == "android"): FAIL
|
||||
if webrender: FAIL
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
[integration-point-2.html]
|
||||
expected:
|
||||
if webrender and (os == "win"): FAIL
|