Shrink BorderValue.
authorandreas.kling@nokia.com <andreas.kling@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Oct 2011 16:24:31 +0000 (16:24 +0000)
committerandreas.kling@nokia.com <andreas.kling@nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Oct 2011 16:24:31 +0000 (16:24 +0000)
commit79d63d8a4a0f85f9cc06c77c992a27803c69a4d3
tree9f5acddab0a2e36e08e4a3197c8d56a18f88ed5e
parent3356d9d49d0345e4f91cef96557a7cf188a858c9
Shrink BorderValue.
https://bugs.webkit.org/show_bug.cgi?id=69521

Reviewed by Antti Koivisto.

Unroll BorderValue's Color member so we can pack the color's validity flag
in BorderValue's bitfield.

This shrinks BorderValue by 32 bit, which in turn shrinks BorderData by
16 bytes. This reduces memory consumption by 760 kB when loading the full
HTML5 spec.

* platform/graphics/Color.h:
(WebCore::Color::Color):

    Allow construction of Color objects with specific validity.

* rendering/style/BorderValue.h:
(WebCore::BorderValue::BorderValue):
(WebCore::BorderValue::isTransparent):
(WebCore::BorderValue::operator==):
(WebCore::BorderValue::setColor):
(WebCore::BorderValue::color):
* rendering/style/OutlineValue.h:
(WebCore::OutlineValue::operator==):

    Unroll m_color into BorderValue by splitting it into an RGBA32 and a bool.
    Made those variables private and added color(), setColor() accessors.

* rendering/style/RenderStyle.h:
(WebCore::InheritedFlags::setBorderLeftColor):
(WebCore::InheritedFlags::setBorderRightColor):
(WebCore::InheritedFlags::setBorderTopColor):
(WebCore::InheritedFlags::setBorderBottomColor):
(WebCore::InheritedFlags::setOutlineColor):
(WebCore::InheritedFlags::setColumnRuleColor):

    Added a SET_BORDERVALUE_COLOR macro and use that instead of SET_VAR
    when setting BorderValue colors.

(WebCore::InheritedFlags::fillPaintColor):
(WebCore::InheritedFlags::strokePaintColor):
(WebCore::InheritedFlags::borderLeftColor):
(WebCore::InheritedFlags::borderRightColor):
(WebCore::InheritedFlags::borderTopColor):
(WebCore::InheritedFlags::borderBottomColor):
(WebCore::InheritedFlags::backgroundColor):
(WebCore::InheritedFlags::color):
(WebCore::InheritedFlags::columnRuleColor):
(WebCore::InheritedFlags::outlineColor):
(WebCore::InheritedFlags::textEmphasisColor):
(WebCore::InheritedFlags::textFillColor):
(WebCore::InheritedFlags::textStrokeColor):
(WebCore::InheritedFlags::stopColor):
(WebCore::InheritedFlags::floodColor):
(WebCore::InheritedFlags::lightingColor):

    Made color getters return "Color" instead of "const Color&" since
    BorderValue no longer has an actual object to return the reference to.

* css/CSSStyleApplyProperty.cpp:
(WebCore::ApplyPropertyColor::applyInheritValue):
* page/animation/AnimationBase.cpp:
(WebCore::PropertyWrapperColor::PropertyWrapperColor):
(WebCore::PropertyWrapperColor::blend):
(WebCore::PropertyWrapperMaybeInvalidColor::PropertyWrapperMaybeInvalidColor):
(WebCore::PropertyWrapperSVGPaint::PropertyWrapperSVGPaint):
(WebCore::AnimationBase::ensurePropertyMap):

    Adapt to RenderStyle color getters now returning "Color" instead of
    "const Color&".

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@96944 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/css/CSSStyleApplyProperty.cpp
Source/WebCore/page/animation/AnimationBase.cpp
Source/WebCore/platform/graphics/Color.h
Source/WebCore/rendering/style/BorderValue.h
Source/WebCore/rendering/style/OutlineValue.h
Source/WebCore/rendering/style/RenderStyle.h