RESOLVED DUPLICATE of bug 198746 198779
[cairo][SVG] If clipPath has multiple elements, clip-path coordinate system is wrongly scaled in high DPI
https://bugs.webkit.org/show_bug.cgi?id=198779
Summary [cairo][SVG] If clipPath has multiple elements, clip-path coordinate system i...
Fujii Hironori
Reported 2019-06-11 21:00:56 PDT
Created attachment 371919 [details] test case [cairo][SVG] If clipPath has multiple elements, clip-path coordinate system is wrongly scaled in high DPI This test case is created by doubling a rect element in clipPath element of svg/foreignObject/clip.html.
Attachments
test case (582 bytes, text/html)
2019-06-11 21:00 PDT, Fujii Hironori
no flags
[Screenshot] WinCairo port in 150% DPI display (7.69 KB, image/png)
2019-06-11 21:06 PDT, Fujii Hironori
no flags
WIP patch (926 bytes, patch)
2019-06-11 21:49 PDT, Fujii Hironori
no flags
Fujii Hironori
Comment 1 2019-06-11 21:06:17 PDT
Created attachment 371920 [details] [Screenshot] WinCairo port in 150% DPI display
Fujii Hironori
Comment 2 2019-06-11 21:49:43 PDT
Created attachment 371925 [details] WIP patch
Carlos Garcia Campos
Comment 3 2019-06-12 03:05:15 PDT
Comment on attachment 371925 [details] WIP patch View in context: https://bugs.webkit.org/attachment.cgi?id=371925&action=review > Source/WebCore/platform/graphics/cairo/PlatformContextCairo.cpp:88 > + // Reset the current matrix because the mask surface doesn't have a matrix. > + cairo_matrix_t matrix; > + cairo_get_matrix(m_cr.get(), &matrix); > + cairo_identity_matrix(m_cr.get()); > cairo_mask_surface(m_cr.get(), maskInformation.maskSurface(), maskRect.x(), maskRect.y()); > + cairo_set_matrix(m_cr.get(), &matrix); This works for svg, but not for other users of GraphicsContext::clipToImageBuffer() like shadow blur, for example. It seems that svg is the only one using absolute coordinates. Removing: AffineTransform absoluteTransform = SVGRenderingContext::calculateTransformationToOutermostCoordinateSystem(renderer); from RenderSVGResourceClipper::applyClippingToContext and using the identity fixes the test case too. Or keeping the absolute transform but setting the device scale factor in the image buffer cairo surface.
Carlos Garcia Campos
Comment 4 2019-06-12 03:14:21 PDT
You can try with fast/box-shadow/box-shadow-transformed.html for example
Carlos Garcia Campos
Comment 5 2019-06-12 06:41:02 PDT
*** This bug has been marked as a duplicate of bug 198746 ***
Note You need to log in before you can comment on or make changes to this bug.