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

Unified 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: No longer mutable, break friendship. Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/platform/fonts/Font.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/FontFallbackList.h
diff --git a/Source/platform/fonts/FontFallbackList.h b/Source/platform/fonts/FontFallbackList.h
index 252b8df26249898e5204cab9ac4a8b7ea5435de4..7975378ad087ba3484cab84ad812a34fe1a82d6f 100644
--- a/Source/platform/fonts/FontFallbackList.h
+++ b/Source/platform/fonts/FontFallbackList.h
@@ -87,9 +87,6 @@ public:
WidthCache& widthCache() const { return m_widthCache; }
-private:
- FontFallbackList();
-
const SimpleFontData* primarySimpleFontData(const FontDescription& fontDescription)
{
ASSERT(isMainThread());
@@ -97,17 +94,33 @@ private:
m_cachedPrimarySimpleFontData = determinePrimarySimpleFontData(fontDescription);
return m_cachedPrimarySimpleFontData;
}
+ const FontData* fontDataAt(const FontDescription&, unsigned index) const;
+
+ GlyphPageTreeNode* getPageNode(unsigned pageNumber) const
+ {
+ return pageNumber ? m_pages.get(pageNumber) : m_pageZero;
+ }
+
+ void setPageNode(unsigned pageNumber, GlyphPageTreeNode* node)
+ {
+ if (pageNumber)
+ m_pages.set(pageNumber, node);
+ else
+ m_pageZero = node;
+ }
+
+private:
+ FontFallbackList();
PassRefPtr<FontData> getFontData(const FontDescription&, int& familyIndex) const;
const SimpleFontData* determinePrimarySimpleFontData(const FontDescription&) const;
- const FontData* fontDataAt(const FontDescription&, unsigned index) const;
void releaseFontData();
mutable Vector<RefPtr<FontData>, 1> m_fontList;
- mutable GlyphPages m_pages;
- mutable GlyphPageTreeNode* m_pageZero;
+ GlyphPages m_pages;
+ GlyphPageTreeNode* m_pageZero;
mutable const SimpleFontData* m_cachedPrimarySimpleFontData;
RefPtrWillBePersistent<FontSelector> m_fontSelector;
mutable WidthCache m_widthCache;
@@ -116,8 +129,6 @@ private:
unsigned short m_generation;
mutable unsigned m_pitch : 3; // Pitch
mutable bool m_hasLoadingFallback : 1;
-
- friend class Font;
};
}
« 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