169 {
170 if (fText.
size() != other.fText.size()) {
171 return false;
172 }
173 if (fPlaceholders.size() != other.fPlaceholders.size()) {
174 return false;
175 }
176 if (fText != other.fText) {
177 return false;
178 }
179 if (fTextStyles.size() != other.fTextStyles.size()) {
180 return false;
181 }
182
183
184 if (!exactlyEqual(fParagraphStyle.
getHeight(), other.fParagraphStyle.getHeight())) {
185 return false;
186 }
187 if (fParagraphStyle.
getTextDirection() != other.fParagraphStyle.getTextDirection()) {
188 return false;
189 }
190
191 if (!(fParagraphStyle.
getStrutStyle() == other.fParagraphStyle.getStrutStyle())) {
192 return false;
193 }
194
196 return false;
197 }
198
199 for (
int i = 0;
i < fTextStyles.size(); ++
i) {
200 auto& tsa = fTextStyles[
i];
201 auto& tsb = other.fTextStyles[
i];
202 if (tsa.fStyle.isPlaceholder()) {
203 continue;
204 }
205 if (!(tsa.fStyle.equalsByFonts(tsb.fStyle))) {
206 return false;
207 }
208 if (tsa.fRange.width() != tsb.fRange.width()) {
209 return false;
210 }
211 if (tsa.fRange.start != tsb.fRange.start) {
212 return false;
213 }
214 }
215 for (
int i = 0;
i < fPlaceholders.size(); ++
i) {
216 auto& tsa = fPlaceholders[
i];
217 auto& tsb = other.fPlaceholders[
i];
218 if (tsa.fRange.width() == 0 && tsb.fRange.width() == 0) {
219 continue;
220 }
221 if (!(tsa.fStyle.equals(tsb.fStyle))) {
222 return false;
223 }
224 if (tsa.fRange.width() != tsb.fRange.width()) {
225 return false;
226 }
227 if (tsa.fRange.start != tsb.fRange.start) {
228 return false;
229 }
230 }
231
232 return true;
233}
SkScalar getHeight() const
bool getReplaceTabCharacters() const
const StrutStyle & getStrutStyle() const
TextDirection getTextDirection() const