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

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

Issue 9370026: Respect the system ClearType setting in RenderTextWin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 10 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.h ('k') | ui/gfx/render_text_win.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.h" 5 #include "ui/gfx/render_text.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
10 #include "base/i18n/break_iterator.h" 10 #include "base/i18n/break_iterator.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 paint_.setTextEncoding(SkPaint::kGlyphID_TextEncoding); 178 paint_.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
179 paint_.setStyle(SkPaint::kFill_Style); 179 paint_.setStyle(SkPaint::kFill_Style);
180 paint_.setAntiAlias(true); 180 paint_.setAntiAlias(true);
181 paint_.setSubpixelText(true); 181 paint_.setSubpixelText(true);
182 paint_.setLCDRenderText(true); 182 paint_.setLCDRenderText(true);
183 } 183 }
184 184
185 SkiaTextRenderer::~SkiaTextRenderer() { 185 SkiaTextRenderer::~SkiaTextRenderer() {
186 } 186 }
187 187
188 void SkiaTextRenderer::SetFontSmoothingSettings(bool enable_smoothing,
189 bool enable_lcd_text) {
190 paint_.setAntiAlias(enable_smoothing);
191 paint_.setSubpixelText(enable_smoothing);
192 paint_.setLCDRenderText(enable_lcd_text);
193 }
194
188 void SkiaTextRenderer::SetTypeface(SkTypeface* typeface) { 195 void SkiaTextRenderer::SetTypeface(SkTypeface* typeface) {
189 paint_.setTypeface(typeface); 196 paint_.setTypeface(typeface);
190 } 197 }
191 198
192 void SkiaTextRenderer::SetTextSize(int size) { 199 void SkiaTextRenderer::SetTextSize(int size) {
193 paint_.setTextSize(size); 200 paint_.setTextSize(size);
194 } 201 }
195 202
196 void SkiaTextRenderer::SetFontStyle(int style) { 203 void SkiaTextRenderer::SetFontStyle(int style) {
197 SkTypeface::Style skia_style = ConvertFontStyleToSkiaTypefaceStyle(style); 204 SkTypeface::Style skia_style = ConvertFontStyleToSkiaTypefaceStyle(style);
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after
852 if (cursor_enabled() && cursor_visible() && focused()) { 859 if (cursor_enabled() && cursor_visible() && focused()) {
853 const Rect& bounds = GetUpdatedCursorBounds(); 860 const Rect& bounds = GetUpdatedCursorBounds();
854 if (bounds.width() != 0) 861 if (bounds.width() != 0)
855 canvas->FillRect(bounds, kCursorColor); 862 canvas->FillRect(bounds, kCursorColor);
856 else 863 else
857 canvas->DrawRect(bounds, kCursorColor); 864 canvas->DrawRect(bounds, kCursorColor);
858 } 865 }
859 } 866 }
860 867
861 } // namespace gfx 868 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/render_text.h ('k') | ui/gfx/render_text_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698