Commit 42ef0ea1 authored by Glenn Watson's avatar Glenn Watson
Browse files

Bug 1830588 - Fix clip on fractional composite prims r=gfx-reviewers,lsalzman

Also add a test and re-enable the new clip-mask code paths.

Differential Revision: https://phabricator.services.mozilla.com/D178614
parent c0c95c1a
Loading
Loading
Loading
Loading
+4 −8
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ use crate::render_task_cache::{RenderTaskCacheKey, to_cache_size, RenderTaskPare
use crate::render_task::{RenderTaskKind, RenderTask};
use crate::renderer::{GpuBufferBuilder, GpuBufferAddress};
use crate::segment::{EdgeAaSegmentMask, SegmentBuilder};
use crate::util::{clamp_to_scale_factor, pack_as_float, MaxRect};
use crate::util::{clamp_to_scale_factor, pack_as_float};
use crate::visibility::{compute_conservative_visible_rect, PrimitiveVisibility, VisibilityState};


@@ -108,8 +108,8 @@ fn can_use_clip_chain_for_quad_path(
    clip_chain: &ClipChainInstance,
    prim_spatial_node_index: SpatialNodeIndex,
    raster_spatial_node_index: SpatialNodeIndex,
    _clip_store: &ClipStore,
    _data_stores: &DataStores,
    clip_store: &ClipStore,
    data_stores: &DataStores,
    spatial_tree: &SpatialTree,
) -> bool {
    let map_prim_to_surface = spatial_tree.get_relative_transform(
@@ -123,12 +123,9 @@ fn can_use_clip_chain_for_quad_path(
        return false;
    }

    !clip_chain.needs_mask

    // TODO(gw): Temporarily disable the new clip-mask rendering path for now, while
    //           investigating a driver-specific shader optimization regression.

    /*
    if !clip_chain.needs_mask {
        return true;
    }
@@ -161,7 +158,6 @@ fn can_use_clip_chain_for_quad_path(
    }

    true
    */
}

#[derive(Debug, Copy, Clone)]
@@ -2006,7 +2002,7 @@ fn add_composite_prim(
    let composite_prim_address = write_prim_blocks(
        frame_state.frame_gpu_data,
        rect,
        LayoutRect::max_rect(),
        rect,
        color,
        segments,
    );
+1.98 KiB
Loading image diff...
+21 −0
Original line number Diff line number Diff line
---
root:
  items:
    - bounds: 0 0 450 400
      type: rect
      color: white
    - type: stacking-context
      bounds: 50.0 50.0 0 0
      transform: [0.9999767, 8.142047e-6, 0.0, 0.0, 1.6284093e-5, 0.9999767, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0019226074, 0.0019683838, 0.0, 1.0]
      items:
        - type: stacking-context
          items:
            - type: clip
              id: 3
              complex:
                - rect: [0, 0, 375, 300]
                  radius: 12
            - type: rect
              bounds: 0 0 375 300
              color: red
              clip-chain: [3]
+1 −0
Original line number Diff line number Diff line
skip_on(android) fuzzy(1,1) fuzzy-if(platform(swgl),4,27) == rounded-rects.yaml rounded-rects-ref.png  # Too wide for Android
== aa-dist-bug.yaml aa-dist-bug-ref.yaml
fuzzy-if(env(android,device),6,792) == fractional-radii.yaml fractional-radii-ref.yaml
platform(linux) == fractional-nine-patch.yaml fractional-nine-patch.png
−12 B (19.1 KiB)
Loading image diff...
Loading