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

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

Issue 867003002: Cache gfx::RenderText instances in views::Label. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 9 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/render_text_mac.h ('k') | ui/views/controls/button/label_button.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_mac.h" 5 #include "ui/gfx/render_text_mac.h"
6 6
7 #include <ApplicationServices/ApplicationServices.h> 7 #include <ApplicationServices/ApplicationServices.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <cmath> 10 #include <cmath>
(...skipping 10 matching lines...) Expand all
21 : common_baseline_(0), runs_valid_(false) { 21 : common_baseline_(0), runs_valid_(false) {
22 } 22 }
23 23
24 RenderTextMac::~RenderTextMac() { 24 RenderTextMac::~RenderTextMac() {
25 } 25 }
26 26
27 scoped_ptr<RenderText> RenderTextMac::CreateInstanceOfSameType() const { 27 scoped_ptr<RenderText> RenderTextMac::CreateInstanceOfSameType() const {
28 return make_scoped_ptr(new RenderTextMac); 28 return make_scoped_ptr(new RenderTextMac);
29 } 29 }
30 30
31 bool RenderTextMac::MultilineSupported() const {
32 return false;
33 }
34
31 const base::string16& RenderTextMac::GetDisplayText() { 35 const base::string16& RenderTextMac::GetDisplayText() {
32 return text_elided() ? display_text() : layout_text(); 36 return text_elided() ? display_text() : layout_text();
33 } 37 }
34 38
35 Size RenderTextMac::GetStringSize() { 39 Size RenderTextMac::GetStringSize() {
36 SizeF size_f = GetStringSizeF(); 40 SizeF size_f = GetStringSizeF();
37 return Size(std::ceil(size_f.width()), size_f.height()); 41 return Size(std::ceil(size_f.width()), size_f.height());
38 } 42 }
39 43
40 SizeF RenderTextMac::GetStringSizeF() { 44 SizeF RenderTextMac::GetStringSizeF() {
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 CTUnderlineStyle value = kCTUnderlineStyleNone; 385 CTUnderlineStyle value = kCTUnderlineStyleNone;
382 if (underline && CFNumberGetValue(underline, kCFNumberSInt32Type, &value)) 386 if (underline && CFNumberGetValue(underline, kCFNumberSInt32Type, &value))
383 run->underline = (value == kCTUnderlineStyleSingle); 387 run->underline = (value == kCTUnderlineStyleSingle);
384 388
385 run_origin.offset(run_width, 0); 389 run_origin.offset(run_width, 0);
386 } 390 }
387 runs_valid_ = true; 391 runs_valid_ = true;
388 } 392 }
389 393
390 } // namespace gfx 394 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/render_text_mac.h ('k') | ui/views/controls/button/label_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698