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

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

Issue 817653003: Update from https://crrev.com/309717 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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/font_render_params_linux.cc ('k') | ui/gl/generate_bindings.py » ('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 #include <climits> 8 #include <climits>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 paint->setAutohinted(params.autohinter); 386 paint->setAutohinted(params.autohinter);
387 paint->setHinting(FontRenderParamsHintingToSkPaintHinting(params.hinting)); 387 paint->setHinting(FontRenderParamsHintingToSkPaintHinting(params.hinting));
388 } 388 }
389 389
390 } // namespace internal 390 } // namespace internal
391 391
392 RenderText::~RenderText() { 392 RenderText::~RenderText() {
393 } 393 }
394 394
395 RenderText* RenderText::CreateInstance() { 395 RenderText* RenderText::CreateInstance() {
396 return CommandLine::ForCurrentProcess()->HasSwitch( 396 return base::CommandLine::ForCurrentProcess()->HasSwitch(
397 switches::kDisableHarfBuzzRenderText) ? CreateNativeInstance() : 397 switches::kDisableHarfBuzzRenderText) ? CreateNativeInstance() :
398 new RenderTextHarfBuzz; 398 new RenderTextHarfBuzz;
399 } 399 }
400 400
401 void RenderText::SetText(const base::string16& text) { 401 void RenderText::SetText(const base::string16& text) {
402 DCHECK(!composition_range_.IsValid()); 402 DCHECK(!composition_range_.IsValid());
403 if (text_ == text) 403 if (text_ == text)
404 return; 404 return;
405 text_ = text; 405 text_ = text;
406 406
(...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after
1392 SetDisplayOffset(display_offset_.x() + delta_x); 1392 SetDisplayOffset(display_offset_.x() + delta_x);
1393 } 1393 }
1394 1394
1395 void RenderText::DrawSelection(Canvas* canvas) { 1395 void RenderText::DrawSelection(Canvas* canvas) {
1396 const std::vector<Rect> sel = GetSubstringBounds(selection()); 1396 const std::vector<Rect> sel = GetSubstringBounds(selection());
1397 for (std::vector<Rect>::const_iterator i = sel.begin(); i < sel.end(); ++i) 1397 for (std::vector<Rect>::const_iterator i = sel.begin(); i < sel.end(); ++i)
1398 canvas->FillRect(*i, selection_background_focused_color_); 1398 canvas->FillRect(*i, selection_background_focused_color_);
1399 } 1399 }
1400 1400
1401 } // namespace gfx 1401 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/font_render_params_linux.cc ('k') | ui/gl/generate_bindings.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698