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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutTextCombine.cpp

Issue 2845773002: Make TextDecoration an enum class. (Closed)
Patch Set: Rebase Created 3 years, 7 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) 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 needs_font_update_ = false; 136 needs_font_update_ = false;
137 137
138 if (!is_combined_) 138 if (!is_combined_)
139 return; 139 return;
140 140
141 unsigned offset = 0; 141 unsigned offset = 0;
142 TextRun run = ConstructTextRun(OriginalFont(), this, offset, TextLength(), 142 TextRun run = ConstructTextRun(OriginalFont(), this, offset, TextLength(),
143 StyleRef(), Style()->Direction()); 143 StyleRef(), Style()->Direction());
144 FontDescription description = OriginalFont().GetFontDescription(); 144 FontDescription description = OriginalFont().GetFontDescription();
145 float em_width = description.ComputedSize(); 145 float em_width = description.ComputedSize();
146 if (!(Style()->TextDecorationsInEffect() & 146 if (!EnumHasFlags(Style()->TextDecorationsInEffect(),
147 (kTextDecorationUnderline | kTextDecorationOverline))) 147 TextDecoration::kUnderline | TextDecoration::kOverline))
148 em_width *= kTextCombineMargin; 148 em_width *= kTextCombineMargin;
149 149
150 // We are going to draw combined text horizontally. 150 // We are going to draw combined text horizontally.
151 description.SetOrientation(FontOrientation::kHorizontal); 151 description.SetOrientation(FontOrientation::kHorizontal);
152 combined_text_width_ = OriginalFont().Width(run); 152 combined_text_width_ = OriginalFont().Width(run);
153 153
154 FontSelector* font_selector = Style()->GetFont().GetFontSelector(); 154 FontSelector* font_selector = Style()->GetFont().GetFontSelector();
155 155
156 bool should_update_font = MutableStyleRef().SetFontDescription( 156 bool should_update_font = MutableStyleRef().SetFontDescription(
157 description); // Need to change font orientation to horizontal. 157 description); // Need to change font orientation to horizontal.
(...skipping 27 matching lines...) Expand all
185 } else { 185 } else {
186 scale_x_ = 1.0f; 186 scale_x_ = 1.0f;
187 } 187 }
188 } 188 }
189 189
190 if (should_update_font) 190 if (should_update_font)
191 Style()->GetFont().Update(font_selector); 191 Style()->GetFont().Update(font_selector);
192 } 192 }
193 193
194 } // namespace blink 194 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698