OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 namespace blink { | 47 namespace blink { |
48 | 48 |
49 WebFont* WebFont::create(const WebFontDescription& desc) | 49 WebFont* WebFont::create(const WebFontDescription& desc) |
50 { | 50 { |
51 return new WebFontImpl(desc); | 51 return new WebFontImpl(desc); |
52 } | 52 } |
53 | 53 |
54 WebFontImpl::WebFontImpl(const FontDescription& desc) | 54 WebFontImpl::WebFontImpl(const FontDescription& desc) |
55 : m_font(desc) | 55 : m_font(desc) |
56 { | 56 { |
57 m_font.update(0); | 57 m_font.update(nullptr); |
58 } | 58 } |
59 | 59 |
60 WebFontDescription WebFontImpl::fontDescription() const | 60 WebFontDescription WebFontImpl::fontDescription() const |
61 { | 61 { |
62 return WebFontDescription(m_font.fontDescription()); | 62 return WebFontDescription(m_font.fontDescription()); |
63 } | 63 } |
64 | 64 |
65 int WebFontImpl::ascent() const | 65 int WebFontImpl::ascent() const |
66 { | 66 { |
67 return m_font.fontMetrics().ascent(); | 67 return m_font.fontMetrics().ascent(); |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 return m_font.offsetForPosition(run, position, true); | 120 return m_font.offsetForPosition(run, position, true); |
121 } | 121 } |
122 | 122 |
123 WebFloatRect WebFontImpl::selectionRectForText(const WebTextRun& run, const WebF
loatPoint& leftBaseline, int height, int from, int to) const | 123 WebFloatRect WebFontImpl::selectionRectForText(const WebTextRun& run, const WebF
loatPoint& leftBaseline, int height, int from, int to) const |
124 { | 124 { |
125 FontCachePurgePreventer fontCachePurgePreventer; | 125 FontCachePurgePreventer fontCachePurgePreventer; |
126 return m_font.selectionRectForText(run, leftBaseline, height, from, to); | 126 return m_font.selectionRectForText(run, leftBaseline, height, from, to); |
127 } | 127 } |
128 | 128 |
129 } // namespace blink | 129 } // namespace blink |
OLD | NEW |