Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(59)

Side by Side Diff: third_party/WebKit/Source/platform/testing/FontTestHelpers.cpp

Issue 1931393002: Introduce typeface cache in blink::FontCache (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: wip: others Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 16 matching lines...) Expand all
27 return new TestFontSelector(FontCustomPlatformData::create( 27 return new TestFontSelector(FontCustomPlatformData::create(
28 fontBuffer.get(), otsParseMessage)); 28 fontBuffer.get(), otsParseMessage));
29 } 29 }
30 30
31 ~TestFontSelector() override { } 31 ~TestFontSelector() override { }
32 32
33 PassRefPtr<FontData> getFontData(const FontDescription& fontDescription, 33 PassRefPtr<FontData> getFontData(const FontDescription& fontDescription,
34 const AtomicString& familyName) override 34 const AtomicString& familyName) override
35 { 35 {
36 FontPlatformData platformData = m_customPlatformData->fontPlatformData( 36 FontPlatformData platformData = m_customPlatformData->fontPlatformData(
37 fontDescription.effectiveFontSize(),
38 fontDescription.isSyntheticBold(), 37 fontDescription.isSyntheticBold(),
39 fontDescription.isSyntheticItalic(), 38 fontDescription.isSyntheticItalic(),
40 fontDescription.orientation()); 39 fontDescription.orientation());
41 return SimpleFontData::create(platformData, CustomFontData::create()); 40 return SimpleFontData::create(platformData, fontDescription.effectiveFon tSize(), CustomFontData::create());
42 } 41 }
43 42
44 void willUseFontData(const FontDescription&, const AtomicString& familyName, 43 void willUseFontData(const FontDescription&, const AtomicString& familyName,
45 UChar32) override { } 44 UChar32) override { }
46 void willUseRange(const FontDescription&, const AtomicString& familyName, 45 void willUseRange(const FontDescription&, const AtomicString& familyName,
47 const FontDataForRangeSet&) override { }; 46 const FontDataForRangeSet&) override { };
48 47
49 unsigned version() const override { return 0; } 48 unsigned version() const override { return 0; }
50 void fontCacheInvalidated() override { } 49 void fontCacheInvalidated() override { }
51 50
(...skipping 18 matching lines...) Expand all
70 fontDescription.setSpecifiedSize(size); 69 fontDescription.setSpecifiedSize(size);
71 fontDescription.setComputedSize(size); 70 fontDescription.setComputedSize(size);
72 71
73 Font font(fontDescription); 72 Font font(fontDescription);
74 font.update(TestFontSelector::create(fontPath)); 73 font.update(TestFontSelector::create(fontPath));
75 return font; 74 return font;
76 } 75 }
77 76
78 } // namespace testing 77 } // namespace testing
79 } // namespace blink 78 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698