+2006-09-26 Darin Adler <darin@apple.com>
+
+ Reviewed by Steve.
+
+ - clean up options for font code path
+
+ * platform/Font.h:
+ * platform/Font.cpp:
+ (WebCore::Font::setCodePath): Added. Replaces boolean version.
+ (WebCore::Font::canUseGlyphCache): Update to handle "never use complex" case too.
+
+ * platform/mac/WebCoreTextRenderer.mm:
+ (WebCoreSetAlwaysUseATSU): Change to call setCodePath.
+
2006-09-26 John Sullivan <sullivan@apple.com>
Reviewed by Darin
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
+Font::CodePath Font::codePath = Auto;
+
struct WidthIterator {
WidthIterator(const Font* font, const TextRun& run, const TextStyle& style, const FontData* substituteFontData = 0);
return m_fontList->isFixedPitch(this);
}
-// FIXME: These methods will eventually be cross-platform, but to keep Windows compiling we'll make this Apple-only for now.
-bool Font::gAlwaysUseComplexPath = false;
-void Font::setAlwaysUseComplexPath(bool alwaysUse)
+void Font::setCodePath(CodePath p)
{
- gAlwaysUseComplexPath = alwaysUse;
+ codePath = p;
}
bool Font::canUseGlyphCache(const TextRun& run) const
{
- if (gAlwaysUseComplexPath)
- return false;
+ switch (codePath) {
+ case Auto:
+ break;
+ case Simple:
+ return true;
+ case Complex:
+ return false;
+ }
// Start from 0 since drawing and highlighting also measure the characters before run->from
for (int i = 0; i < run.to(); i++) {
friend struct WidthIterator;
- // Useful for debugging the complex font rendering code path.
+ // Useful for debugging the different font rendering code paths.
public:
- static void setAlwaysUseComplexPath(bool);
- static bool gAlwaysUseComplexPath;
+ enum CodePath { Auto, Simple, Complex };
+ static void setCodePath(CodePath);
+ static CodePath codePath;
static const uint8_t gRoundingHackCharacterTable[256];
static bool treatAsSpace(UChar c) { return c == ' ' || c == '\t' || c == '\n' || c == 0x00A0; }