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

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

Issue 1941293002: RenderTextMac: Invoke SkiaTextRenderer::SetFontRenderParams() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase? Created 4 years, 7 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.h ('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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « ui/gfx/render_text_harfbuzz.h ('k') | ui/gfx/render_text_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698