[webkit] [9] Review request for 8160769: [WebView] Unable to tile SVG image using css background property

Arunprasad Rajkumar arunprasad.rajkumar at oracle.com
Wed Jul 13 10:58:30 UTC 2016


Hello Guru, Alexander Z, Murali,

Please review the following fix.

JIRA: https://bugs.openjdk.java.net/browse/JDK-8160769

Webrev: http://cr.openjdk.java.net/~arajkumar/8160769/webrev.00

Issue: Unable to tile SVG image using css background property

Analysis: For tiled SVG image drawing, WebCore creates a temporary 
Graphics buffer(ImageBufferJava)[1] and renders SVG contents into it. 
Once the SVG is rendered in the temporary graphics buffer, WebCore will 
call Image::drawPattern to tile it on the WebPage's back buffer. As soon 
as drawing is completed, temporary graphics buffer will be destroyed.

FX WebView's GraphicsContext APIs are asynchronous in nature(rendered in 
FX render thread using RenderQueue), so temporary graphics buffer would 
have been destroyed even before rendering the SVG content into it. At 
later point of time, when Image::drawPattern is executed in render 
thread, it will be accessing a GraphicsContext of an destroyed object.

Solution: Before destroying an Native ImageBuffer, flush all its render 
queue commands synchronously, So that it's content will be rendered as 
expected.

[1] 
http://trac.webkit.org/browser/trunk/Source/WebCore/svg/graphics/SVGImage.cpp?rev=187486#L202

Regards,
Arun


More information about the openjfx-dev mailing list