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

Unified Diff: third_party/WebKit/Source/platform/fonts/Font.cpp

Issue 1931393002: Introduce typeface cache in blink::FontCache (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: wip: others Created 4 years, 8 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
Index: third_party/WebKit/Source/platform/fonts/Font.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/Font.cpp b/third_party/WebKit/Source/platform/fonts/Font.cpp
index 094bfebbf39e69345ef7fd0f02338c4c10a0ff84..3f07d5a9d660857c297a661f2cb76bb6f0e33422 100644
--- a/third_party/WebKit/Source/platform/fonts/Font.cpp
+++ b/third_party/WebKit/Source/platform/fonts/Font.cpp
@@ -250,7 +250,6 @@ class GlyphBufferBloberizer {
public:
GlyphBufferBloberizer(const GlyphBuffer& buffer, const Font* font, float deviceScaleFactor)
: m_buffer(buffer)
- , m_font(font)
, m_deviceScaleFactor(deviceScaleFactor)
, m_hasVerticalOffsets(buffer.hasVerticalOffsets())
, m_index(0)
@@ -301,7 +300,9 @@ private:
void appendRun(unsigned start, unsigned count, const SimpleFontData* fontData)
{
SkPaint paint;
- fontData->platformData().setupPaint(&paint, m_deviceScaleFactor, m_font);
+ fontData->style().apply(&paint, m_deviceScaleFactor);
+ fontData->platformData().setupPaint(&paint);
+ paint.setTextSize(SkFloatToScalar(fontData->size()));
paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
const SkTextBlobBuilder::RunBuffer& buffer = m_hasVerticalOffsets
@@ -329,7 +330,6 @@ private:
}
const GlyphBuffer& m_buffer;
- const Font* m_font;
const float m_deviceScaleFactor;
const bool m_hasVerticalOffsets;
@@ -467,7 +467,7 @@ bool Font::computeCanShapeWordByWord() const
const FontPlatformData& platformData = primaryFont()->platformData();
TypesettingFeatures features = getFontDescription().getTypesettingFeatures();
- return !platformData.hasSpaceInLigaturesOrKerning(features);
+ return !platformData.hasSpaceInLigaturesOrKerning(primaryFont()->size(), primaryFont()->style(), features);
};
void Font::willUseFontData(UChar32 character) const
« no previous file with comments | « third_party/WebKit/Source/platform/blink_platform.gypi ('k') | third_party/WebKit/Source/platform/fonts/FontCache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698