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

Side by Side Diff: ui/gfx/render_text_win.cc

Issue 382273002: ui/gfx: Allow for font-specific rendering settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix fontconfig leak Created 6 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 | Annotate | Revision Log
« no previous file with comments | « ui/gfx/render_text_pango.cc ('k') | no next file » | 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_win.h" 5 #include "ui/gfx/render_text_win.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/i18n/break_iterator.h" 9 #include "base/i18n/break_iterator.h"
10 #include "base/i18n/char_iterator.h" 10 #include "base/i18n/char_iterator.h"
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after
802 void RenderTextWin::DrawVisualText(Canvas* canvas) { 802 void RenderTextWin::DrawVisualText(Canvas* canvas) {
803 DCHECK(!needs_layout_); 803 DCHECK(!needs_layout_);
804 DCHECK(!lines().empty()); 804 DCHECK(!lines().empty());
805 805
806 std::vector<SkPoint> pos; 806 std::vector<SkPoint> pos;
807 807
808 internal::SkiaTextRenderer renderer(canvas); 808 internal::SkiaTextRenderer renderer(canvas);
809 ApplyFadeEffects(&renderer); 809 ApplyFadeEffects(&renderer);
810 ApplyTextShadows(&renderer); 810 ApplyTextShadows(&renderer);
811 811
812 renderer.SetFontRenderParams(GetDefaultFontRenderParams(), 812 renderer.SetFontRenderParams(
813 background_is_transparent()); 813 font_list().GetPrimaryFont().GetFontRenderParams(),
814 background_is_transparent());
814 815
815 ApplyCompositionAndSelectionStyles(); 816 ApplyCompositionAndSelectionStyles();
816 817
817 for (size_t i = 0; i < lines().size(); ++i) { 818 for (size_t i = 0; i < lines().size(); ++i) {
818 const internal::Line& line = lines()[i]; 819 const internal::Line& line = lines()[i];
819 const Vector2d line_offset = GetLineOffset(i); 820 const Vector2d line_offset = GetLineOffset(i);
820 821
821 // Skip painting empty lines or lines outside the display rect area. 822 // Skip painting empty lines or lines outside the display rect area.
822 if (!display_rect().Intersects(Rect(PointAtOffsetFromOrigin(line_offset), 823 if (!display_rect().Intersects(Rect(PointAtOffsetFromOrigin(line_offset),
823 line.size))) 824 line.size)))
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
1281 size_t position = LayoutIndexToTextIndex(run->range.end()); 1282 size_t position = LayoutIndexToTextIndex(run->range.end());
1282 position = IndexOfAdjacentGrapheme(position, CURSOR_BACKWARD); 1283 position = IndexOfAdjacentGrapheme(position, CURSOR_BACKWARD);
1283 return SelectionModel(position, CURSOR_FORWARD); 1284 return SelectionModel(position, CURSOR_FORWARD);
1284 } 1285 }
1285 1286
1286 RenderText* RenderText::CreateNativeInstance() { 1287 RenderText* RenderText::CreateNativeInstance() {
1287 return new RenderTextWin; 1288 return new RenderTextWin;
1288 } 1289 }
1289 1290
1290 } // namespace gfx 1291 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/render_text_pango.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698