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

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

Issue 634983002: chromeos: Enable RenderTextHarfBuzz. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: disable timing-out tests on chrome os Created 6 years, 2 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 | « chrome/browser/autofill/form_structure_browsertest.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.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 if (CommandLine::ForCurrentProcess()->HasSwitch( 396 return CommandLine::ForCurrentProcess()->HasSwitch(
397 switches::kEnableHarfBuzzRenderText)) { 397 switches::kDisableHarfBuzzRenderText) ? CreateNativeInstance() :
398 return new RenderTextHarfBuzz; 398 new RenderTextHarfBuzz;
399 }
400 if (CommandLine::ForCurrentProcess()->HasSwitch(
401 switches::kDisableHarfBuzzRenderText)) {
402 return CreateNativeInstance();
403 }
404
405 // Disable on Chrome OS. Blocked on http://crbug.com/423791
406 #if defined(OS_CHROMEOS)
407 return CreateNativeInstance();
408 #else
409 return new RenderTextHarfBuzz;
410 #endif
411 } 399 }
412 400
413 void RenderText::SetText(const base::string16& text) { 401 void RenderText::SetText(const base::string16& text) {
414 DCHECK(!composition_range_.IsValid()); 402 DCHECK(!composition_range_.IsValid());
415 if (text_ == text) 403 if (text_ == text)
416 return; 404 return;
417 text_ = text; 405 text_ = text;
418 406
419 // Adjust ranged styles and colors to accommodate a new text length. 407 // Adjust ranged styles and colors to accommodate a new text length.
420 // Clear style ranges as they might break new text graphemes and apply 408 // Clear style ranges as they might break new text graphemes and apply
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after
1386 SetDisplayOffset(display_offset_.x() + delta_x); 1374 SetDisplayOffset(display_offset_.x() + delta_x);
1387 } 1375 }
1388 1376
1389 void RenderText::DrawSelection(Canvas* canvas) { 1377 void RenderText::DrawSelection(Canvas* canvas) {
1390 const std::vector<Rect> sel = GetSubstringBounds(selection()); 1378 const std::vector<Rect> sel = GetSubstringBounds(selection());
1391 for (std::vector<Rect>::const_iterator i = sel.begin(); i < sel.end(); ++i) 1379 for (std::vector<Rect>::const_iterator i = sel.begin(); i < sel.end(); ++i)
1392 canvas->FillRect(*i, selection_background_focused_color_); 1380 canvas->FillRect(*i, selection_background_focused_color_);
1393 } 1381 }
1394 1382
1395 } // namespace gfx 1383 } // namespace gfx
OLDNEW
« no previous file with comments | « chrome/browser/autofill/form_structure_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698