OLD | NEW |
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 #import <AppKit/AppKit.h> | 7 #import <AppKit/AppKit.h> |
8 #include <ApplicationServices/ApplicationServices.h> | 8 #include <ApplicationServices/ApplicationServices.h> |
9 #include <CoreText/CoreText.h> | 9 #include <CoreText/CoreText.h> |
10 | 10 |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 | 230 |
231 RenderTextMac::TextRun::TextRun() | 231 RenderTextMac::TextRun::TextRun() |
232 : ct_run(NULL), | 232 : ct_run(NULL), |
233 origin(SkPoint::Make(0, 0)), | 233 origin(SkPoint::Make(0, 0)), |
234 width(0), | 234 width(0), |
235 foreground(SK_ColorBLACK), | 235 foreground(SK_ColorBLACK), |
236 underline(false), | 236 underline(false), |
237 strike(false), | 237 strike(false), |
238 diagonal_strike(false) {} | 238 diagonal_strike(false) {} |
239 | 239 |
| 240 RenderTextMac::TextRun::TextRun(const TextRun& other) = default; |
| 241 |
240 RenderTextMac::TextRun::~TextRun() {} | 242 RenderTextMac::TextRun::~TextRun() {} |
241 | 243 |
242 float RenderTextMac::GetLayoutTextWidth() { | 244 float RenderTextMac::GetLayoutTextWidth() { |
243 base::ScopedCFTypeRef<CFMutableArrayRef> attributes_owner; | 245 base::ScopedCFTypeRef<CFMutableArrayRef> attributes_owner; |
244 base::ScopedCFTypeRef<CTLineRef> line( | 246 base::ScopedCFTypeRef<CTLineRef> line( |
245 EnsureLayoutInternal(layout_text(), &attributes_owner)); | 247 EnsureLayoutInternal(layout_text(), &attributes_owner)); |
246 SkScalar baseline; | 248 SkScalar baseline; |
247 return GetCTLineSize(line.get(), &baseline).width(); | 249 return GetCTLineSize(line.get(), &baseline).width(); |
248 } | 250 } |
249 | 251 |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
433 } | 435 } |
434 | 436 |
435 void RenderTextMac::InvalidateStyle() { | 437 void RenderTextMac::InvalidateStyle() { |
436 line_.reset(); | 438 line_.reset(); |
437 attributes_.reset(); | 439 attributes_.reset(); |
438 runs_.clear(); | 440 runs_.clear(); |
439 runs_valid_ = false; | 441 runs_valid_ = false; |
440 } | 442 } |
441 | 443 |
442 } // namespace gfx | 444 } // namespace gfx |
OLD | NEW |