| 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 string_size_ = GetCTLineSize(line_.get(), &common_baseline_); | 196 string_size_ = GetCTLineSize(line_.get(), &common_baseline_); |
| 197 } | 197 } |
| 198 | 198 |
| 199 void RenderTextMac::DrawVisualText(internal::SkiaTextRenderer* renderer) { | 199 void RenderTextMac::DrawVisualText(internal::SkiaTextRenderer* renderer) { |
| 200 DCHECK(line_); | 200 DCHECK(line_); |
| 201 if (!runs_valid_) | 201 if (!runs_valid_) |
| 202 ComputeRuns(); | 202 ComputeRuns(); |
| 203 | 203 |
| 204 ApplyFadeEffects(renderer); | 204 ApplyFadeEffects(renderer); |
| 205 ApplyTextShadows(renderer); | 205 ApplyTextShadows(renderer); |
| 206 renderer->SetFontRenderParams( |
| 207 font_list().GetPrimaryFont().GetFontRenderParams(), |
| 208 subpixel_rendering_suppressed()); |
| 206 | 209 |
| 207 for (size_t i = 0; i < runs_.size(); ++i) { | 210 for (size_t i = 0; i < runs_.size(); ++i) { |
| 208 const TextRun& run = runs_[i]; | 211 const TextRun& run = runs_[i]; |
| 209 renderer->SetForegroundColor(run.foreground); | 212 renderer->SetForegroundColor(run.foreground); |
| 210 | 213 |
| 211 CTFontRef ct_font = static_cast<CTFontRef>(run.font.GetNativeFont()); | 214 CTFontRef ct_font = static_cast<CTFontRef>(run.font.GetNativeFont()); |
| 212 renderer->SetTextSize(CTFontGetSize(ct_font)); | 215 renderer->SetTextSize(CTFontGetSize(ct_font)); |
| 213 | 216 |
| 214 int font_style = Font::NORMAL; | 217 int font_style = Font::NORMAL; |
| 215 CTFontSymbolicTraits traits = CTFontGetSymbolicTraits(ct_font); | 218 CTFontSymbolicTraits traits = CTFontGetSymbolicTraits(ct_font); |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 } | 438 } |
| 436 | 439 |
| 437 void RenderTextMac::InvalidateStyle() { | 440 void RenderTextMac::InvalidateStyle() { |
| 438 line_.reset(); | 441 line_.reset(); |
| 439 attributes_.reset(); | 442 attributes_.reset(); |
| 440 runs_.clear(); | 443 runs_.clear(); |
| 441 runs_valid_ = false; | 444 runs_valid_ = false; |
| 442 } | 445 } |
| 443 | 446 |
| 444 } // namespace gfx | 447 } // namespace gfx |
| OLD | NEW |