Restore FillMask logic

Per discussion, don't remove FillMask until we get unbounded clip stacks.
This commit is contained in:
Raph Levien 2020-11-21 07:00:03 -08:00
parent d14895b107
commit 13134e7cb3

View file

@ -169,6 +169,8 @@ void main() {
uint tile_count; uint tile_count;
switch (tag) { switch (tag) {
case Annotated_Fill: case Annotated_Fill:
case Annotated_FillMask:
case Annotated_FillMaskInv:
case Annotated_Stroke: case Annotated_Stroke:
case Annotated_BeginClip: case Annotated_BeginClip:
case Annotated_EndClip: case Annotated_EndClip:
@ -308,6 +310,27 @@ void main() {
Cmd_EndClip_write(cmd_ref, CmdEndClip(1.0)); Cmd_EndClip_write(cmd_ref, CmdEndClip(1.0));
cmd_ref.offset += Cmd_size; cmd_ref.offset += Cmd_size;
break; break;
case Annotated_FillMask:
case Annotated_FillMaskInv:
tile = Tile_read(TileRef(sh_tile_base[element_ref_ix]
+ (sh_tile_stride[element_ref_ix] * tile_y + tile_x) * Tile_size));
AnnoFillMask fill_mask = Annotated_FillMask_read(ref);
alloc_cmd(cmd_ref, cmd_limit);
if (tile.tile.offset != 0) {
CmdFillMask cmd_fill;
cmd_fill.tile_ref = tile.tile.offset;
cmd_fill.backdrop = tile.backdrop;
cmd_fill.mask = fill_mask.mask;
if (tag == Annotated_FillMask) {
Cmd_FillMask_write(cmd_ref, cmd_fill);
} else {
Cmd_FillMaskInv_write(cmd_ref, cmd_fill);
}
} else {
Cmd_SolidMask_write(cmd_ref, CmdSolidMask(fill_mask.mask));
}
cmd_ref.offset += Cmd_size;
break;
case Annotated_Stroke: case Annotated_Stroke:
tile = Tile_read(TileRef(sh_tile_base[element_ref_ix] tile = Tile_read(TileRef(sh_tile_base[element_ref_ix]
+ (sh_tile_stride[element_ref_ix] * tile_y + tile_x) * Tile_size)); + (sh_tile_stride[element_ref_ix] * tile_y + tile_x) * Tile_size));