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

Unified Diff: Source/platform/fonts/shaping/Shaper.h

Issue 986493002: Simplify text emphasis painting (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: review comments Created 5 years, 9 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/shaping/HarfBuzzShaper.cpp ('k') | Source/platform/fonts/shaping/Shaper.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/shaping/Shaper.h
diff --git a/Source/platform/fonts/shaping/Shaper.h b/Source/platform/fonts/shaping/Shaper.h
index cbdfb841e4c5d6020b6a2bed69b3841b4c45ef5c..18ad7084a5e0850f5dd749ab90df3f48e8b08311 100644
--- a/Source/platform/fonts/shaping/Shaper.h
+++ b/Source/platform/fonts/shaping/Shaper.h
@@ -42,19 +42,18 @@ class GlyphBuffer;
class SimpleFontData;
class TextRun;
-class PLATFORM_EXPORT Shaper {
-public:
- enum ForTextEmphasisOrNot {
- NotForTextEmphasis,
- ForTextEmphasis
- };
+struct GlyphData;
+class PLATFORM_EXPORT Shaper {
protected:
- Shaper(const Font*, const TextRun&, ForTextEmphasisOrNot = NotForTextEmphasis, HashSet<const SimpleFontData*>* fallbackFonts = nullptr, FloatRect* = nullptr);
+ Shaper(const Font*, const TextRun&, const GlyphData* emphasisData = nullptr,
+ HashSet<const SimpleFontData*>* fallbackFonts = nullptr, FloatRect* = nullptr);
void trackNonPrimaryFallbackFont(const SimpleFontData*);
-protected:
+ bool forTextEmphasis() const { return m_emphasisSubstitutionData; }
+ void addEmphasisMark(GlyphBuffer*, float midGlyphOffset) const;
+
const Font* m_font;
const TextRun& m_run;
HashSet<const SimpleFontData*>* m_fallbackFonts;
@@ -64,7 +63,11 @@ protected:
float m_expansionPerOpportunity; // Pixels to be added to each expansion opportunity.
bool m_isAfterExpansion;
- ForTextEmphasisOrNot m_forTextEmphasis;
+private:
+ // Emphasis substitution info. If specified, this will be used to replace all glyphs which
+ // can receive text emphasis with center-aligned emphasis glyphs.
+ const GlyphData* m_emphasisSubstitutionData;
+ FloatPoint m_emphasisGlyphCenter;
};
inline void Shaper::trackNonPrimaryFallbackFont(const SimpleFontData* fontData)
« no previous file with comments | « Source/platform/fonts/shaping/HarfBuzzShaper.cpp ('k') | Source/platform/fonts/shaping/Shaper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698