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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 | 42 |
43 class PLATFORM_EXPORT CachingWordShaper final { | 43 class PLATFORM_EXPORT CachingWordShaper final { |
44 public: | 44 public: |
45 CachingWordShaper(); | 45 CachingWordShaper(); |
46 ~CachingWordShaper(); | 46 ~CachingWordShaper(); |
47 void clear(); | 47 void clear(); |
48 | 48 |
49 float width(const Font*, const TextRun&, | 49 float width(const Font*, const TextRun&, |
50 HashSet<const SimpleFontData*>* fallbackFonts, | 50 HashSet<const SimpleFontData*>* fallbackFonts, |
51 FloatRect* glyphBounds); | 51 FloatRect* glyphBounds); |
| 52 int offsetForPosition(const Font*, const TextRun&, float targetX); |
52 float fillGlyphBuffer(const Font*, const TextRun&, | 53 float fillGlyphBuffer(const Font*, const TextRun&, |
53 HashSet<const SimpleFontData*>*, GlyphBuffer*, | 54 HashSet<const SimpleFontData*>*, GlyphBuffer*, |
54 unsigned from, unsigned to); | 55 unsigned from, unsigned to); |
55 float fillGlyphBufferForTextEmphasis(const Font*, const TextRun&, | 56 float fillGlyphBufferForTextEmphasis(const Font*, const TextRun&, |
56 const GlyphData* emphasisData, GlyphBuffer*, | 57 const GlyphData* emphasisData, GlyphBuffer*, |
57 unsigned from, unsigned to); | 58 unsigned from, unsigned to); |
58 FloatRect selectionRect(const Font*, const TextRun&, const FloatPoint&, | 59 FloatRect selectionRect(const Font*, const TextRun&, const FloatPoint&, |
59 int height, unsigned from, unsigned to); | 60 int height, unsigned from, unsigned to); |
60 | 61 |
61 private: | 62 private: |
62 OwnPtr<ShapeCache> m_shapeCache; | 63 OwnPtr<ShapeCache> m_shapeCache; |
63 }; | 64 }; |
64 | 65 |
65 } // namespace blink | 66 } // namespace blink |
66 | 67 |
67 #endif // CachingWordShaper_h | 68 #endif // CachingWordShaper_h |
OLD | NEW |