| 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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 string_size_ = GetCTLineSize(line_.get(), &common_baseline_); | 200 string_size_ = GetCTLineSize(line_.get(), &common_baseline_); |
| 201 } | 201 } |
| 202 | 202 |
| 203 void RenderTextMac::DrawVisualText(internal::SkiaTextRenderer* renderer) { | 203 void RenderTextMac::DrawVisualText(internal::SkiaTextRenderer* renderer) { |
| 204 DCHECK(line_); | 204 DCHECK(line_); |
| 205 if (!runs_valid_) | 205 if (!runs_valid_) |
| 206 ComputeRuns(); | 206 ComputeRuns(); |
| 207 | 207 |
| 208 ApplyFadeEffects(renderer); | 208 ApplyFadeEffects(renderer); |
| 209 ApplyTextShadows(renderer); | 209 ApplyTextShadows(renderer); |
| 210 renderer->SetFontRenderParams( |
| 211 font_list().GetPrimaryFont().GetFontRenderParams(), |
| 212 subpixel_rendering_suppressed()); |
| 210 | 213 |
| 211 for (size_t i = 0; i < runs_.size(); ++i) { | 214 for (size_t i = 0; i < runs_.size(); ++i) { |
| 212 const TextRun& run = runs_[i]; | 215 const TextRun& run = runs_[i]; |
| 213 renderer->SetForegroundColor(run.foreground); | 216 renderer->SetForegroundColor(run.foreground); |
| 214 renderer->SetTextSize(CTFontGetSize(run.ct_font)); | 217 renderer->SetTextSize(CTFontGetSize(run.ct_font)); |
| 215 | 218 |
| 216 // The painter adds its own ref. So don't |release()| it from the ref ptr in | 219 // The painter adds its own ref. So don't |release()| it from the ref ptr in |
| 217 // TextRun. | 220 // TextRun. |
| 218 renderer->SetTypeface(run.typeface.get()); | 221 renderer->SetTypeface(run.typeface.get()); |
| 219 | 222 |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 } | 437 } |
| 435 | 438 |
| 436 void RenderTextMac::InvalidateStyle() { | 439 void RenderTextMac::InvalidateStyle() { |
| 437 line_.reset(); | 440 line_.reset(); |
| 438 attributes_.reset(); | 441 attributes_.reset(); |
| 439 runs_.clear(); | 442 runs_.clear(); |
| 440 runs_valid_ = false; | 443 runs_valid_ = false; |
| 441 } | 444 } |
| 442 | 445 |
| 443 } // namespace gfx | 446 } // namespace gfx |
| OLD | NEW |