[Cairo] Crash in GraphicsContext::drawFocusRing when painting is disabled
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Apr 2016 08:47:45 +0000 (08:47 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Apr 2016 08:47:45 +0000 (08:47 +0000)
commite4b5cc476310896dfa4cb58f1d36e156451851e3
tree1a2db66f9f8ce49c1e236618792f5b296af45cba
parenta1830dde57b204d9e58eb14dab2fcd8bfccbb3e7
[Cairo] Crash in GraphicsContext::drawFocusRing when painting is disabled
https://bugs.webkit.org/show_bug.cgi?id=156785

Reviewed by Žan Doberšek.

This happens for example when view state changes to focus and paint is called from
FrameView::updateControlTints() with a graphics context that doesn't have a platform context. Layout test
fast/images/image-map-outline-with-scale-transform.html sometimes crashes because of this.

* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::drawFocusRing): Return early if painting is disabled.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199769 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/cairo/GraphicsContextCairo.cpp