Skip to content

Raster cache bleeding to adjacent pixels #110002

@knopp

Description

@knopp

Happens after integer CTM removal. Video:

RasterCacheBleeding.mov

Code to reproduce:

class HomeScreen extends StatefulWidget {
  const HomeScreen({Key key}) : super(key: key);

  @override
  _HomeScreenState createState() => _HomeScreenState();
}

class _HomeScreenState extends State<HomeScreen> {
  @override
  Widget build(BuildContext context) {
    return Container(
      color: Colors.white,
      child: ListView(
        children: [
          Container(
            height: 150,
          ),
          SizedBox.fromSize(
            size: const Size(100, 100.1),
            child: Container(
              color: Colors.black,
              child: FlutterLogo(), // force raster caching
            ),
          ),
        ],
      ),
    );
  }
}

The issue is that compared to original layer bounds, raster cache surface dimensions are rounded up to physical pixels. Drawing surface like this on subpixel coordinates can occasionally bleed slightly to adjacent physical pixels, which would be otherwise unaffected (glitch disappears when FlutterLogo is removed).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions