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

Side by Side Diff: ui/gfx/render_text_mac.mm

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_harfbuzz.cc ('k') | ui/gfx/render_text_unittest.cc » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_mac.h" 5 #include "ui/gfx/render_text_mac.h"
6 6
7 #import <AppKit/AppKit.h> 7 #import <AppKit/AppKit.h>
8 #include <ApplicationServices/ApplicationServices.h> 8 #include <ApplicationServices/ApplicationServices.h>
9 #include <CoreText/CoreText.h> 9 #include <CoreText/CoreText.h>
10 10
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 const TextRun& run = runs_[i]; 252 const TextRun& run = runs_[i];
253 renderer->SetForegroundColor(run.foreground); 253 renderer->SetForegroundColor(run.foreground);
254 renderer->SetTextSize(CTFontGetSize(run.ct_font)); 254 renderer->SetTextSize(CTFontGetSize(run.ct_font));
255 255
256 // The painter adds its own ref. So don't |release()| it from the ref ptr in 256 // The painter adds its own ref. So don't |release()| it from the ref ptr in
257 // TextRun. 257 // TextRun.
258 renderer->SetTypeface(run.typeface); 258 renderer->SetTypeface(run.typeface);
259 259
260 renderer->DrawPosText(&run.glyph_positions[0], &run.glyphs[0], 260 renderer->DrawPosText(&run.glyph_positions[0], &run.glyphs[0],
261 run.glyphs.size()); 261 run.glyphs.size());
262 renderer->DrawDecorations(run.origin.x(), run.origin.y(), run.width, 262 if (run.underline)
263 run.underline, run.strike); 263 renderer->DrawUnderline(run.origin.x(), run.origin.y(), run.width);
264 if (run.strike)
265 renderer->DrawStrike(run.origin.x(), run.origin.y(), run.width,
266 strike_thickness_factor());
264 } 267 }
265 } 268 }
266 269
267 RenderTextMac::TextRun::TextRun() 270 RenderTextMac::TextRun::TextRun()
268 : ct_run(NULL), 271 : ct_run(NULL),
269 origin(SkPoint::Make(0, 0)), 272 origin(SkPoint::Make(0, 0)),
270 width(0), 273 width(0),
271 foreground(SK_ColorBLACK), 274 foreground(SK_ColorBLACK),
272 underline(false), 275 underline(false),
273 strike(false) {} 276 strike(false) {}
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 // TODO(karandeepb): This is not invoked on any codepath currently. Style the 480 // TODO(karandeepb): This is not invoked on any codepath currently. Style the
478 // returned text if need be. 481 // returned text if need be.
479 if (obscured()) 482 if (obscured())
480 return false; 483 return false;
481 484
482 decorated_text->text = GetTextFromRange(range); 485 decorated_text->text = GetTextFromRange(range);
483 return true; 486 return true;
484 } 487 }
485 488
486 } // namespace gfx 489 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/render_text_harfbuzz.cc ('k') | ui/gfx/render_text_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698