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

Side by Side Diff: Source/platform/fonts/FontFallbackList.h

Issue 362963003: Encapsulate FontFallbackList's page access logic. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « Source/platform/fonts/Font.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2010 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2010 Apple Inc. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 return m_cachedPrimarySimpleFontData; 98 return m_cachedPrimarySimpleFontData;
99 } 99 }
100 100
101 PassRefPtr<FontData> getFontData(const FontDescription&, int& familyIndex) c onst; 101 PassRefPtr<FontData> getFontData(const FontDescription&, int& familyIndex) c onst;
102 102
103 const SimpleFontData* determinePrimarySimpleFontData(const FontDescription&) const; 103 const SimpleFontData* determinePrimarySimpleFontData(const FontDescription&) const;
104 const FontData* fontDataAt(const FontDescription&, unsigned index) const; 104 const FontData* fontDataAt(const FontDescription&, unsigned index) const;
105 105
106 void releaseFontData(); 106 void releaseFontData();
107 107
108 GlyphPageTreeNode* getPageNode(unsigned pageNumber) const
109 {
110 return pageNumber ? m_pages.get(pageNumber) : m_pageZero;
111 }
112
113 void setPageNode(unsigned pageNumber, GlyphPageTreeNode* node)
114 {
115 if (pageNumber)
116 m_pages.set(pageNumber, node);
117 else
118 m_pageZero = node;
119 }
120
108 mutable Vector<RefPtr<FontData>, 1> m_fontList; 121 mutable Vector<RefPtr<FontData>, 1> m_fontList;
109 mutable GlyphPages m_pages; 122 mutable GlyphPages m_pages;
jbroman 2014/07/02 12:46:44 nit: Any reason for these two members to be mutabl
f(malita) 2014/07/02 13:07:30 I totally meant to do this and then forgot :) Done
110 mutable GlyphPageTreeNode* m_pageZero; 123 mutable GlyphPageTreeNode* m_pageZero;
111 mutable const SimpleFontData* m_cachedPrimarySimpleFontData; 124 mutable const SimpleFontData* m_cachedPrimarySimpleFontData;
112 RefPtrWillBePersistent<FontSelector> m_fontSelector; 125 RefPtrWillBePersistent<FontSelector> m_fontSelector;
113 mutable WidthCache m_widthCache; 126 mutable WidthCache m_widthCache;
114 unsigned m_fontSelectorVersion; 127 unsigned m_fontSelectorVersion;
115 mutable int m_familyIndex; 128 mutable int m_familyIndex;
116 unsigned short m_generation; 129 unsigned short m_generation;
117 mutable unsigned m_pitch : 3; // Pitch 130 mutable unsigned m_pitch : 3; // Pitch
118 mutable bool m_hasLoadingFallback : 1; 131 mutable bool m_hasLoadingFallback : 1;
119 132
120 friend class Font; 133 friend class Font;
jbroman 2014/07/02 12:46:44 nit: How about making these two methods public and
f(malita) 2014/07/02 13:07:30 Font.cpp is also using a couple of other private m
121 }; 134 };
122 135
123 } 136 }
124 137
125 #endif 138 #endif
OLDNEW
« no previous file with comments | « Source/platform/fonts/Font.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698