RenderStyle should use copy-on-write inheritance for NinePieceImage.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 10 Feb 2013 16:04:43 +0000 (16:04 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 10 Feb 2013 16:04:43 +0000 (16:04 +0000)
commiteb848fb0b3c9adaed3b0fb706056e6edde8081e0
tree5b7062c35077563996cc85f1698852792d4b39a1
parente09970d0b25e5ffbd9e1dc0e83e740af4cf7e350
RenderStyle should use copy-on-write inheritance for NinePieceImage.
<http://webkit.org/b/109366>

Reviewed by Antti Koivisto.

Refactor NinePieceImage to hold a copy-on-write DataRef like other RenderStyle substructures.
This allows us to avoids copying the NinePieceImageData when one RenderStyle inherits from another
but modifies something in the substructure holding the NinePieceImage (typically StyleSurroundData.)

Also made RenderStyle not copy-on-write its StyleSurroundData prematurely when doing a no-op write
to a border-image related value.

1.23 MB progression on Membuster3.

* rendering/style/NinePieceImage.cpp:
(WebCore::defaultData):
(WebCore::NinePieceImage::NinePieceImage):
(WebCore::NinePieceImageData::NinePieceImageData):
(WebCore::NinePieceImageData::operator==):
* rendering/style/NinePieceImage.h:
(WebCore::NinePieceImageData::create):
(WebCore::NinePieceImageData::copy):
(NinePieceImageData):
(NinePieceImage):
(WebCore::NinePieceImage::operator==):
(WebCore::NinePieceImage::operator!=):
(WebCore::NinePieceImage::hasImage):
(WebCore::NinePieceImage::image):
(WebCore::NinePieceImage::setImage):
(WebCore::NinePieceImage::imageSlices):
(WebCore::NinePieceImage::setImageSlices):
(WebCore::NinePieceImage::fill):
(WebCore::NinePieceImage::setFill):
(WebCore::NinePieceImage::borderSlices):
(WebCore::NinePieceImage::setBorderSlices):
(WebCore::NinePieceImage::outset):
(WebCore::NinePieceImage::setOutset):
(WebCore::NinePieceImage::horizontalRule):
(WebCore::NinePieceImage::setHorizontalRule):
(WebCore::NinePieceImage::verticalRule):
(WebCore::NinePieceImage::setVerticalRule):
(WebCore::NinePieceImage::copyImageSlicesFrom):
(WebCore::NinePieceImage::copyBorderSlicesFrom):
(WebCore::NinePieceImage::copyOutsetFrom):
(WebCore::NinePieceImage::copyRepeatFrom):
(WebCore::NinePieceImage::setMaskDefaults):
(WebCore::NinePieceImage::computeOutset):
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::setBorderImageSource):
(WebCore::RenderStyle::setBorderImageSlices):
(WebCore::RenderStyle::setBorderImageWidth):
(WebCore::RenderStyle::setBorderImageOutset):
* rendering/style/RenderStyle.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@142404 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/rendering/style/NinePieceImage.cpp
Source/WebCore/rendering/style/NinePieceImage.h
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebCore/rendering/style/RenderStyle.h