OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2015 Google Inc. All rights reserved. | 2 * Copyright (C) 2015 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "platform/geometry/FloatRect.h" | 30 #include "platform/geometry/FloatRect.h" |
31 #include "platform/text/TextRun.h" | 31 #include "platform/text/TextRun.h" |
32 #include "wtf/Allocator.h" | 32 #include "wtf/Allocator.h" |
33 #include "wtf/PassRefPtr.h" | 33 #include "wtf/PassRefPtr.h" |
34 #include "wtf/Vector.h" | 34 #include "wtf/Vector.h" |
35 | 35 |
36 namespace blink { | 36 namespace blink { |
37 | 37 |
38 struct CharacterRange; | 38 struct CharacterRange; |
39 class Font; | 39 class Font; |
40 class GlyphBuffer; | |
41 class ShapeCache; | 40 class ShapeCache; |
42 class SimpleFontData; | 41 class SimpleFontData; |
| 42 class ShapeResultBloberizer; |
43 struct GlyphData; | 43 struct GlyphData; |
44 | 44 |
45 class PLATFORM_EXPORT CachingWordShaper final { | 45 class PLATFORM_EXPORT CachingWordShaper final { |
46 STACK_ALLOCATED(); | 46 STACK_ALLOCATED(); |
47 WTF_MAKE_NONCOPYABLE(CachingWordShaper); | 47 WTF_MAKE_NONCOPYABLE(CachingWordShaper); |
48 | 48 |
49 public: | 49 public: |
50 explicit CachingWordShaper(const Font& font) : m_font(font) {} | 50 explicit CachingWordShaper(const Font& font) : m_font(font) {} |
51 ~CachingWordShaper() {} | 51 ~CachingWordShaper() {} |
52 | 52 |
53 float width(const TextRun&, | 53 float width(const TextRun&, |
54 HashSet<const SimpleFontData*>* fallbackFonts, | 54 HashSet<const SimpleFontData*>* fallbackFonts, |
55 FloatRect* glyphBounds); | 55 FloatRect* glyphBounds); |
56 int offsetForPosition(const TextRun&, | 56 int offsetForPosition(const TextRun&, |
57 float targetX, | 57 float targetX, |
58 bool includePartialGlyphs); | 58 bool includePartialGlyphs); |
59 float fillGlyphBuffer(const TextRun&, | 59 |
60 GlyphBuffer*, | 60 float fillGlyphs(const TextRunPaintInfo&, ShapeResultBloberizer&); |
61 unsigned from, | 61 void fillTextEmphasisGlyphs(const TextRunPaintInfo&, |
62 unsigned to); | 62 const GlyphData& emphasisData, |
63 float fillGlyphBufferForTextEmphasis(const TextRun&, | 63 ShapeResultBloberizer&); |
64 const GlyphData* emphasisData, | |
65 GlyphBuffer*, | |
66 unsigned from, | |
67 unsigned to); | |
68 CharacterRange getCharacterRange(const TextRun&, | 64 CharacterRange getCharacterRange(const TextRun&, |
69 unsigned from, | 65 unsigned from, |
70 unsigned to); | 66 unsigned to); |
71 Vector<CharacterRange> individualCharacterRanges(const TextRun&); | 67 Vector<CharacterRange> individualCharacterRanges(const TextRun&); |
72 | 68 |
73 Vector<ShapeResultBuffer::RunFontData> runFontData(const TextRun&) const; | 69 Vector<ShapeResultBuffer::RunFontData> runFontData(const TextRun&) const; |
74 | 70 |
75 GlyphData emphasisMarkGlyphData(const TextRun&) const; | 71 GlyphData emphasisMarkGlyphData(const TextRun&) const; |
76 | 72 |
77 private: | 73 private: |
78 ShapeCache* shapeCache() const; | 74 ShapeCache* shapeCache() const; |
79 | 75 |
80 const Font& m_font; | 76 const Font& m_font; |
81 }; | 77 }; |
82 | 78 |
83 } // namespace blink | 79 } // namespace blink |
84 | 80 |
85 #endif // CachingWordShaper_h | 81 #endif // CachingWordShaper_h |
OLD | NEW |