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

Side by Side Diff: Source/platform/fonts/shaping/SimpleShaper.h

Issue 1305953003: Find In Page doesn't correctly highlight wrapped text. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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
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 27 matching lines...) Expand all
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(SimpleShaper); 43 WTF_MAKE_FAST_ALLOCATED(SimpleShaper);
44 public: 44 public:
45 SimpleShaper(const Font*, const TextRun&, const GlyphData* emphasisData = nu llptr, 45 SimpleShaper(const Font*, const TextRun&, const GlyphData* emphasisData = nu llptr,
46 HashSet<const SimpleFontData*>* fallbackFonts = nullptr, FloatRect* = nu llptr); 46 HashSet<const SimpleFontData*>* fallbackFonts = nullptr, FloatRect* = nu llptr);
47 47
48 unsigned advance(unsigned to, GlyphBuffer* = 0); 48 unsigned advance(int to, GlyphBuffer* = 0);
pdr. 2015/10/06 23:07:07 Can you also add a comment that we need to fix thi
49 bool advanceOneCharacter(float& width); 49 bool advanceOneCharacter(float& width);
50 50
51 const TextRun& run() const { return m_textRun; } 51 const TextRun& run() const { return m_textRun; }
52 float runWidthSoFar() const { return m_runWidthSoFar; } 52 float runWidthSoFar() const { return m_runWidthSoFar; }
53 unsigned currentOffset() { return m_currentCharacter; } 53 unsigned currentOffset() { return m_currentCharacter; }
54 54
55 private: 55 private:
56 unsigned m_currentCharacter; 56 unsigned m_currentCharacter;
57 float m_runWidthSoFar; 57 float m_runWidthSoFar;
58 58
59 struct CharacterData { 59 struct CharacterData {
60 UChar32 character; 60 UChar32 character;
61 unsigned clusterLength; 61 unsigned clusterLength;
62 int characterOffset; 62 int characterOffset;
63 }; 63 };
64 64
65 GlyphData glyphDataForCharacter(CharacterData&, bool normalizeSpace = false) ; 65 GlyphData glyphDataForCharacter(CharacterData&, bool normalizeSpace = false) ;
66 float characterWidth(UChar32, const GlyphData&) const; 66 float characterWidth(UChar32, const GlyphData&) const;
67 float adjustSpacing(float, const CharacterData&); 67 float adjustSpacing(float, const CharacterData&);
68 68
69 template <typename TextIterator> 69 template <typename TextIterator>
70 unsigned advanceInternal(TextIterator&, GlyphBuffer*); 70 unsigned advanceInternal(TextIterator&, GlyphBuffer*);
71 }; 71 };
72 72
73 } // namespace blink 73 } // namespace blink
74 74
75 #endif 75 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698