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

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

Issue 2066253002: Fix Refcount in FontDataCache for objects from FontFallbackIterator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 6 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 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/FontDataForRangeSet.h" 8 #include "platform/fonts/FontDataForRangeSet.h"
9 #include "platform/fonts/FontFallbackPriority.h" 9 #include "platform/fonts/FontFallbackPriority.h"
10 #include "wtf/HashMap.h" 10 #include "wtf/HashMap.h"
(...skipping 22 matching lines...) Expand all
33 // Returns whether a list of all remaining characters to be shaped is 33 // Returns whether a list of all remaining characters to be shaped is
34 // needed. Needed by the FontfallbackIterator in order to check whether a 34 // needed. Needed by the FontfallbackIterator in order to check whether a
35 // font from a segmented range should be loaded. 35 // font from a segmented range should be loaded.
36 bool needsHintList() const; 36 bool needsHintList() const;
37 37
38 bool hasNext() const { return m_fallbackStage != OutOfLuck; }; 38 bool hasNext() const { return m_fallbackStage != OutOfLuck; };
39 39
40 // Some system fallback APIs (Windows, Android) require a character, or a 40 // Some system fallback APIs (Windows, Android) require a character, or a
41 // portion of the string to be passed. On Mac and Linux, we get a list of 41 // portion of the string to be passed. On Mac and Linux, we get a list of
42 // fonts without passing in characters. 42 // fonts without passing in characters.
43 const FontDataForRangeSet next(const Vector<UChar32>& hintList); 43 const PassRefPtr<FontDataForRangeSet> next(const Vector<UChar32>& hintList);
44 44
45 private: 45 private:
46 FontFallbackIterator(const FontDescription&, PassRefPtr<FontFallbackList>, 46 FontFallbackIterator(const FontDescription&, PassRefPtr<FontFallbackList>,
47 FontFallbackPriority); 47 FontFallbackPriority);
48 bool rangeSetContributesForHint(const Vector<UChar32> hintList, const FontDa taForRangeSet&); 48 bool rangeSetContributesForHint(const Vector<UChar32> hintList, const FontDa taForRangeSet*);
49 bool alreadyLoadingRangeForHintChar(UChar32 hintChar); 49 bool alreadyLoadingRangeForHintChar(UChar32 hintChar);
50 void willUseRange(const AtomicString& family, const FontDataForRangeSet&); 50 void willUseRange(const AtomicString& family, const FontDataForRangeSet&);
51 51
52 const PassRefPtr<SimpleFontData> fallbackPriorityFont(UChar32 hint); 52 const PassRefPtr<SimpleFontData> fallbackPriorityFont(UChar32 hint);
53 const PassRefPtr<SimpleFontData> uniqueSystemFontForHint(UChar32 hint); 53 const PassRefPtr<SimpleFontData> uniqueSystemFontForHint(UChar32 hint);
54 54
55 const FontDescription& m_fontDescription; 55 const FontDescription& m_fontDescription;
56 RefPtr<FontFallbackList> m_fontFallbackList; 56 RefPtr<FontFallbackList> m_fontFallbackList;
57 int m_currentFontDataIndex; 57 int m_currentFontDataIndex;
58 unsigned m_segmentedFaceIndex; 58 unsigned m_segmentedFaceIndex;
59 59
60 enum FallbackStage { 60 enum FallbackStage {
61 FallbackPriorityFonts, 61 FallbackPriorityFonts,
62 FontGroupFonts, 62 FontGroupFonts,
63 SegmentedFace, 63 SegmentedFace,
64 PreferencesFonts, 64 PreferencesFonts,
65 SystemFonts, 65 SystemFonts,
66 OutOfLuck 66 OutOfLuck
67 }; 67 };
68 68
69 FallbackStage m_fallbackStage; 69 FallbackStage m_fallbackStage;
70 HashSet<UChar32> m_previouslyAskedForHint; 70 HashSet<UChar32> m_previouslyAskedForHint;
71 Vector<FontDataForRangeSet> m_trackedLoadingRangeSets; 71 Vector<RefPtr<FontDataForRangeSet>> m_trackedLoadingRangeSets;
72 FontFallbackPriority m_fontFallbackPriority; 72 FontFallbackPriority m_fontFallbackPriority;
73 }; 73 };
74 74
75 } // namespace blink 75 } // namespace blink
76 76
77 #endif 77 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698