The translation of the pattern causes a offset of the left exclamation mark. This is caused by the transformation of the context. Paths are not transformed by changing the CTM. We should make something similuar for texts, or change the way we transform patterns.
Patterns have the same problem as the REGRESSION on gradients (https://bugs.webkit.org/show_bug.cgi?id=23547). The transformation of the pattern is applied to the CTM. This causes strange transformations of the text, or unwanted stroke thikness, depending on the transformation. Stroke thickness is only influenced by scaling skewing or a transformationmatrix that scales or skewes. We need a general redesign here, to get both fixed, gradients as well as patterns and to minimize code snippets for both.
Created attachment 27099 [details] Transformed pattern on text
Created attachment 27100 [details] scaled patttern on stroke The stroke should be small line.
Created attachment 27115 [details] transform the pattern instead of the context Just transform the pattern instead of the context. Texts and strokes are no longer affected by pattern transformations.
Looks fine to me, after a lengthy discussion on IRC. Eric should have a final look. Some namings need to change, Pattern::setTransform, should get a better name (so it's visible it's a pattern-space transformation), and 'patternMatrix' should be renamed to sth like 'userSpaceTransformation' - to not confuse anyone with two matrices with nearly equal names.
Created attachment 27163 [details] transform the pattern instead of the context renamed components
Comment on attachment 27163 [details] transform the pattern instead of the context Looks nice, some comments: > + // Pattern space is an abstract space that maps to the default user space by the transformation matrix > + // you specify with the userSpaceTransformation parameter. > + PlatformPatternPtr createPlatformPattern(const TransformationMatrix& userSpaceTransformation) const; I'd shorten the comment: > + // Pattern space is an abstract space that maps to the default user space by the transformation 'userSpaceTransformation' Just leave out the comment for setPatternSpaceTransform, and make the argument 'const TransformationMatrix&'. > + void setPatternSpaceTransform(TransformationMatrix patternSpaceTransformation) { m_patternSpaceTransformation = patternSpaceTransformation; } r=me with thse fixups.
landed in r40379