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

Side by Side Diff: third_party/WebKit/Source/platform/fonts/FontFallbackIterator.h

Issue 1397423004: Improve shaping segmentation for grapheme cluster based font fallback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge TestExpectations with the HarfBuzz rebaselines Created 5 years, 1 month 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #ifndef FontFallbackIterator_h 5 #ifndef FontFallbackIterator_h
6 #define FontFallbackIterator_h 6 #define FontFallbackIterator_h
7 7
8 #include "platform/fonts/FontDataRange.h" 8 #include "platform/fonts/FontDataRange.h"
9 #include "wtf/HashMap.h" 9 #include "wtf/HashMap.h"
10 #include "wtf/PassRefPtr.h" 10 #include "wtf/PassRefPtr.h"
(...skipping 21 matching lines...) Expand all
32 // Returns whether a list of all remaining characters to be shaped is 32 // Returns whether a list of all remaining characters to be shaped is
33 // needed. Needed by the FontfallbackIterator in order to check whether a 33 // needed. Needed by the FontfallbackIterator in order to check whether a
34 // font from a segmented range should be loaded. 34 // font from a segmented range should be loaded.
35 bool needsHintList() const; 35 bool needsHintList() const;
36 36
37 bool hasNext() const { return m_fallbackStage != OutOfLuck; }; 37 bool hasNext() const { return m_fallbackStage != OutOfLuck; };
38 38
39 // Some system fallback APIs (Windows, Android) require a character, or a 39 // Some system fallback APIs (Windows, Android) require a character, or a
40 // portion of the string to be passed. On Mac and Linux, we get a list of 40 // portion of the string to be passed. On Mac and Linux, we get a list of
41 // fonts without passing in characters. 41 // fonts without passing in characters.
42 const SimpleFontData* next(const Vector<UChar32>& hintList); 42 const FontDataRange next(const Vector<UChar32>& hintList);
43 43
44 private: 44 private:
45 FontFallbackIterator(const FontDescription&, PassRefPtr<FontFallbackList>); 45 FontFallbackIterator(const FontDescription&, PassRefPtr<FontFallbackList>);
46 bool rangeContributesForHint(const Vector<UChar32> hintList, const FontDataR ange&);
47 bool alreadyLoadingRangeForHintChar(UChar32 hintChar);
46 void willUseRange(const AtomicString& family, const FontDataRange&); 48 void willUseRange(const AtomicString& family, const FontDataRange&);
47 49
48 const SimpleFontData* uniqueSystemFontForHint(UChar32 hint); 50 const PassRefPtr<SimpleFontData> uniqueSystemFontForHint(UChar32 hint);
49 51
50 const FontDescription& m_fontDescription; 52 const FontDescription& m_fontDescription;
51 RefPtr<FontFallbackList> m_fontFallbackList; 53 RefPtr<FontFallbackList> m_fontFallbackList;
52 int m_currentFontDataIndex; 54 int m_currentFontDataIndex;
53 unsigned m_segmentedIndex; 55 unsigned m_segmentedIndex;
54 56
55 enum FallbackStage { 57 enum FallbackStage {
56 FontGroupFonts, 58 FontGroupFonts,
57 SegmentedFace, 59 SegmentedFace,
58 PreferencesFonts, 60 PreferencesFonts,
59 SystemFonts, 61 SystemFonts,
60 OutOfLuck 62 OutOfLuck
61 }; 63 };
62 64
63 FallbackStage m_fallbackStage; 65 FallbackStage m_fallbackStage;
64 const FontFamily* m_currentFamily; 66 const FontFamily* m_currentFamily;
65 HashMap<UChar32, RefPtr<SimpleFontData>> m_visitedSystemFonts; 67 HashMap<UChar32, RefPtr<SimpleFontData>> m_visitedSystemFonts;
68 Vector<FontDataRange> m_loadingCustomFontForRanges;
66 }; 69 };
67 70
68 } // namespace blink 71 } // namespace blink
69 72
70 #endif 73 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698