OLD | NEW |
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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 font_list().GetPrimaryFont().GetFontRenderParams(), | 214 font_list().GetPrimaryFont().GetFontRenderParams(), |
215 subpixel_rendering_suppressed()); | 215 subpixel_rendering_suppressed()); |
216 | 216 |
217 for (size_t i = 0; i < runs_.size(); ++i) { | 217 for (size_t i = 0; i < runs_.size(); ++i) { |
218 const TextRun& run = runs_[i]; | 218 const TextRun& run = runs_[i]; |
219 renderer->SetForegroundColor(run.foreground); | 219 renderer->SetForegroundColor(run.foreground); |
220 renderer->SetTextSize(CTFontGetSize(run.ct_font)); | 220 renderer->SetTextSize(CTFontGetSize(run.ct_font)); |
221 | 221 |
222 // The painter adds its own ref. So don't |release()| it from the ref ptr in | 222 // The painter adds its own ref. So don't |release()| it from the ref ptr in |
223 // TextRun. | 223 // TextRun. |
224 renderer->SetTypeface(run.typeface.get()); | 224 renderer->SetTypeface(run.typeface); |
225 | 225 |
226 renderer->DrawPosText(&run.glyph_positions[0], &run.glyphs[0], | 226 renderer->DrawPosText(&run.glyph_positions[0], &run.glyphs[0], |
227 run.glyphs.size()); | 227 run.glyphs.size()); |
228 renderer->DrawDecorations(run.origin.x(), run.origin.y(), run.width, | 228 renderer->DrawDecorations(run.origin.x(), run.origin.y(), run.width, |
229 run.underline, run.strike, run.diagonal_strike); | 229 run.underline, run.strike, run.diagonal_strike); |
230 } | 230 } |
231 | 231 |
232 renderer->EndDiagonalStrike(); | 232 renderer->EndDiagonalStrike(); |
233 } | 233 } |
234 | 234 |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 } | 442 } |
443 | 443 |
444 void RenderTextMac::InvalidateStyle() { | 444 void RenderTextMac::InvalidateStyle() { |
445 line_.reset(); | 445 line_.reset(); |
446 attributes_.reset(); | 446 attributes_.reset(); |
447 runs_.clear(); | 447 runs_.clear(); |
448 runs_valid_ = false; | 448 runs_valid_ = false; |
449 } | 449 } |
450 | 450 |
451 } // namespace gfx | 451 } // namespace gfx |
OLD | NEW |