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

Side by Side Diff: third_party/WebKit/Source/platform/fonts/shaping/ShapeResultInlineHeaders.h

Issue 1966703002: Support includePartialGlyphs=false in Font::offsetForPositionForComplexText (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment as per eae review Created 4 years, 7 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) 2012 Google Inc. All rights reserved. 2 * Copyright (c) 2012 Google Inc. All rights reserved.
3 * Copyright (C) 2013 BlackBerry Limited. All rights reserved. 3 * Copyright (C) 2013 BlackBerry Limited. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 , m_glyphData(other.m_glyphData) 73 , m_glyphData(other.m_glyphData)
74 , m_startIndex(other.m_startIndex) 74 , m_startIndex(other.m_startIndex)
75 , m_numCharacters(other.m_numCharacters) 75 , m_numCharacters(other.m_numCharacters)
76 , m_width(other.m_width) 76 , m_width(other.m_width)
77 { 77 {
78 } 78 }
79 79
80 bool rtl() const { return HB_DIRECTION_IS_BACKWARD(m_direction); } 80 bool rtl() const { return HB_DIRECTION_IS_BACKWARD(m_direction); }
81 float xPositionForVisualOffset(unsigned, AdjustMidCluster) const; 81 float xPositionForVisualOffset(unsigned, AdjustMidCluster) const;
82 float xPositionForOffset(unsigned, AdjustMidCluster) const; 82 float xPositionForOffset(unsigned, AdjustMidCluster) const;
83 int characterIndexForXPosition(float) const; 83 int characterIndexForXPosition(float, bool includePartialGlyphs) const;
84 void setGlyphAndPositions(unsigned index, uint16_t glyphId, float advance, 84 void setGlyphAndPositions(unsigned index, uint16_t glyphId, float advance,
85 float offsetX, float offsetY); 85 float offsetX, float offsetY);
86 86
87 size_t glyphToCharacterIndex(size_t i) const 87 size_t glyphToCharacterIndex(size_t i) const
88 { 88 {
89 return m_startIndex + m_glyphData[i].characterIndex; 89 return m_startIndex + m_glyphData[i].characterIndex;
90 } 90 }
91 91
92 // For memory reporting. 92 // For memory reporting.
93 size_t byteSize() const 93 size_t byteSize() const
94 { 94 {
95 return sizeof(this) + m_glyphData.size() * sizeof(HarfBuzzRunGlyphData); 95 return sizeof(this) + m_glyphData.size() * sizeof(HarfBuzzRunGlyphData);
96 } 96 }
97 97
98 RefPtr<SimpleFontData> m_fontData; 98 RefPtr<SimpleFontData> m_fontData;
99 hb_direction_t m_direction; 99 hb_direction_t m_direction;
100 hb_script_t m_script; 100 hb_script_t m_script;
101 Vector<HarfBuzzRunGlyphData> m_glyphData; 101 Vector<HarfBuzzRunGlyphData> m_glyphData;
102 unsigned m_startIndex; 102 unsigned m_startIndex;
103 unsigned m_numCharacters; 103 unsigned m_numCharacters;
104 float m_width; 104 float m_width;
105 }; 105 };
106 106
107 } // namespace blink 107 } // namespace blink
108 108
109 #endif // ShapeResultInlineHeaders_h 109 #endif // ShapeResultInlineHeaders_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698