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

Side by Side Diff: ui/gfx/render_text_harfbuzz.cc

Issue 2969623004: RenderText: Allow strike-through line thickness to be customized. (Closed)
Patch Set: Address final nits. Created 3 years, 5 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
« no previous file with comments | « ui/gfx/render_text.cc ('k') | ui/gfx/render_text_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/gfx/render_text_harfbuzz.h" 5 #include "ui/gfx/render_text_harfbuzz.h"
6 6
7 #include <limits> 7 #include <limits>
8 #include <set> 8 #include <set>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 1298 matching lines...) Expand 10 before | Expand all | Expand 10 after
1309 renderer->DrawPosText( 1309 renderer->DrawPosText(
1310 &positions[colored_glyphs.start() - glyphs_range.start()], 1310 &positions[colored_glyphs.start() - glyphs_range.start()],
1311 &run.glyphs[colored_glyphs.start()], colored_glyphs.length()); 1311 &run.glyphs[colored_glyphs.start()], colored_glyphs.length());
1312 int start_x = SkScalarRoundToInt( 1312 int start_x = SkScalarRoundToInt(
1313 positions[colored_glyphs.start() - glyphs_range.start()].x()); 1313 positions[colored_glyphs.start() - glyphs_range.start()].x());
1314 int end_x = SkScalarRoundToInt( 1314 int end_x = SkScalarRoundToInt(
1315 (colored_glyphs.end() == glyphs_range.end()) 1315 (colored_glyphs.end() == glyphs_range.end())
1316 ? (SkFloatToScalar(segment.width()) + preceding_segment_widths + 1316 ? (SkFloatToScalar(segment.width()) + preceding_segment_widths +
1317 SkIntToScalar(origin.x())) 1317 SkIntToScalar(origin.x()))
1318 : positions[colored_glyphs.end() - glyphs_range.start()].x()); 1318 : positions[colored_glyphs.end() - glyphs_range.start()].x());
1319 renderer->DrawDecorations(start_x, origin.y(), end_x - start_x, 1319 if (run.underline)
1320 run.underline, run.strike); 1320 renderer->DrawUnderline(start_x, origin.y(), end_x - start_x);
1321 if (run.strike)
1322 renderer->DrawStrike(start_x, origin.y(), end_x - start_x,
1323 strike_thickness_factor());
1321 } 1324 }
1322 preceding_segment_widths += SkFloatToScalar(segment.width()); 1325 preceding_segment_widths += SkFloatToScalar(segment.width());
1323 } 1326 }
1324 } 1327 }
1325 1328
1326 UndoCompositionAndSelectionStyles(); 1329 UndoCompositionAndSelectionStyles();
1327 } 1330 }
1328 1331
1329 size_t RenderTextHarfBuzz::GetRunContainingCaret( 1332 size_t RenderTextHarfBuzz::GetRunContainingCaret(
1330 const SelectionModel& caret) { 1333 const SelectionModel& caret) {
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
1716 run.font.Derive(0, style, run.weight)); 1719 run.font.Derive(0, style, run.weight));
1717 1720
1718 attribute.strike = run.strike; 1721 attribute.strike = run.strike;
1719 decorated_text->attributes.push_back(attribute); 1722 decorated_text->attributes.push_back(attribute);
1720 } 1723 }
1721 } 1724 }
1722 return true; 1725 return true;
1723 } 1726 }
1724 1727
1725 } // namespace gfx 1728 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/render_text.cc ('k') | ui/gfx/render_text_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698