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 #3856

Merged
merged 9 commits into from Feb 12, 2020
Prev

Backed out changeset 8f55490fb539 (bug 1614890) for causing awsy fail…

  • Loading branch information
Mihai Alexandru Michis authored and moz-gfx committed Feb 12, 2020
commit a5108f4d17e66f067608843a526c2bbae33bd1b8
@@ -89,7 +89,6 @@ FWD_DECLARE_VS_FUNCTION(blend_brush_vs)
FWD_DECLARE_VS_FUNCTION(mix_blend_brush_vs)
FWD_DECLARE_VS_FUNCTION(linear_gradient_brush_vs)
FWD_DECLARE_VS_FUNCTION(radial_gradient_brush_vs)
FWD_DECLARE_VS_FUNCTION(conic_gradient_brush_vs)
FWD_DECLARE_VS_FUNCTION(yuv_brush_vs)
FWD_DECLARE_VS_FUNCTION(opacity_brush_vs)

@@ -259,7 +258,6 @@ Fragment blend_brush_fs();
Fragment mix_blend_brush_fs();
Fragment linear_gradient_brush_fs();
Fragment radial_gradient_brush_fs();
Fragment conic_gradient_brush_fs();
Fragment yuv_brush_fs();
Fragment opacity_brush_fs();
Fragment multi_brush_fs(int brush_kind);

This file was deleted.

@@ -18,11 +18,10 @@
#define BRUSH_KIND_TEXT 3
#define BRUSH_KIND_LINEAR_GRADIENT 4
#define BRUSH_KIND_RADIAL_GRADIENT 5
#define BRUSH_KIND_CONIC_GRADIENT 6
#define BRUSH_KIND_BLEND 7
#define BRUSH_KIND_MIX_BLEND 8
#define BRUSH_KIND_YV 9
#define BRUSH_KIND_OPACITY 10
#define BRUSH_KIND_BLEND 6
#define BRUSH_KIND_MIX_BLEND 7
#define BRUSH_KIND_YV 8
#define BRUSH_KIND_OPACITY 9

int vecs_per_brush(int brush_kind);

@@ -76,14 +75,6 @@ int vecs_per_brush(int brush_kind);
#undef WR_BRUSH_VS_FUNCTION
#undef WR_BRUSH_FS_FUNCTION

#ifdef WR_FEATURE_CONIC_GRADIENT_BRUSH
#include brush_conic_gradient
#endif

#undef VECS_PER_SPECIFIC_BRUSH
#undef WR_BRUSH_VS_FUNCTION
#undef WR_BRUSH_FS_FUNCTION

#ifdef WR_FEATURE_OPACITY_BRUSH
#include brush_opacity
#endif
@@ -118,11 +109,6 @@ int vecs_per_brush(int brush_kind) {
case BRUSH_KIND_RADIAL_GRADIENT: return VECS_PER_RADIAL_GRADIENT_BRUSH;
#endif


#ifdef WR_FEATURE_CONIC_GRADIENT_BRUSH
case BRUSH_KIND_CONIC_GRADIENT: return VECS_PER_CONIC_GRADIENT_BRUSH;
#endif

#ifdef WR_FEATURE_OPACITY_BRUSH
case BRUSH_KIND_OPACITY: return VECS_PER_OPACITY_BRUSH;
#endif
@@ -187,12 +173,6 @@ void multi_brush_vs(
break;
#endif

#ifdef WR_FEATURE_CONIC_GRADIENT_BRUSH
case BRUSH_KIND_CONIC_GRADIENT:
conic_gradient_brush_vs(BRUSH_VS_PARAMS);
break;
#endif

#ifdef WR_FEATURE_OPACITY_BRUSH
case BRUSH_KIND_OPACITY:
opacity_brush_vs(BRUSH_VS_PARAMS);
@@ -233,10 +213,6 @@ Fragment multi_brush_fs(int brush_kind) {
case BRUSH_KIND_RADIAL_GRADIENT: return radial_gradient_brush_fs();
#endif

#ifdef WR_FEATURE_CONIC_GRADIENT_BRUSH
case BRUSH_KIND_CONIC_GRADIENT: return conic_gradient_brush_fs();
#endif

#ifdef WR_FEATURE_OPACITY_BRUSH
case BRUSH_KIND_OPACITY: return opacity_brush_fs();
#endif
@@ -56,7 +56,6 @@ pub enum BrushBatchKind {
backdrop_id: RenderTaskId,
},
YuvImage(ImageBufferKind, YuvFormat, ColorDepth, YuvColorSpace, ColorRange),
ConicGradient,
RadialGradient,
LinearGradient,
Opacity,
@@ -78,7 +77,6 @@ impl BatchKind {
BatchKind::Brush(BrushBatchKind::Image(..)) => BrushShaderKind::Image,
BatchKind::Brush(BrushBatchKind::LinearGradient) => BrushShaderKind::LinearGradient,
BatchKind::Brush(BrushBatchKind::RadialGradient) => BrushShaderKind::RadialGradient,
BatchKind::Brush(BrushBatchKind::ConicGradient) => BrushShaderKind::ConicGradient,
BatchKind::Brush(BrushBatchKind::Blend) => BrushShaderKind::Blend,
BatchKind::Brush(BrushBatchKind::MixBlend { .. }) => BrushShaderKind::MixBlend,
BatchKind::Brush(BrushBatchKind::YuvImage(..)) => BrushShaderKind::Yuv,
@@ -2332,87 +2330,6 @@ impl BatchBuilder {
);
}
}
PrimitiveInstanceKind::ConicGradient { data_handle, ref visible_tiles_range, .. } => {
let prim_data = &ctx.data_stores.conic_grad[data_handle];
let specified_blend_mode = BlendMode::PremultipliedAlpha;

let mut prim_header = PrimitiveHeader {
local_rect: prim_rect,
local_clip_rect: prim_info.combined_local_clip_rect,
specific_prim_address: GpuCacheAddress::INVALID,
transform_id,
};

if visible_tiles_range.is_empty() {
let non_segmented_blend_mode = if !prim_data.opacity.is_opaque ||
prim_info.clip_task_index != ClipTaskIndex::INVALID ||
transform_kind == TransformedRectKind::Complex
{
specified_blend_mode
} else {
BlendMode::None
};

let batch_params = BrushBatchParameters::shared(
BrushBatchKind::ConicGradient,
BatchTextures::no_texture(),
[
prim_data.stops_handle.as_int(gpu_cache),
0,
0,
0,
],
0,
);

prim_header.specific_prim_address = gpu_cache.get_address(&prim_data.gpu_cache_handle);

let prim_header_index = prim_headers.push(
&prim_header,
z_id,
batch_params.prim_user_data,
);

let segments = if prim_data.brush_segments.is_empty() {
None
} else {
Some(prim_data.brush_segments.as_slice())
};

self.add_segmented_prim_to_batch(
segments,
prim_data.opacity,
&batch_params,
specified_blend_mode,
non_segmented_blend_mode,
batch_features,
prim_header_index,
bounding_rect,
transform_kind,
render_tasks,
z_id,
prim_info.clip_task_index,
prim_vis_mask,
ctx,
);
} else {
let visible_tiles = &ctx.scratch.gradient_tiles[*visible_tiles_range];

self.add_gradient_tiles(
visible_tiles,
&prim_data.stops_handle,
BrushBatchKind::ConicGradient,
specified_blend_mode,
bounding_rect,
clip_task_address.unwrap(),
gpu_cache,
&prim_header,
prim_headers,
z_id,
prim_vis_mask,
);
}
}
PrimitiveInstanceKind::Backdrop { data_handle } => {
let prim_data = &ctx.data_stores.backdrop[data_handle];
let backdrop_pic_index = prim_data.kind.pic_index;
@@ -78,11 +78,10 @@ pub enum BrushShaderKind {
Text = 3,
LinearGradient = 4,
RadialGradient = 5,
ConicGradient = 6,
Blend = 7,
MixBlend = 8,
Yuv = 9,
Opacity = 10,
Blend = 6,
MixBlend = 7,
Yuv = 8,
Opacity = 9,
}

#[derive(Debug, Copy, Clone)]
@@ -122,7 +122,7 @@ use crate::prim_store::backdrop::Backdrop;
#[cfg(any(feature = "capture", feature = "replay"))]
use crate::prim_store::borders::{ImageBorder, NormalBorderPrim};
#[cfg(any(feature = "capture", feature = "replay"))]
use crate::prim_store::gradient::{LinearGradient, RadialGradient, ConicGradient};
use crate::prim_store::gradient::{LinearGradient, RadialGradient};
#[cfg(any(feature = "capture", feature = "replay"))]
use crate::prim_store::image::{Image, YuvImage};
#[cfg(any(feature = "capture", feature = "replay"))]
@@ -2714,7 +2714,6 @@ impl TileCacheInstance {
PrimitiveInstanceKind::NormalBorder { .. } |
PrimitiveInstanceKind::LinearGradient { .. } |
PrimitiveInstanceKind::RadialGradient { .. } |
PrimitiveInstanceKind::ConicGradient { .. } |
PrimitiveInstanceKind::Backdrop { .. } => {
// These don't contribute dependencies
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.