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

Side by Side Diff: Source/platform/fonts/shaping/SimpleShaper.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2003, 2006, 2008, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2003, 2006, 2008, 2011 Apple Inc. All rights reserved.
3 * Copyright (C) 2008 Holger Hans Peter Freyther 3 * Copyright (C) 2008 Holger Hans Peter Freyther
4 * Copyright (C) 2014 Google Inc. All rights reserved. 4 * Copyright (C) 2014 Google Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 24 matching lines...) Expand all
35 35
36 class Font; 36 class Font;
37 class GlyphBuffer; 37 class GlyphBuffer;
38 class SimpleFontData; 38 class SimpleFontData;
39 class TextRun; 39 class TextRun;
40 struct GlyphData; 40 struct GlyphData;
41 41
42 struct PLATFORM_EXPORT SimpleShaper : public Shaper { 42 struct PLATFORM_EXPORT SimpleShaper : public Shaper {
43 WTF_MAKE_FAST_ALLOCATED; 43 WTF_MAKE_FAST_ALLOCATED;
44 public: 44 public:
45 SimpleShaper(const Font*, const TextRun&, HashSet<const SimpleFontData*>* fa llbackFonts = 0, FloatRect* = 0, bool forTextEmphasis = false); 45 SimpleShaper(const Font*, const TextRun&, const GlyphData* emphasisData = nu llptr,
46 HashSet<const SimpleFontData*>* fallbackFonts = nullptr, FloatRect* = nu llptr);
46 47
47 unsigned advance(unsigned to, GlyphBuffer* = 0); 48 unsigned advance(unsigned to, GlyphBuffer* = 0);
48 bool advanceOneCharacter(float& width); 49 bool advanceOneCharacter(float& width);
49 50
50 const TextRun& run() const { return m_run; } 51 const TextRun& run() const { return m_run; }
51 float runWidthSoFar() const { return m_runWidthSoFar; } 52 float runWidthSoFar() const { return m_runWidthSoFar; }
52 unsigned currentOffset() { return m_currentCharacter; } 53 unsigned currentOffset() { return m_currentCharacter; }
53 54
54 private: 55 private:
55 unsigned m_currentCharacter; 56 unsigned m_currentCharacter;
56 float m_runWidthSoFar; 57 float m_runWidthSoFar;
57 58
58 struct CharacterData { 59 struct CharacterData {
59 UChar32 character; 60 UChar32 character;
60 unsigned clusterLength; 61 unsigned clusterLength;
61 int characterOffset; 62 int characterOffset;
62 }; 63 };
63 64
64 GlyphData glyphDataForCharacter(CharacterData&, bool normalizeSpace = false) ; 65 GlyphData glyphDataForCharacter(CharacterData&, bool normalizeSpace = false) ;
65 float characterWidth(UChar32, const GlyphData&) const; 66 float characterWidth(UChar32, const GlyphData&) const;
66 float adjustSpacing(float, const CharacterData&); 67 float adjustSpacing(float, const CharacterData&);
67 68
68 template <typename TextIterator> 69 template <typename TextIterator>
69 unsigned advanceInternal(TextIterator&, GlyphBuffer*); 70 unsigned advanceInternal(TextIterator&, GlyphBuffer*);
70 }; 71 };
71 72
72 } // namespace blink 73 } // namespace blink
73 74
74 #endif 75 #endif
OLDNEW
« no previous file with comments | « Source/platform/fonts/shaping/Shaper.cpp ('k') | Source/platform/fonts/shaping/SimpleShaper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698