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

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: cleanup / re-upload Created 5 years, 10 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
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 14 matching lines...) Expand all
25 } 25 }
26 26
27 scoped_ptr<RenderText> RenderTextMac::CreateInstanceOfSameType() const { 27 scoped_ptr<RenderText> RenderTextMac::CreateInstanceOfSameType() const {
28 return scoped_ptr<RenderTextMac>(new RenderTextMac); 28 return scoped_ptr<RenderTextMac>(new RenderTextMac);
29 } 29 }
30 30
31 const base::string16& RenderTextMac::GetDisplayText() { 31 const base::string16& RenderTextMac::GetDisplayText() {
32 return text_elided() ? display_text() : layout_text(); 32 return text_elided() ? display_text() : layout_text();
33 } 33 }
34 34
35 bool RenderTextMac::MultilineSupported() const {
36 return false;
37 }
38
35 Size RenderTextMac::GetStringSize() { 39 Size RenderTextMac::GetStringSize() {
36 EnsureLayout(); 40 EnsureLayout();
37 return Size(std::ceil(string_size_.width()), string_size_.height()); 41 return Size(std::ceil(string_size_.width()), string_size_.height());
38 } 42 }
39 43
40 SizeF RenderTextMac::GetStringSizeF() { 44 SizeF RenderTextMac::GetStringSizeF() {
41 EnsureLayout(); 45 EnsureLayout();
42 return string_size_; 46 return string_size_;
43 } 47 }
44 48
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 CTUnderlineStyle value = kCTUnderlineStyleNone; 361 CTUnderlineStyle value = kCTUnderlineStyleNone;
358 if (underline && CFNumberGetValue(underline, kCFNumberSInt32Type, &value)) 362 if (underline && CFNumberGetValue(underline, kCFNumberSInt32Type, &value))
359 run->underline = (value == kCTUnderlineStyleSingle); 363 run->underline = (value == kCTUnderlineStyleSingle);
360 364
361 run_origin.offset(run_width, 0); 365 run_origin.offset(run_width, 0);
362 } 366 }
363 runs_valid_ = true; 367 runs_valid_ = true;
364 } 368 }
365 369
366 } // namespace gfx 370 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698