Reject fractional Slug replay for direct masks when atlas bilerp is unsupported
When fSupportBilerpFromGlyphAtlas is false (e.g. Chrome's configuration),
direct-mask glyphs are packed in the shared TextAtlasManager with 0
padding. Replaying a Slug with a fractional translation or incompatible
matrix causes sampling outside the glyph's atlas boundaries under MSAA,
leaking neighboring glyph texels across origins.
1. Promote Slug matrix validation to release mode via SlugImpl::canDraw
in both Ganesh and Graphite Device::drawSlug, dropping draws when
the matrix difference includes non-integer translation or transform
without atlas bilerp support.
2. In VertexFiller::boundsAndDeviceMatrix, return empty bounds for direct
masks when supportBilerpAtlas is false and the transform is not an
integer translation, dropping the draw and preventing any fractional
maskToDevice from reaching the GPU.
3. Add unit tests for VertexFiller::boundsAndDeviceMatrix and end-to-end
fractional Slug replay validation in Ganesh and Graphite.
Bug: 576950618
Change-Id: I4d28a5e831b8e870b8377ba231c67c03567f0e76
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1405797
Reviewed-by: Thomas Smith <thomsmit@google.com>
Reviewed-by: Nathan Sanchez <nathanasanchez@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
7 files changed