| 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 21 matching lines...) Expand all Loading... |
| 32 #include "platform/wtf/Allocator.h" | 32 #include "platform/wtf/Allocator.h" |
| 33 #include "platform/wtf/PassRefPtr.h" | 33 #include "platform/wtf/PassRefPtr.h" |
| 34 #include "platform/wtf/Vector.h" | 34 #include "platform/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 ShapeCache; | 40 class ShapeCache; |
| 41 class SimpleFontData; | 41 class SimpleFontData; |
| 42 class ShapeResultBloberizer; | |
| 43 struct GlyphData; | 42 struct GlyphData; |
| 44 | 43 |
| 45 class PLATFORM_EXPORT CachingWordShaper final { | 44 class PLATFORM_EXPORT CachingWordShaper final { |
| 46 STACK_ALLOCATED(); | 45 STACK_ALLOCATED(); |
| 47 WTF_MAKE_NONCOPYABLE(CachingWordShaper); | 46 WTF_MAKE_NONCOPYABLE(CachingWordShaper); |
| 48 | 47 |
| 49 public: | 48 public: |
| 50 explicit CachingWordShaper(const Font& font) : font_(font) {} | 49 explicit CachingWordShaper(const Font& font) : font_(font) {} |
| 51 ~CachingWordShaper() {} | 50 ~CachingWordShaper() {} |
| 52 | 51 |
| 53 float Width(const TextRun&, | 52 float Width(const TextRun&, |
| 54 HashSet<const SimpleFontData*>* fallback_fonts, | 53 HashSet<const SimpleFontData*>* fallback_fonts, |
| 55 FloatRect* glyph_bounds); | 54 FloatRect* glyph_bounds); |
| 56 int OffsetForPosition(const TextRun&, | 55 int OffsetForPosition(const TextRun&, |
| 57 float target_x, | 56 float target_x, |
| 58 bool include_partial_glyphs); | 57 bool include_partial_glyphs); |
| 59 | 58 |
| 60 float FillGlyphs(const TextRunPaintInfo&, ShapeResultBloberizer&); | 59 void FillResultBuffer(const TextRunPaintInfo&, ShapeResultBuffer*); |
| 61 void FillTextEmphasisGlyphs(const TextRunPaintInfo&, | |
| 62 const GlyphData& emphasis_data, | |
| 63 ShapeResultBloberizer&); | |
| 64 CharacterRange GetCharacterRange(const TextRun&, unsigned from, unsigned to); | 60 CharacterRange GetCharacterRange(const TextRun&, unsigned from, unsigned to); |
| 65 Vector<CharacterRange> IndividualCharacterRanges(const TextRun&); | 61 Vector<CharacterRange> IndividualCharacterRanges(const TextRun&); |
| 66 | 62 |
| 67 Vector<ShapeResultBuffer::RunFontData> GetRunFontData(const TextRun&) const; | 63 Vector<ShapeResultBuffer::RunFontData> GetRunFontData(const TextRun&) const; |
| 68 | 64 |
| 69 GlyphData EmphasisMarkGlyphData(const TextRun&) const; | 65 GlyphData EmphasisMarkGlyphData(const TextRun&) const; |
| 70 | 66 |
| 71 private: | 67 private: |
| 72 ShapeCache* GetShapeCache() const; | 68 ShapeCache* GetShapeCache() const; |
| 73 | 69 |
| 74 const Font& font_; | 70 const Font& font_; |
| 75 }; | 71 }; |
| 76 | 72 |
| 77 } // namespace blink | 73 } // namespace blink |
| 78 | 74 |
| 79 #endif // CachingWordShaper_h | 75 #endif // CachingWordShaper_h |
| OLD | NEW |