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

Side by Side Diff: Source/platform/fonts/shaping/HarfBuzzShaper.cpp

Issue 652483002: TextRun::length() should return an unsigned (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 years, 2 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 427 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 numWordEnds++; 438 numWordEnds++;
439 } 439 }
440 440
441 if (numWordEnds) 441 if (numWordEnds)
442 m_padPerWordBreak = m_padding / numWordEnds; 442 m_padPerWordBreak = m_padding / numWordEnds;
443 else 443 else
444 m_padPerWordBreak = 0; 444 m_padPerWordBreak = 0;
445 } 445 }
446 446
447 447
448 void HarfBuzzShaper::setDrawRange(int from, int to) 448 void HarfBuzzShaper::setDrawRange(unsigned from, unsigned to)
449 { 449 {
450 ASSERT_WITH_SECURITY_IMPLICATION(from >= 0);
451 ASSERT_WITH_SECURITY_IMPLICATION(to <= m_run.length()); 450 ASSERT_WITH_SECURITY_IMPLICATION(to <= m_run.length());
452 m_fromIndex = from; 451 m_fromIndex = from;
453 m_toIndex = to; 452 m_toIndex = to;
454 } 453 }
455 454
456 void HarfBuzzShaper::setFontFeatures() 455 void HarfBuzzShaper::setFontFeatures()
457 { 456 {
458 const FontDescription& description = m_font->fontDescription(); 457 const FontDescription& description = m_font->fontDescription();
459 if (description.orientation() == Vertical) { 458 if (description.orientation() == Vertical) {
460 static hb_feature_t vert = { HarfBuzzFace::vertTag, 1, 0, static_cast<un signed>(-1) }; 459 static hb_feature_t vert = { HarfBuzzFace::vertTag, 1, 0, static_cast<un signed>(-1) };
(...skipping 695 matching lines...) Expand 10 before | Expand all | Expand 10 after
1156 point.x() + fromX, point.x() + toX, 1155 point.x() + fromX, point.x() + toX,
1157 point.y(), height); 1156 point.y(), height);
1158 } 1157 }
1159 1158
1160 return Font::pixelSnappedSelectionRect( 1159 return Font::pixelSnappedSelectionRect(
1161 point.x() + toX, point.x() + fromX, 1160 point.x() + toX, point.x() + fromX,
1162 point.y(), height); 1161 point.y(), height);
1163 } 1162 }
1164 1163
1165 } // namespace blink 1164 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698