[Cairo] Null-check cairo_pattern_t gradient objects
authorzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 22 Sep 2018 12:54:45 +0000 (12:54 +0000)
committerzandobersek@gmail.com <zandobersek@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 22 Sep 2018 12:54:45 +0000 (12:54 +0000)
commit15f369c0025e8d17f4caf49f3fa613ae7d2bd076
tree8b0154874dba0141315a33e662c0f4c547535e8e
parente998b2baa49a2f16134174c1c8d1873cbf22025d
[Cairo] Null-check cairo_pattern_t gradient objects
https://bugs.webkit.org/show_bug.cgi?id=189820

Reviewed by Alex Christensen.

Cairo-specific implementation of Gradient::createPlatformGradient() can
now return a nullptr value when a conic gradient is described by the
Gradient object. Cairo doesn't have a way to create cairo_pattern_t
objects for such gradients.

Null-checks are now done on return values of createPlatformGradient(),
in order to avoid proceeding to paint a null cairo_pattern_t object.

* platform/graphics/cairo/GradientCairo.cpp:
(WebCore::Gradient::fill):
* platform/graphics/cairo/GraphicsContextImplCairo.cpp:
(WebCore::GraphicsContextImplCairo::fillRect):

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