Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1148)

Unified Diff: Source/core/rendering/style/StyleRareInheritedData.h

Issue 196103013: Pack StyleColor members in StyleRareInheritedData tighter to save memory (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix initial isCurrentColor valuse Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/style/RenderStyle.cpp ('k') | Source/core/rendering/style/StyleRareInheritedData.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/style/StyleRareInheritedData.h
diff --git a/Source/core/rendering/style/StyleRareInheritedData.h b/Source/core/rendering/style/StyleRareInheritedData.h
index b4d080e1a9e54dadf6e86a09c134a252a25594c4..8328781f6e0a3585ea9a8a1ef5e7829f52dbaf17 100644
--- a/Source/core/rendering/style/StyleRareInheritedData.h
+++ b/Source/core/rendering/style/StyleRareInheritedData.h
@@ -58,14 +58,28 @@ public:
RefPtr<StyleImage> listStyleImage;
- StyleColor textStrokeColor;
+ StyleColor textStrokeColor() const { return m_textStrokeColorIsCurrentColor ? StyleColor::currentColor() : StyleColor(m_textStrokeColor); }
+ StyleColor textFillColor() const { return m_textFillColorIsCurrentColor ? StyleColor::currentColor() : StyleColor(m_textFillColor); }
+ StyleColor textEmphasisColor() const { return m_textEmphasisColorIsCurrentColor ? StyleColor::currentColor() : StyleColor(m_textEmphasisColor); }
+ StyleColor visitedLinkTextStrokeColor() const { return m_visitedLinkTextStrokeColorIsCurrentColor ? StyleColor::currentColor() : StyleColor(m_visitedLinkTextStrokeColor); }
+ StyleColor visitedLinkTextFillColor() const { return m_visitedLinkTextFillColorIsCurrentColor ? StyleColor::currentColor() : StyleColor(m_visitedLinkTextFillColor); }
+ StyleColor visitedLinkTextEmphasisColor() const { return m_visitedLinkTextEmphasisColorIsCurrentColor ? StyleColor::currentColor() : StyleColor(m_visitedLinkTextEmphasisColor); }
+
+ void setTextStrokeColor(const StyleColor& color) { m_textStrokeColor = color.resolve(Color()); m_textStrokeColorIsCurrentColor = color.isCurrentColor(); }
+ void setTextFillColor(const StyleColor& color) { m_textFillColor = color.resolve(Color()); m_textFillColorIsCurrentColor = color.isCurrentColor(); }
+ void setTextEmphasisColor(const StyleColor& color) { m_textEmphasisColor = color.resolve(Color()); m_textEmphasisColorIsCurrentColor = color.isCurrentColor(); }
+ void setVisitedLinkTextStrokeColor(const StyleColor& color) { m_visitedLinkTextStrokeColor = color.resolve(Color()); m_visitedLinkTextStrokeColorIsCurrentColor = color.isCurrentColor(); }
+ void setVisitedLinkTextFillColor(const StyleColor& color) { m_visitedLinkTextFillColor = color.resolve(Color()); m_visitedLinkTextFillColorIsCurrentColor = color.isCurrentColor(); }
+ void setVisitedLinkTextEmphasisColor(const StyleColor& color) { m_visitedLinkTextEmphasisColor = color.resolve(Color()); m_visitedLinkTextEmphasisColorIsCurrentColor = color.isCurrentColor(); }
+
+ Color m_textStrokeColor;
float textStrokeWidth;
- StyleColor textFillColor;
- StyleColor textEmphasisColor;
+ Color m_textFillColor;
+ Color m_textEmphasisColor;
- StyleColor visitedLinkTextStrokeColor;
- StyleColor visitedLinkTextFillColor;
- StyleColor visitedLinkTextEmphasisColor;
+ Color m_visitedLinkTextStrokeColor;
+ Color m_visitedLinkTextFillColor;
+ Color m_visitedLinkTextEmphasisColor;
RefPtr<ShadowList> textShadow; // Our text shadow information for shadowed text drawing.
AtomicString highlight; // Apple-specific extension for custom highlight rendering.
@@ -80,6 +94,13 @@ public:
unsigned m_hasAutoWidows : 1;
unsigned m_hasAutoOrphans : 1;
+ unsigned m_textStrokeColorIsCurrentColor : 1;
+ unsigned m_textFillColorIsCurrentColor : 1;
+ unsigned m_textEmphasisColorIsCurrentColor : 1;
+ unsigned m_visitedLinkTextStrokeColorIsCurrentColor : 1;
+ unsigned m_visitedLinkTextFillColorIsCurrentColor : 1;
+ unsigned m_visitedLinkTextEmphasisColorIsCurrentColor : 1;
+
unsigned textSecurity : 2; // ETextSecurity
unsigned userModify : 2; // EUserModify (editing)
unsigned wordBreak : 2; // EWordBreak
« no previous file with comments | « Source/core/rendering/style/RenderStyle.cpp ('k') | Source/core/rendering/style/StyleRareInheritedData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698