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 "platform/testing/FontTestHelpers.h" | 5 #include "platform/testing/FontTestHelpers.h" |
6 | 6 |
7 #include "platform/fonts/Font.h" | 7 #include "platform/fonts/Font.h" |
8 #include "platform/fonts/FontCustomPlatformData.h" | 8 #include "platform/fonts/FontCustomPlatformData.h" |
9 #include "platform/fonts/FontDescription.h" | 9 #include "platform/fonts/FontDescription.h" |
10 #include "platform/fonts/FontSelector.h" | 10 #include "platform/fonts/FontSelector.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 void willUseFontData(const FontDescription&, const AtomicString& familyName, | 44 void willUseFontData(const FontDescription&, const AtomicString& familyName, |
45 UChar32) override { } | 45 UChar32) override { } |
46 void willUseRange(const FontDescription&, const AtomicString& familyName, | 46 void willUseRange(const FontDescription&, const AtomicString& familyName, |
47 const FontDataForRangeSet&) override { }; | 47 const FontDataForRangeSet&) override { }; |
48 | 48 |
49 unsigned version() const override { return 0; } | 49 unsigned version() const override { return 0; } |
50 void fontCacheInvalidated() override { } | 50 void fontCacheInvalidated() override { } |
51 | 51 |
52 private: | 52 private: |
53 TestFontSelector(PassOwnPtr<FontCustomPlatformData> customPlatformData) | 53 TestFontSelector(PassOwnPtr<FontCustomPlatformData> customPlatformData) |
54 : m_customPlatformData(customPlatformData) | 54 : m_customPlatformData(std::move(customPlatformData)) |
55 { | 55 { |
56 } | 56 } |
57 | 57 |
58 OwnPtr<FontCustomPlatformData> m_customPlatformData; | 58 OwnPtr<FontCustomPlatformData> m_customPlatformData; |
59 }; | 59 }; |
60 | 60 |
61 } // namespace | 61 } // namespace |
62 | 62 |
63 Font createTestFont(const AtomicString& familyName, const String& fontPath, floa
t size) | 63 Font createTestFont(const AtomicString& familyName, const String& fontPath, floa
t size) |
64 { | 64 { |
65 FontFamily family; | 65 FontFamily family; |
66 family.setFamily(familyName); | 66 family.setFamily(familyName); |
67 | 67 |
68 FontDescription fontDescription; | 68 FontDescription fontDescription; |
69 fontDescription.setFamily(family); | 69 fontDescription.setFamily(family); |
70 fontDescription.setSpecifiedSize(size); | 70 fontDescription.setSpecifiedSize(size); |
71 fontDescription.setComputedSize(size); | 71 fontDescription.setComputedSize(size); |
72 | 72 |
73 Font font(fontDescription); | 73 Font font(fontDescription); |
74 font.update(TestFontSelector::create(fontPath)); | 74 font.update(TestFontSelector::create(fontPath)); |
75 return font; | 75 return font; |
76 } | 76 } |
77 | 77 |
78 } // namespace testing | 78 } // namespace testing |
79 } // namespace blink | 79 } // namespace blink |
OLD | NEW |