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

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

Issue 1108663003: Always initialize |m_totalWidth| in HarfBuzzShaper::shape. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add test expectations Created 5 years, 8 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
« no previous file with comments | « LayoutTests/fast/text/shaping/shaping-width-initialized-expected.txt ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 feature.tag = HB_TAG(tag[0], tag[1], tag[2], tag[3]); 531 feature.tag = HB_TAG(tag[0], tag[1], tag[2], tag[3]);
532 feature.value = settings->at(i).value(); 532 feature.value = settings->at(i).value();
533 feature.start = 0; 533 feature.start = 0;
534 feature.end = static_cast<unsigned>(-1); 534 feature.end = static_cast<unsigned>(-1);
535 m_features.append(feature); 535 m_features.append(feature);
536 } 536 }
537 } 537 }
538 538
539 bool HarfBuzzShaper::shape(GlyphBuffer* glyphBuffer) 539 bool HarfBuzzShaper::shape(GlyphBuffer* glyphBuffer)
540 { 540 {
541 m_totalWidth = 0;
Daniel Erat 2015/04/27 15:42:21 mind initializing it in the c'tor as well? having
541 if (!createHarfBuzzRuns()) 542 if (!createHarfBuzzRuns())
542 return false; 543 return false;
543 544
544 m_totalWidth = 0;
545 if (!shapeHarfBuzzRuns()) 545 if (!shapeHarfBuzzRuns())
546 return false; 546 return false;
547 547
548 if (glyphBuffer && !fillGlyphBuffer(glyphBuffer)) 548 if (glyphBuffer && !fillGlyphBuffer(glyphBuffer))
549 return false; 549 return false;
550 550
551 return true; 551 return true;
552 } 552 }
553 553
554 struct CandidateRun { 554 struct CandidateRun {
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
1206 // possibly invalid from, to arguments. 1206 // possibly invalid from, to arguments.
1207 if (!foundToX && !foundFromX) 1207 if (!foundToX && !foundFromX)
1208 fromX = toX = 0; 1208 fromX = toX = 0;
1209 1209
1210 if (fromX < toX) 1210 if (fromX < toX)
1211 return FloatRect(point.x() + fromX, point.y(), toX - fromX, height); 1211 return FloatRect(point.x() + fromX, point.y(), toX - fromX, height);
1212 return FloatRect(point.x() + toX, point.y(), fromX - toX, height); 1212 return FloatRect(point.x() + toX, point.y(), fromX - toX, height);
1213 } 1213 }
1214 1214
1215 } // namespace blink 1215 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/fast/text/shaping/shaping-width-initialized-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698