Skip to content

Raster cache's integral translation snapping is broken #53288

@liyuqian

Description

@liyuqian

We tried to snap the picture layer and its raster cache's translation/offset to integer points for both performance and quality considerations. (See this line of code.)

However, we made a mistake: the fractional scale of SkMatrix will be applied to the picture's original offset. So if it has a non-zero original offset, say an integral x translation of 3, and the matrix has a fractional x scale of 1.5, they would result in final x translation of 4.5. Please check the unit test added in flutter/engine#17278 for a concrete example.

Since we've never run into performance or quality issues while we did this wrong, I felt that maybe we can just remove the integer snapping logic. It will also solve #41654. Note that we previously still drew the raster cache with integral offsets because we're using a rounded-out SkIRect to determine the location of the raster cache.

Metadata

Metadata

Assignees

Labels

c: renderingUI glitches reported at the engine/skia or impeller rendering levelengineflutter/engine related. See also e: labels.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions