| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "public/platform/WebFont.h" | 5 #include "public/platform/WebFont.h" |
| 6 | 6 |
| 7 #include "platform/fonts/Font.h" | 7 #include "platform/fonts/Font.h" |
| 8 #include "platform/fonts/FontCache.h" | 8 #include "platform/fonts/FontCache.h" |
| 9 #include "platform/fonts/FontDescription.h" | 9 #include "platform/fonts/FontDescription.h" |
| 10 #include "platform/graphics/GraphicsContext.h" | 10 #include "platform/graphics/GraphicsContext.h" |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 Font m_font; | 38 Font m_font; |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 WebFont::WebFont(const WebFontDescription& description) | 41 WebFont::WebFont(const WebFontDescription& description) |
| 42 : m_private(new Impl(description)) | 42 : m_private(new Impl(description)) |
| 43 { | 43 { |
| 44 } | 44 } |
| 45 | 45 |
| 46 WebFont::~WebFont() | 46 WebFont::~WebFont() |
| 47 { | 47 { |
| 48 m_private.reset(0); | |
| 49 } | 48 } |
| 50 | 49 |
| 51 WebFontDescription WebFont::getFontDescription() const | 50 WebFontDescription WebFont::getFontDescription() const |
| 52 { | 51 { |
| 53 return WebFontDescription(m_private->getFont().getFontDescription()); | 52 return WebFontDescription(m_private->getFont().getFontDescription()); |
| 54 } | 53 } |
| 55 | 54 |
| 56 int WebFont::ascent() const | 55 int WebFont::ascent() const |
| 57 { | 56 { |
| 58 return m_private->getFont().getFontMetrics().ascent(); | 57 return m_private->getFont().getFontMetrics().ascent(); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 { | 111 { |
| 113 return m_private->getFont().offsetForPosition(run, position, true); | 112 return m_private->getFont().offsetForPosition(run, position, true); |
| 114 } | 113 } |
| 115 | 114 |
| 116 WebFloatRect WebFont::selectionRectForText(const WebTextRun& run, const WebFloat
Point& leftBaseline, int height, int from, int to) const | 115 WebFloatRect WebFont::selectionRectForText(const WebTextRun& run, const WebFloat
Point& leftBaseline, int height, int from, int to) const |
| 117 { | 116 { |
| 118 return m_private->getFont().selectionRectForText(run, leftBaseline, height,
from, to); | 117 return m_private->getFont().selectionRectForText(run, leftBaseline, height,
from, to); |
| 119 } | 118 } |
| 120 | 119 |
| 121 } // namespace blink | 120 } // namespace blink |
| OLD | NEW |