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

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

Issue 2751163002: Report UseCounter metric when observing NotDef glyphs (Closed)
Patch Set: Relax num_glyphs assertion, not feasible on Mac Created 3 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 28 matching lines...) Expand all
39 39
40 void WillUseFontData(const FontDescription&, 40 void WillUseFontData(const FontDescription&,
41 const AtomicString& family_name, 41 const AtomicString& family_name,
42 const String& text) override {} 42 const String& text) override {}
43 void WillUseRange(const FontDescription&, 43 void WillUseRange(const FontDescription&,
44 const AtomicString& family_name, 44 const AtomicString& family_name,
45 const FontDataForRangeSet&) override{}; 45 const FontDataForRangeSet&) override{};
46 46
47 unsigned Version() const override { return 0; } 47 unsigned Version() const override { return 0; }
48 void FontCacheInvalidated() override {} 48 void FontCacheInvalidated() override {}
49 void ReportNotDefGlyph() const override{};
49 50
50 private: 51 private:
51 TestFontSelector(PassRefPtr<FontCustomPlatformData> custom_platform_data) 52 TestFontSelector(PassRefPtr<FontCustomPlatformData> custom_platform_data)
52 : custom_platform_data_(std::move(custom_platform_data)) {} 53 : custom_platform_data_(std::move(custom_platform_data)) {}
53 54
54 RefPtr<FontCustomPlatformData> custom_platform_data_; 55 RefPtr<FontCustomPlatformData> custom_platform_data_;
55 }; 56 };
56 57
57 } // namespace 58 } // namespace
58 59
59 Font CreateTestFont(const AtomicString& family_name, 60 Font CreateTestFont(const AtomicString& family_name,
60 const String& font_path, 61 const String& font_path,
61 float size) { 62 float size) {
62 FontFamily family; 63 FontFamily family;
63 family.SetFamily(family_name); 64 family.SetFamily(family_name);
64 65
65 FontDescription font_description; 66 FontDescription font_description;
66 font_description.SetFamily(family); 67 font_description.SetFamily(family);
67 font_description.SetSpecifiedSize(size); 68 font_description.SetSpecifiedSize(size);
68 font_description.SetComputedSize(size); 69 font_description.SetComputedSize(size);
69 70
70 Font font(font_description); 71 Font font(font_description);
71 font.Update(TestFontSelector::Create(font_path)); 72 font.Update(TestFontSelector::Create(font_path));
72 return font; 73 return font;
73 } 74 }
74 75
75 } // namespace testing 76 } // namespace testing
76 } // namespace blink 77 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/fonts/shaping/HarfBuzzShaper.cpp ('k') | tools/metrics/histograms/enums.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698