Shrink GraphicsLayer by making m_transform and m_childrenTransform be unique_ptrs
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Jul 2018 16:36:42 +0000 (16:36 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 30 Jul 2018 16:36:42 +0000 (16:36 +0000)
commitd51ceb315843fc395d991a375740937995499b01
treea78828c09b3d04419ad47a160f82dfbb4d2d75fa
parent1f0715017341f39a175682f750c0f54ba1ec6f64
Shrink GraphicsLayer by making m_transform and m_childrenTransform be unique_ptrs
https://bugs.webkit.org/show_bug.cgi?id=188143

Reviewed by Zalan Bujtas.

m_transform and m_childrenTransform are usually identity; save space by making
these unique_ptrs. The getters still return references by returning a reference
to a NeverDestroyed<TransformationMatrix> if necessary.

Shrinks GraphicsLayerCA from 840 to 640 bytes.

* platform/graphics/GraphicsLayer.cpp:
(WebCore::identityTransform):
(WebCore::GraphicsLayer::transform const):
(WebCore::GraphicsLayer::setTransform):
(WebCore::GraphicsLayer::childrenTransform const):
(WebCore::GraphicsLayer::setChildrenTransform):
(WebCore::GraphicsLayer::dumpProperties const):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::hasNonIdentityTransform const):
(WebCore::GraphicsLayer::hasNonIdentityChildrenTransform const):
(WebCore::GraphicsLayer::transform const): Deleted.
(WebCore::GraphicsLayer::setTransform): Deleted.
(WebCore::GraphicsLayer::childrenTransform const): Deleted.
(WebCore::GraphicsLayer::setChildrenTransform): Deleted.
(WebCore::GraphicsLayer::hasFlattenedPerspectiveTransform): Deleted. It was unused.
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setTransform):
(WebCore::GraphicsLayerCA::setChildrenTransform):
(WebCore::GraphicsLayerCA::layerTransform const):
(WebCore::GraphicsLayerCA::updateTransform):
(WebCore::GraphicsLayerCA::updateChildrenTransform):
(WebCore::GraphicsLayerCA::removeCAAnimationFromLayer):

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