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

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

Issue 8392017: Change string16 to std::string in the gfx::Font() interface. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add 'UTF-8' everywhere in the comments Created 9 years, 1 month 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/platform_font_win.cc ('k') | views/controls/label_unittest.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_win.h" 5 #include "ui/gfx/render_text_win.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/stl_util.h" 8 #include "base/stl_util.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "ui/gfx/canvas.h" 10 #include "ui/gfx/canvas.h"
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 paint.setSubpixelText(true); 599 paint.setSubpixelText(true);
600 paint.setLCDRenderText(true); 600 paint.setLCDRenderText(true);
601 SkPoint point(SkPoint::Make(SkIntToScalar(offset.x()), 601 SkPoint point(SkPoint::Make(SkIntToScalar(offset.x()),
602 SkIntToScalar(display_rect().height() - offset.y()))); 602 SkIntToScalar(display_rect().height() - offset.y())));
603 scoped_array<SkPoint> pos; 603 scoped_array<SkPoint> pos;
604 for (size_t i = 0; i < runs_.size(); ++i) { 604 for (size_t i = 0; i < runs_.size(); ++i) {
605 // Get the run specified by the visual-to-logical map. 605 // Get the run specified by the visual-to-logical map.
606 internal::TextRun* run = runs_[visual_to_logical_[i]]; 606 internal::TextRun* run = runs_[visual_to_logical_[i]];
607 607
608 // TODO(msw): Font default/fallback and style integration. 608 // TODO(msw): Font default/fallback and style integration.
609 std::string font(UTF16ToASCII(run->font.GetFontName())); 609 std::string font(run->font.GetFontName());
610 SkTypeface::Style style = SkTypeface::kNormal; 610 SkTypeface::Style style = SkTypeface::kNormal;
611 SkTypeface* typeface = SkTypeface::CreateFromName(font.c_str(), style); 611 SkTypeface* typeface = SkTypeface::CreateFromName(font.c_str(), style);
612 if (typeface) { 612 if (typeface) {
613 paint.setTypeface(typeface); 613 paint.setTypeface(typeface);
614 // |paint| adds its own ref. Release the ref from CreateFromName. 614 // |paint| adds its own ref. Release the ref from CreateFromName.
615 typeface->unref(); 615 typeface->unref();
616 } 616 }
617 paint.setTextSize(run->font.GetFontSize()); 617 paint.setTextSize(run->font.GetFontSize());
618 paint.setColor(run->foreground); 618 paint.setColor(run->foreground);
619 619
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 Rect r(GetUpdatedCursorBounds()); 652 Rect r(GetUpdatedCursorBounds());
653 canvas->DrawRectInt(kCursorColor, r.x(), r.y(), r.width(), r.height()); 653 canvas->DrawRectInt(kCursorColor, r.x(), r.y(), r.width(), r.height());
654 } 654 }
655 } 655 }
656 656
657 RenderText* RenderText::CreateRenderText() { 657 RenderText* RenderText::CreateRenderText() {
658 return new RenderTextWin; 658 return new RenderTextWin;
659 } 659 }
660 660
661 } // namespace gfx 661 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/platform_font_win.cc ('k') | views/controls/label_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698