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

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

Issue 419753002: Prepare to enable RenderTextHarfBuzz by default (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
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 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after
1445 cursor_bounds_ += delta_offset; 1445 cursor_bounds_ += delta_offset;
1446 } 1446 }
1447 1447
1448 void RenderText::DrawSelection(Canvas* canvas) { 1448 void RenderText::DrawSelection(Canvas* canvas) {
1449 const std::vector<Rect> sel = GetSubstringBounds(selection()); 1449 const std::vector<Rect> sel = GetSubstringBounds(selection());
1450 for (std::vector<Rect>::const_iterator i = sel.begin(); i < sel.end(); ++i) 1450 for (std::vector<Rect>::const_iterator i = sel.begin(); i < sel.end(); ++i)
1451 canvas->FillRect(*i, selection_background_focused_color_); 1451 canvas->FillRect(*i, selection_background_focused_color_);
1452 } 1452 }
1453 1453
1454 } // namespace gfx 1454 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698