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

Side by Side Diff: Source/platform/fonts/mac/ComplexTextController.cpp

Issue 255323004: Rendering text-justify:distribute for 8 bit characters. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: New patchset (with 'const') Created 6 years, 6 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) 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 , m_finalRoundingWidth(0) 69 , m_finalRoundingWidth(0)
70 , m_expansion(run.expansion()) 70 , m_expansion(run.expansion())
71 , m_leadingExpansion(0) 71 , m_leadingExpansion(0)
72 , m_afterExpansion(!run.allowsLeadingExpansion()) 72 , m_afterExpansion(!run.allowsLeadingExpansion())
73 , m_fallbackFonts(fallbackFonts) 73 , m_fallbackFonts(fallbackFonts)
74 , m_minGlyphBoundingBoxX(numeric_limits<float>::max()) 74 , m_minGlyphBoundingBoxX(numeric_limits<float>::max())
75 , m_maxGlyphBoundingBoxX(numeric_limits<float>::min()) 75 , m_maxGlyphBoundingBoxX(numeric_limits<float>::min())
76 , m_minGlyphBoundingBoxY(numeric_limits<float>::max()) 76 , m_minGlyphBoundingBoxY(numeric_limits<float>::max())
77 , m_maxGlyphBoundingBoxY(numeric_limits<float>::min()) 77 , m_maxGlyphBoundingBoxY(numeric_limits<float>::min())
78 , m_lastRoundingGlyph(0) 78 , m_lastRoundingGlyph(0)
79 , m_distributeJustification(false)
leviw_travelin_and_unemployed 2014/07/28 23:59:58 Why are you making this a member variable if you o
79 { 80 {
80 if (!m_expansion) 81 if (!m_expansion)
81 m_expansionPerOpportunity = 0; 82 m_expansionPerOpportunity = 0;
82 else { 83 else {
83 bool isAfterExpansion = m_afterExpansion; 84 bool isAfterExpansion = m_afterExpansion;
84 unsigned expansionOpportunityCount; 85 unsigned expansionOpportunityCount;
86 m_distributeJustification = m_run.isDistributeJustification();
85 if (m_run.is8Bit()) 87 if (m_run.is8Bit())
86 expansionOpportunityCount = Character::expansionOpportunityCount(m_r un.characters8(), m_end, m_run.ltr() ? LTR : RTL, isAfterExpansion); 88 expansionOpportunityCount = Character::expansionOpportunityCount(m_r un.characters8(), m_end, m_run.ltr() ? LTR : RTL, isAfterExpansion, m_distribute Justification);
87 else 89 else
88 expansionOpportunityCount = Character::expansionOpportunityCount(m_r un.characters16(), m_end, m_run.ltr() ? LTR : RTL, isAfterExpansion); 90 expansionOpportunityCount = Character::expansionOpportunityCount(m_r un.characters16(), m_end, m_run.ltr() ? LTR : RTL, isAfterExpansion, m_distribut eJustification);
89 if (isAfterExpansion && !m_run.allowsTrailingExpansion()) 91 if (isAfterExpansion && !m_run.allowsTrailingExpansion())
90 expansionOpportunityCount--; 92 expansionOpportunityCount--;
91 93
92 if (!expansionOpportunityCount) 94 if (!expansionOpportunityCount)
93 m_expansionPerOpportunity = 0; 95 m_expansionPerOpportunity = 0;
94 else 96 else
95 m_expansionPerOpportunity = m_expansion / expansionOpportunityCount; 97 m_expansionPerOpportunity = m_expansion / expansionOpportunityCount;
96 } 98 }
97 99
98 collectComplexTextRuns(); 100 collectComplexTextRuns();
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 662
661 lastCharacterIndex = characterIndex; 663 lastCharacterIndex = characterIndex;
662 } 664 }
663 if (!isMonotonic) 665 if (!isMonotonic)
664 complexTextRun.setIsNonMonotonic(); 666 complexTextRun.setIsNonMonotonic();
665 } 667 }
666 m_totalWidth += widthSinceLastCommit; 668 m_totalWidth += widthSinceLastCommit;
667 } 669 }
668 670
669 } // namespace WebCore 671 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698