Use static const global variable for TransformationMatrix instead of NeverDestroyed
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Jul 2018 16:31:47 +0000 (16:31 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 31 Jul 2018 16:31:47 +0000 (16:31 +0000)
commitf158cd0b483f5019e8bbad8a76000fc711303e4f
tree5ea36c6bbc95a4ec4892e06373bcdf9d0327fc23
parentd015a149ee62a22b259c6b0361244878149cc0d2
Use static const global variable for TransformationMatrix instead of NeverDestroyed
https://bugs.webkit.org/show_bug.cgi?id=188195

Reviewed by Darin Adler.

Since TransformationMatrix does not have a non-trivial destructor, we can put it
as static const global variable if its constructor is constexpr. This patch makes
some of constructors constexpr and makes identityTransform static const global variable
instead of NeverDestroyed<> + static function. This removes unnecessary static function
and lazy initialization.

No behavior change.

* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::transform const):
(WebCore::GraphicsLayer::childrenTransform const):
(WebCore::identityTransform): Deleted.
* platform/graphics/transforms/TransformationMatrix.h:
(WebCore::TransformationMatrix::TransformationMatrix):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234427 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/GraphicsLayer.cpp
Source/WebCore/platform/graphics/transforms/TransformationMatrix.h