Tiling CSS gradients is slow
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Oct 2018 19:00:03 +0000 (19:00 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 17 Oct 2018 19:00:03 +0000 (19:00 +0000)
commit56b0faadc1f072a8420f53795ecfd6af595143b9
tree66e15c94db04e78c88bacb28e41638f915d9a9a2
parenta5422a9b62ee962b866f06485f85000ffb5fc6e7
Tiling CSS gradients is slow
https://bugs.webkit.org/show_bug.cgi?id=190615

Reviewed by Tim Horton.

Painting blocks the main thread on CG rendering queue to make a copy of the backing store.

* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::drawPattern):

Also use sinkIntoImage for bitmap image pattern drawing.

* platform/graphics/GradientImage.cpp:
(WebCore::GradientImage::drawPattern):

Sink the gradient into an Image after generating it. Unlike ImageBuffer, painting it doesn't involve inefficient copies.
Previous isCompatibleWithContext test is replaced with an equivalent scale factor test.

* platform/graphics/GradientImage.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237230 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/BitmapImage.cpp
Source/WebCore/platform/graphics/GradientImage.cpp
Source/WebCore/platform/graphics/GradientImage.h