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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) 3 * (C) 2000 Antti Koivisto (koivisto@kde.org)
4 * (C) 2000 Dirk Mueller (mueller@kde.org) 4 * (C) 2000 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 bool operator==(const StyleRareInheritedData& o) const; 52 bool operator==(const StyleRareInheritedData& o) const;
53 bool operator!=(const StyleRareInheritedData& o) const 53 bool operator!=(const StyleRareInheritedData& o) const
54 { 54 {
55 return !(*this == o); 55 return !(*this == o);
56 } 56 }
57 bool shadowDataEquivalent(const StyleRareInheritedData&) const; 57 bool shadowDataEquivalent(const StyleRareInheritedData&) const;
58 58
59 RefPtr<StyleImage> listStyleImage; 59 RefPtr<StyleImage> listStyleImage;
60 60
61 StyleColor textStrokeColor; 61 StyleColor textStrokeColor() const { return m_textStrokeColorIsCurrentColor ? StyleColor::currentColor() : StyleColor(m_textStrokeColor); }
62 StyleColor textFillColor() const { return m_textFillColorIsCurrentColor ? St yleColor::currentColor() : StyleColor(m_textFillColor); }
63 StyleColor textEmphasisColor() const { return m_textEmphasisColorIsCurrentCo lor ? StyleColor::currentColor() : StyleColor(m_textEmphasisColor); }
64 StyleColor visitedLinkTextStrokeColor() const { return m_visitedLinkTextStro keColorIsCurrentColor ? StyleColor::currentColor() : StyleColor(m_visitedLinkTex tStrokeColor); }
65 StyleColor visitedLinkTextFillColor() const { return m_visitedLinkTextFillCo lorIsCurrentColor ? StyleColor::currentColor() : StyleColor(m_visitedLinkTextFil lColor); }
66 StyleColor visitedLinkTextEmphasisColor() const { return m_visitedLinkTextEm phasisColorIsCurrentColor ? StyleColor::currentColor() : StyleColor(m_visitedLin kTextEmphasisColor); }
67
68 void setTextStrokeColor(const StyleColor& color) { m_textStrokeColor = color .resolve(Color()); m_textStrokeColorIsCurrentColor = color.isCurrentColor(); }
69 void setTextFillColor(const StyleColor& color) { m_textFillColor = color.res olve(Color()); m_textFillColorIsCurrentColor = color.isCurrentColor(); }
70 void setTextEmphasisColor(const StyleColor& color) { m_textEmphasisColor = c olor.resolve(Color()); m_textEmphasisColorIsCurrentColor = color.isCurrentColor( ); }
71 void setVisitedLinkTextStrokeColor(const StyleColor& color) { m_visitedLinkT extStrokeColor = color.resolve(Color()); m_visitedLinkTextStrokeColorIsCurrentCo lor = color.isCurrentColor(); }
72 void setVisitedLinkTextFillColor(const StyleColor& color) { m_visitedLinkTex tFillColor = color.resolve(Color()); m_visitedLinkTextFillColorIsCurrentColor = color.isCurrentColor(); }
73 void setVisitedLinkTextEmphasisColor(const StyleColor& color) { m_visitedLin kTextEmphasisColor = color.resolve(Color()); m_visitedLinkTextEmphasisColorIsCur rentColor = color.isCurrentColor(); }
74
75 Color m_textStrokeColor;
62 float textStrokeWidth; 76 float textStrokeWidth;
63 StyleColor textFillColor; 77 Color m_textFillColor;
64 StyleColor textEmphasisColor; 78 Color m_textEmphasisColor;
65 79
66 StyleColor visitedLinkTextStrokeColor; 80 Color m_visitedLinkTextStrokeColor;
67 StyleColor visitedLinkTextFillColor; 81 Color m_visitedLinkTextFillColor;
68 StyleColor visitedLinkTextEmphasisColor; 82 Color m_visitedLinkTextEmphasisColor;
69 83
70 RefPtr<ShadowList> textShadow; // Our text shadow information for shadowed t ext drawing. 84 RefPtr<ShadowList> textShadow; // Our text shadow information for shadowed t ext drawing.
71 AtomicString highlight; // Apple-specific extension for custom highlight ren dering. 85 AtomicString highlight; // Apple-specific extension for custom highlight ren dering.
72 86
73 RefPtr<CursorList> cursorData; 87 RefPtr<CursorList> cursorData;
74 Length indent; 88 Length indent;
75 float m_effectiveZoom; 89 float m_effectiveZoom;
76 90
77 // Paged media properties. 91 // Paged media properties.
78 short widows; 92 short widows;
79 short orphans; 93 short orphans;
80 unsigned m_hasAutoWidows : 1; 94 unsigned m_hasAutoWidows : 1;
81 unsigned m_hasAutoOrphans : 1; 95 unsigned m_hasAutoOrphans : 1;
82 96
97 unsigned m_textStrokeColorIsCurrentColor : 1;
98 unsigned m_textFillColorIsCurrentColor : 1;
99 unsigned m_textEmphasisColorIsCurrentColor : 1;
100 unsigned m_visitedLinkTextStrokeColorIsCurrentColor : 1;
101 unsigned m_visitedLinkTextFillColorIsCurrentColor : 1;
102 unsigned m_visitedLinkTextEmphasisColorIsCurrentColor : 1;
103
83 unsigned textSecurity : 2; // ETextSecurity 104 unsigned textSecurity : 2; // ETextSecurity
84 unsigned userModify : 2; // EUserModify (editing) 105 unsigned userModify : 2; // EUserModify (editing)
85 unsigned wordBreak : 2; // EWordBreak 106 unsigned wordBreak : 2; // EWordBreak
86 unsigned overflowWrap : 1; // EOverflowWrap 107 unsigned overflowWrap : 1; // EOverflowWrap
87 unsigned lineBreak : 3; // LineBreak 108 unsigned lineBreak : 3; // LineBreak
88 unsigned resize : 2; // EResize 109 unsigned resize : 2; // EResize
89 unsigned userSelect : 2; // EUserSelect 110 unsigned userSelect : 2; // EUserSelect
90 unsigned speak : 3; // ESpeak 111 unsigned speak : 3; // ESpeak
91 unsigned hyphens : 2; // Hyphens 112 unsigned hyphens : 2; // Hyphens
92 unsigned textEmphasisFill : 1; // TextEmphasisFill 113 unsigned textEmphasisFill : 1; // TextEmphasisFill
(...skipping 25 matching lines...) Expand all
118 Color tapHighlightColor; 139 Color tapHighlightColor;
119 140
120 private: 141 private:
121 StyleRareInheritedData(); 142 StyleRareInheritedData();
122 StyleRareInheritedData(const StyleRareInheritedData&); 143 StyleRareInheritedData(const StyleRareInheritedData&);
123 }; 144 };
124 145
125 } // namespace WebCore 146 } // namespace WebCore
126 147
127 #endif // StyleRareInheritedData_h 148 #endif // StyleRareInheritedData_h
OLDNEW
« 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