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

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

Issue 421053002: Enable RenderTextHarfBuzz by default (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix tests Created 6 years, 4 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_harfbuzz.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 #include <climits> 8 #include <climits>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 } // namespace internal 419 } // namespace internal
420 420
421 RenderText::~RenderText() { 421 RenderText::~RenderText() {
422 } 422 }
423 423
424 RenderText* RenderText::CreateInstance() { 424 RenderText* RenderText::CreateInstance() {
425 #if defined(OS_MACOSX) && defined(TOOLKIT_VIEWS) 425 #if defined(OS_MACOSX) && defined(TOOLKIT_VIEWS)
426 // Use the more complete HarfBuzz implementation for Views controls on Mac. 426 // Use the more complete HarfBuzz implementation for Views controls on Mac.
427 return new RenderTextHarfBuzz; 427 return new RenderTextHarfBuzz;
428 #else 428 #else
429 if (CommandLine::ForCurrentProcess()->HasSwitch( 429 if (!CommandLine::ForCurrentProcess()->HasSwitch(
430 switches::kEnableHarfBuzzRenderText)) { 430 switches::kDisableHarfBuzzRenderText)) {
431 return new RenderTextHarfBuzz; 431 return new RenderTextHarfBuzz;
432 } 432 }
433 return CreateNativeInstance(); 433 return CreateNativeInstance();
434 #endif 434 #endif
435 } 435 }
436 436
437 void RenderText::SetText(const base::string16& text) { 437 void RenderText::SetText(const base::string16& text) {
438 DCHECK(!composition_range_.IsValid()); 438 DCHECK(!composition_range_.IsValid());
439 if (text_ == text) 439 if (text_ == text)
440 return; 440 return;
(...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after
1425 SetDisplayOffset(display_offset_.x() + delta_x); 1425 SetDisplayOffset(display_offset_.x() + delta_x);
1426 } 1426 }
1427 1427
1428 void RenderText::DrawSelection(Canvas* canvas) { 1428 void RenderText::DrawSelection(Canvas* canvas) {
1429 const std::vector<Rect> sel = GetSubstringBounds(selection()); 1429 const std::vector<Rect> sel = GetSubstringBounds(selection());
1430 for (std::vector<Rect>::const_iterator i = sel.begin(); i < sel.end(); ++i) 1430 for (std::vector<Rect>::const_iterator i = sel.begin(); i < sel.end(); ++i)
1431 canvas->FillRect(*i, selection_background_focused_color_); 1431 canvas->FillRect(*i, selection_background_focused_color_);
1432 } 1432 }
1433 1433
1434 } // namespace gfx 1434 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/render_text.h ('k') | ui/gfx/render_text_harfbuzz.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698