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

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

Issue 385463002: Support FontRenderParams on Win; fix RenderTextHarfBuzz. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revise SkiaTextRenderer::SetFontRenderParams; sync and cleanup. 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
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 #include <climits> 8 #include <climits>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 paint_.setXfermodeMode(SkXfermode::kDstIn_Mode); 191 paint_.setXfermodeMode(SkXfermode::kDstIn_Mode);
192 canvas_skia_->drawRect(bounds_, paint_); 192 canvas_skia_->drawRect(bounds_, paint_);
193 canvas_skia_->restore(); 193 canvas_skia_->restore();
194 } 194 }
195 } 195 }
196 196
197 void SkiaTextRenderer::SetDrawLooper(SkDrawLooper* draw_looper) { 197 void SkiaTextRenderer::SetDrawLooper(SkDrawLooper* draw_looper) {
198 paint_.setLooper(draw_looper); 198 paint_.setLooper(draw_looper);
199 } 199 }
200 200
201 void SkiaTextRenderer::SetFontSmoothingSettings(bool antialiasing, 201 void SkiaTextRenderer::SetFontRenderParams(const FontRenderParams& params,
202 bool subpixel_rendering, 202 bool background_is_transparent) {
203 bool subpixel_positioning) { 203 paint_.setAntiAlias(params.antialiasing);
204 paint_.setAntiAlias(antialiasing); 204 paint_.setLCDRenderText(!background_is_transparent &&
205 paint_.setLCDRenderText(subpixel_rendering); 205 params.subpixel_rendering != FontRenderParams::SUBPIXEL_RENDERING_NONE);
206 paint_.setSubpixelText(subpixel_positioning); 206 paint_.setSubpixelText(params.subpixel_positioning);
207 } 207 }
208 208
209 void SkiaTextRenderer::SetFontHinting(SkPaint::Hinting hinting) { 209 void SkiaTextRenderer::SetFontHinting(SkPaint::Hinting hinting) {
210 paint_.setHinting(hinting); 210 paint_.setHinting(hinting);
211 } 211 }
212 212
213 void SkiaTextRenderer::SetTypeface(SkTypeface* typeface) { 213 void SkiaTextRenderer::SetTypeface(SkTypeface* typeface) {
214 paint_.setTypeface(typeface); 214 paint_.setTypeface(typeface);
215 } 215 }
216 216
(...skipping 1098 matching lines...) Expand 10 before | Expand all | Expand 10 after
1315 cursor_bounds_ += delta_offset; 1315 cursor_bounds_ += delta_offset;
1316 } 1316 }
1317 1317
1318 void RenderText::DrawSelection(Canvas* canvas) { 1318 void RenderText::DrawSelection(Canvas* canvas) {
1319 const std::vector<Rect> sel = GetSubstringBounds(selection()); 1319 const std::vector<Rect> sel = GetSubstringBounds(selection());
1320 for (std::vector<Rect>::const_iterator i = sel.begin(); i < sel.end(); ++i) 1320 for (std::vector<Rect>::const_iterator i = sel.begin(); i < sel.end(); ++i)
1321 canvas->FillRect(*i, selection_background_focused_color_); 1321 canvas->FillRect(*i, selection_background_focused_color_);
1322 } 1322 }
1323 1323
1324 } // namespace gfx 1324 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698