| 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 30 matching lines...) Expand all Loading... |
| 41 const String& text) override {} | 41 const String& text) override {} |
| 42 void willUseRange(const FontDescription&, | 42 void willUseRange(const FontDescription&, |
| 43 const AtomicString& familyName, | 43 const AtomicString& familyName, |
| 44 const FontDataForRangeSet&) override{}; | 44 const FontDataForRangeSet&) override{}; |
| 45 | 45 |
| 46 unsigned version() const override { return 0; } | 46 unsigned version() const override { return 0; } |
| 47 void fontCacheInvalidated() override {} | 47 void fontCacheInvalidated() override {} |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 TestFontSelector(PassRefPtr<FontCustomPlatformData> customPlatformData) | 50 TestFontSelector(PassRefPtr<FontCustomPlatformData> customPlatformData) |
| 51 : m_customPlatformData(customPlatformData) {} | 51 : m_customPlatformData(std::move(customPlatformData)) {} |
| 52 | 52 |
| 53 RefPtr<FontCustomPlatformData> m_customPlatformData; | 53 RefPtr<FontCustomPlatformData> m_customPlatformData; |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 } // namespace | 56 } // namespace |
| 57 | 57 |
| 58 Font createTestFont(const AtomicString& familyName, | 58 Font createTestFont(const AtomicString& familyName, |
| 59 const String& fontPath, | 59 const String& fontPath, |
| 60 float size) { | 60 float size) { |
| 61 FontFamily family; | 61 FontFamily family; |
| 62 family.setFamily(familyName); | 62 family.setFamily(familyName); |
| 63 | 63 |
| 64 FontDescription fontDescription; | 64 FontDescription fontDescription; |
| 65 fontDescription.setFamily(family); | 65 fontDescription.setFamily(family); |
| 66 fontDescription.setSpecifiedSize(size); | 66 fontDescription.setSpecifiedSize(size); |
| 67 fontDescription.setComputedSize(size); | 67 fontDescription.setComputedSize(size); |
| 68 | 68 |
| 69 Font font(fontDescription); | 69 Font font(fontDescription); |
| 70 font.update(TestFontSelector::create(fontPath)); | 70 font.update(TestFontSelector::create(fontPath)); |
| 71 return font; | 71 return font; |
| 72 } | 72 } |
| 73 | 73 |
| 74 } // namespace testing | 74 } // namespace testing |
| 75 } // namespace blink | 75 } // namespace blink |
| OLD | NEW |