Commit c596435f authored by criss's avatar criss
Browse files

Merge mozilla-central to autoland on a CLOSED TREE

parents b91575de a1561aea
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1947,7 +1947,7 @@
            "win64-aarch64-devedition",
            "win64-devedition"
        ],
        "revision": "f7658be5b6d79930bea5abb25f963509ed596773"
        "revision": "58576c657316e6bb1626faa5951af87d10645f33"
    },
    "zh-TW": {
        "pin": false,
+3 −5
Original line number Diff line number Diff line
@@ -85,7 +85,6 @@ void text_shader_main(
#define BRUSH_FLAG_SEGMENT_REPEAT_Y_ROUND      32
#define BRUSH_FLAG_SEGMENT_NINEPATCH_MIDDLE    64
#define BRUSH_FLAG_TEXEL_RECT                 128
#define BRUSH_FLAG_FORCE_AA                   256

#define INVALID_SEGMENT_INDEX                   0xffff

@@ -96,8 +95,8 @@ void brush_shader_main_vs(
    PictureTask pic_task,
    ClipArea clip_area
) {
    int edge_flags = (instance.flags >> 12) & 0xf;
    int brush_flags = instance.flags & 0xfff;
    int edge_flags = instance.flags & 0xff;
    int brush_flags = (instance.flags >> 8) & 0xff;

    // Fetch the segment of this brush primitive we are drawing.
    vec4 segment_data;
@@ -119,9 +118,8 @@ void brush_shader_main_vs(

    VertexInfo vi;

    bool force_aa = (brush_flags & BRUSH_FLAG_FORCE_AA) != 0 && edge_flags != 0;
    // Write the normal vertex information out.
    if (transform.is_axis_aligned && !force_aa) {
    if (transform.is_axis_aligned) {

        // Select the corner of the local rect that we are processing.
        vec2 local_pos = mix(segment_rect.p0, segment_rect.p1, aPosition.xy);
+23 −55
Original line number Diff line number Diff line
@@ -828,12 +828,6 @@ impl BatchBuilder {
        surface_spatial_node_index: SpatialNodeIndex,
        z_generator: &mut ZBufferIdGenerator,
    ) {
        let brush_flags = if prim_instance.anti_aliased {
            BrushFlags::FORCE_AA
        } else {
            BrushFlags::empty()
        };

        let vis_flags = match prim_instance.vis.state {
            VisibilityState::Culled => {
                return;
@@ -942,7 +936,7 @@ impl BatchBuilder {
                    INVALID_SEGMENT_INDEX,
                    EdgeAaSegmentMask::all(),
                    clip_task_address,
                    brush_flags | BrushFlags::PERSPECTIVE_INTERPOLATION,
                    BrushFlags::PERSPECTIVE_INTERPOLATION,
                    prim_header_index,
                    0,
                );
@@ -974,8 +968,7 @@ impl BatchBuilder {

                let blend_mode = if !common_data.opacity.is_opaque ||
                    prim_info.clip_task_index != ClipTaskIndex::INVALID ||
                    transform_kind == TransformedRectKind::Complex ||
                    prim_instance.anti_aliased
                    transform_kind == TransformedRectKind::Complex
                {
                    specified_blend_mode
                } else {
@@ -1013,7 +1006,6 @@ impl BatchBuilder {
                    &batch_params,
                    blend_mode,
                    batch_features,
                    brush_flags,
                    prim_header_index,
                    bounding_rect,
                    transform_kind,
@@ -1309,8 +1301,7 @@ impl BatchBuilder {
                //           use of interning.
                let blend_mode = if !common_data.opacity.is_opaque ||
                    prim_info.clip_task_index != ClipTaskIndex::INVALID ||
                    transform_kind == TransformedRectKind::Complex ||
                    prim_instance.anti_aliased
                    transform_kind == TransformedRectKind::Complex
                {
                    BlendMode::PremultipliedAlpha
                } else {
@@ -1344,7 +1335,7 @@ impl BatchBuilder {
                    INVALID_SEGMENT_INDEX,
                    EdgeAaSegmentMask::all(),
                    clip_task_address,
                    brush_flags | BrushFlags::PERSPECTIVE_INTERPOLATION,
                    BrushFlags::PERSPECTIVE_INTERPOLATION,
                    prim_header_index,
                    specific_resource_address,
                );
@@ -1358,7 +1349,7 @@ impl BatchBuilder {
                    Some(ref raster_config) => {
                        // If the child picture was rendered in local space, we can safely
                        // interpolate the UV coordinates with perspective correction.
                        let brush_flags = brush_flags | BrushFlags::PERSPECTIVE_INTERPOLATION;
                        let brush_flags = BrushFlags::PERSPECTIVE_INTERPOLATION;

                        let surface = &ctx.surfaces[raster_config.surface_index.0];

@@ -1403,8 +1394,7 @@ impl BatchBuilder {

                        let mut is_opaque = prim_info.clip_task_index == ClipTaskIndex::INVALID
                            && surface.is_opaque
                            && transform_kind == TransformedRectKind::AxisAligned
                            && !prim_instance.anti_aliased;
                            && transform_kind == TransformedRectKind::AxisAligned;

                        let pic_task_id = picture.primary_render_task_id.unwrap();

@@ -2029,7 +2019,6 @@ impl BatchBuilder {
                                            &batch_params,
                                            blend_mode,
                                            batch_features,
                                            brush_flags,
                                            prim_header_index,
                                            bounding_rect,
                                            transform_kind,
@@ -2110,8 +2099,7 @@ impl BatchBuilder {
                let prim_cache_address = gpu_cache.get_address(&common_data.gpu_cache_handle);
                let blend_mode = if !common_data.opacity.is_opaque ||
                    prim_info.clip_task_index != ClipTaskIndex::INVALID ||
                    transform_kind == TransformedRectKind::Complex ||
                    prim_instance.anti_aliased
                    transform_kind == TransformedRectKind::Complex
                {
                    BlendMode::PremultipliedAlpha
                } else {
@@ -2149,7 +2137,6 @@ impl BatchBuilder {
                    &batch_params,
                    blend_mode,
                    batch_features,
                    brush_flags,
                    prim_header_index,
                    bounding_rect,
                    transform_kind,
@@ -2164,8 +2151,7 @@ impl BatchBuilder {

                let blend_mode = if !prim_data.opacity.is_opaque ||
                    prim_info.clip_task_index != ClipTaskIndex::INVALID ||
                    transform_kind == TransformedRectKind::Complex ||
                    prim_instance.anti_aliased
                    transform_kind == TransformedRectKind::Complex
                {
                    BlendMode::PremultipliedAlpha
                } else {
@@ -2206,7 +2192,6 @@ impl BatchBuilder {
                    &batch_params,
                    blend_mode,
                    batch_features,
                    brush_flags,
                    prim_header_index,
                    bounding_rect,
                    transform_kind,
@@ -2274,8 +2259,7 @@ impl BatchBuilder {

                let blend_mode = if !prim_common_data.opacity.is_opaque ||
                    prim_info.clip_task_index != ClipTaskIndex::INVALID ||
                    transform_kind == TransformedRectKind::Complex ||
                    prim_instance.anti_aliased
                    transform_kind == TransformedRectKind::Complex
                {
                    BlendMode::PremultipliedAlpha
                } else {
@@ -2310,7 +2294,6 @@ impl BatchBuilder {
                    &batch_params,
                    blend_mode,
                    batch_features,
                    brush_flags,
                    prim_header_index,
                    bounding_rect,
                    transform_kind,
@@ -2335,8 +2318,7 @@ impl BatchBuilder {

                let blend_mode = if !common_data.opacity.is_opaque ||
                    prim_info.clip_task_index != ClipTaskIndex::INVALID ||
                    transform_kind == TransformedRectKind::Complex ||
                    prim_instance.anti_aliased
                    transform_kind == TransformedRectKind::Complex
                {
                    match image_data.alpha_type {
                        AlphaType::PremultipliedAlpha => BlendMode::PremultipliedAlpha,
@@ -2398,7 +2380,6 @@ impl BatchBuilder {
                        &batch_params,
                        blend_mode,
                        batch_features,
                        brush_flags,
                        prim_header_index,
                        bounding_rect,
                        transform_kind,
@@ -2466,7 +2447,7 @@ impl BatchBuilder {
                                i as i32,
                                tile.edge_flags,
                                clip_task_address,
                                brush_flags | BrushFlags::SEGMENT_RELATIVE | BrushFlags::PERSPECTIVE_INTERPOLATION,
                                BrushFlags::SEGMENT_RELATIVE | BrushFlags::PERSPECTIVE_INTERPOLATION,
                                prim_header_index,
                                uv_rect_address.as_int(),
                            );
@@ -2486,8 +2467,7 @@ impl BatchBuilder {

                let blend_mode = if !prim_data.opacity.is_opaque ||
                    prim_info.clip_task_index != ClipTaskIndex::INVALID ||
                    transform_kind == TransformedRectKind::Complex ||
                    prim_instance.anti_aliased
                    transform_kind == TransformedRectKind::Complex
                {
                    BlendMode::PremultipliedAlpha
                } else {
@@ -2520,7 +2500,6 @@ impl BatchBuilder {
                        &batch_params,
                        blend_mode,
                        batch_features,
                        brush_flags,
                        prim_header_index,
                        bounding_rect,
                        transform_kind,
@@ -2560,7 +2539,7 @@ impl BatchBuilder {
                            INVALID_SEGMENT_INDEX,
                            EdgeAaSegmentMask::all(),
                            clip_task_address,
                            brush_flags | BrushFlags::PERSPECTIVE_INTERPOLATION,
                            BrushFlags::PERSPECTIVE_INTERPOLATION,
                            prim_header_index,
                            0,
                        );
@@ -2598,8 +2577,7 @@ impl BatchBuilder {

                let blend_mode = if !common_data.opacity.is_opaque ||
                    prim_info.clip_task_index != ClipTaskIndex::INVALID ||
                    transform_kind == TransformedRectKind::Complex ||
                    prim_instance.anti_aliased
                    transform_kind == TransformedRectKind::Complex
                {
                    BlendMode::PremultipliedAlpha
                } else {
@@ -2634,7 +2612,6 @@ impl BatchBuilder {
                        &batch_params,
                        blend_mode,
                        batch_features,
                        brush_flags,
                        prim_header_index,
                        bounding_rect,
                        transform_kind,
@@ -2676,7 +2653,7 @@ impl BatchBuilder {
                            INVALID_SEGMENT_INDEX,
                            EdgeAaSegmentMask::all(),
                            clip_task_address,
                            brush_flags | BrushFlags::PERSPECTIVE_INTERPOLATION,
                            BrushFlags::PERSPECTIVE_INTERPOLATION,
                            prim_header_index,
                            uv_rect_address.as_int(),
                        );
@@ -2715,8 +2692,7 @@ impl BatchBuilder {

                let blend_mode = if !common_data.opacity.is_opaque ||
                    prim_info.clip_task_index != ClipTaskIndex::INVALID ||
                    transform_kind == TransformedRectKind::Complex ||
                    prim_instance.anti_aliased
                    transform_kind == TransformedRectKind::Complex
                {
                    BlendMode::PremultipliedAlpha
                } else {
@@ -2751,7 +2727,6 @@ impl BatchBuilder {
                        &batch_params,
                        blend_mode,
                        batch_features,
                        brush_flags,
                        prim_header_index,
                        bounding_rect,
                        transform_kind,
@@ -2793,7 +2768,7 @@ impl BatchBuilder {
                            INVALID_SEGMENT_INDEX,
                            EdgeAaSegmentMask::all(),
                            clip_task_address,
                            brush_flags | BrushFlags::PERSPECTIVE_INTERPOLATION,
                            BrushFlags::PERSPECTIVE_INTERPOLATION,
                            prim_header_index,
                            uv_rect_address.as_int(),
                        );
@@ -2833,8 +2808,7 @@ impl BatchBuilder {

                let blend_mode = if !common_data.opacity.is_opaque ||
                    prim_info.clip_task_index != ClipTaskIndex::INVALID ||
                    transform_kind == TransformedRectKind::Complex ||
                    prim_instance.anti_aliased
                    transform_kind == TransformedRectKind::Complex
                {
                    BlendMode::PremultipliedAlpha
                } else {
@@ -2869,7 +2843,6 @@ impl BatchBuilder {
                        &batch_params,
                        blend_mode,
                        batch_features,
                        brush_flags,
                        prim_header_index,
                        bounding_rect,
                        transform_kind,
@@ -2911,7 +2884,7 @@ impl BatchBuilder {
                            INVALID_SEGMENT_INDEX,
                            EdgeAaSegmentMask::all(),
                            clip_task_address,
                            brush_flags | BrushFlags::PERSPECTIVE_INTERPOLATION,
                            BrushFlags::PERSPECTIVE_INTERPOLATION,
                            prim_header_index,
                            uv_rect_address.as_int(),
                        );
@@ -2966,7 +2939,7 @@ impl BatchBuilder {
                    INVALID_SEGMENT_INDEX,
                    EdgeAaSegmentMask::empty(),
                    OPAQUE_TASK_ADDRESS,
                    brush_flags,
                    BrushFlags::empty(),
                    prim_header_index,
                    backdrop_uv_rect_address.as_int(),
                );
@@ -2984,7 +2957,6 @@ impl BatchBuilder {
        prim_header_index: PrimitiveHeaderIndex,
        alpha_blend_mode: BlendMode,
        features: BatchFeatures,
        brush_flags: BrushFlags,
        bounding_rect: &PictureRect,
        transform_kind: TransformedRectKind,
        z_id: ZBufferId,
@@ -3006,8 +2978,7 @@ impl BatchBuilder {
            let is_inner = segment.edge_flags.is_empty();
            let needs_blending = !prim_opacity.is_opaque ||
                                 clip_task_address != OPAQUE_TASK_ADDRESS ||
                                 (!is_inner && transform_kind == TransformedRectKind::Complex) ||
                                 brush_flags.contains(BrushFlags::FORCE_AA);
                                 (!is_inner && transform_kind == TransformedRectKind::Complex);

            let textures = BatchTextures {
                input: segment_data.textures,
@@ -3028,7 +2999,7 @@ impl BatchBuilder {
                segment_index,
                segment.edge_flags,
                clip_task_address,
                brush_flags | BrushFlags::PERSPECTIVE_INTERPOLATION | segment.brush_flags,
                BrushFlags::PERSPECTIVE_INTERPOLATION | segment.brush_flags,
                prim_header_index,
                segment_data.specific_resource_address,
            );
@@ -3043,7 +3014,6 @@ impl BatchBuilder {
        params: &BrushBatchParameters,
        blend_mode: BlendMode,
        features: BatchFeatures,
        brush_flags: BrushFlags,
        prim_header_index: PrimitiveHeaderIndex,
        bounding_rect: &PictureRect,
        transform_kind: TransformedRectKind,
@@ -3070,7 +3040,6 @@ impl BatchBuilder {
                        prim_header_index,
                        blend_mode,
                        features,
                        brush_flags,
                        bounding_rect,
                        transform_kind,
                        z_id,
@@ -3096,7 +3065,6 @@ impl BatchBuilder {
                        prim_header_index,
                        blend_mode,
                        features,
                        brush_flags,
                        bounding_rect,
                        transform_kind,
                        z_id,
@@ -3135,7 +3103,7 @@ impl BatchBuilder {
                    INVALID_SEGMENT_INDEX,
                    EdgeAaSegmentMask::all(),
                    clip_task_address,
                    brush_flags | BrushFlags::PERSPECTIVE_INTERPOLATION,
                    BrushFlags::PERSPECTIVE_INTERPOLATION,
                    prim_header_index,
                    segment_data.specific_resource_address,
                );
+3 −9
Original line number Diff line number Diff line
@@ -545,15 +545,12 @@ impl From<SplitCompositeInstance> for PrimitiveInstanceData {
}

bitflags! {
    // Note: This can use up to 12 bits due to how it will
    // be packed in the instance data.

    /// Flags that define how the common brush shader
    /// code should process this instance.
    #[cfg_attr(feature = "capture", derive(Serialize))]
    #[cfg_attr(feature = "replay", derive(Deserialize))]
    #[derive(MallocSizeOf)]
    pub struct BrushFlags: u16 {
    pub struct BrushFlags: u8 {
        /// Apply perspective interpolation to UVs
        const PERSPECTIVE_INTERPOLATION = 1;
        /// Do interpolation relative to segment rect,
@@ -571,9 +568,6 @@ bitflags! {
        const SEGMENT_NINEPATCH_MIDDLE = 64;
        /// The extra segment data is a texel rect.
        const SEGMENT_TEXEL_RECT = 128;
        /// Whether to force the anti-aliasing when the primitive
        /// is axis-aligned.
        const FORCE_AA = 256;
    }
}

@@ -596,8 +590,8 @@ impl From<BrushInstance> for PrimitiveInstanceData {
                ((instance.render_task_address.0 as i32) << 16)
                | instance.clip_task_address.0 as i32,
                instance.segment_index
                | ((instance.brush_flags.bits() as i32) << 16)
                | ((instance.edge_flags.bits() as i32) << 28),
                | ((instance.edge_flags.bits() as i32) << 16)
                | ((instance.brush_flags.bits() as i32) << 24),
                instance.resource_address,
            ]
        }
+0 −3
Original line number Diff line number Diff line
@@ -60,9 +60,6 @@ use smallvec::SmallVec;
const MAX_SEGMENTS: usize = 64;

bitflags! {
    // Note: This can use up to 4 bits due to how it will be packed in
    // the instance data.

    /// Each bit of the edge AA mask is:
    /// 0, when the edge of the primitive needs to be considered for AA
    /// 1, when the edge of the segment needs to be considered for AA
+4 −4

File changed.

Contains only whitespace changes.

Loading