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

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

Issue 54743004: Rendering text-justify:distribute for 8 bit characters. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add the test case in the TestExpectaions as NeedsRebaseline Created 6 years, 11 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 , m_finalRoundingWidth(0) 127 , m_finalRoundingWidth(0)
128 , m_expansion(run.expansion()) 128 , m_expansion(run.expansion())
129 , m_leadingExpansion(0) 129 , m_leadingExpansion(0)
130 , m_afterExpansion(!run.allowsLeadingExpansion()) 130 , m_afterExpansion(!run.allowsLeadingExpansion())
131 , m_fallbackFonts(fallbackFonts) 131 , m_fallbackFonts(fallbackFonts)
132 , m_minGlyphBoundingBoxX(numeric_limits<float>::max()) 132 , m_minGlyphBoundingBoxX(numeric_limits<float>::max())
133 , m_maxGlyphBoundingBoxX(numeric_limits<float>::min()) 133 , m_maxGlyphBoundingBoxX(numeric_limits<float>::min())
134 , m_minGlyphBoundingBoxY(numeric_limits<float>::max()) 134 , m_minGlyphBoundingBoxY(numeric_limits<float>::max())
135 , m_maxGlyphBoundingBoxY(numeric_limits<float>::min()) 135 , m_maxGlyphBoundingBoxY(numeric_limits<float>::min())
136 , m_lastRoundingGlyph(0) 136 , m_lastRoundingGlyph(0)
137 , m_distributeJustification(false)
137 { 138 {
138 if (!m_expansion) 139 if (!m_expansion)
139 m_expansionPerOpportunity = 0; 140 m_expansionPerOpportunity = 0;
140 else { 141 else {
141 bool isAfterExpansion = m_afterExpansion; 142 bool isAfterExpansion = m_afterExpansion;
142 unsigned expansionOpportunityCount; 143 unsigned expansionOpportunityCount;
144 m_distributeJustification = m_run.isDistributeJustification();
143 if (m_run.is8Bit()) 145 if (m_run.is8Bit())
144 expansionOpportunityCount = Font::expansionOpportunityCount(m_run.ch aracters8(), m_end, m_run.ltr() ? LTR : RTL, isAfterExpansion); 146 expansionOpportunityCount = Font::expansionOpportunityCount(m_run.ch aracters8(), m_end, m_run.ltr() ? LTR : RTL, isAfterExpansion, m_distributeJusti fication);
145 else 147 else
146 expansionOpportunityCount = Font::expansionOpportunityCount(m_run.c haracters16(), m_end, m_run.ltr() ? LTR : RTL, isAfterExpansion); 148 expansionOpportunityCount = Font::expansionOpportunityCount(m_run.ch aracters16(), m_end, m_run.ltr() ? LTR : RTL, isAfterExpansion, m_distributeJust ification);
147 if (isAfterExpansion && !m_run.allowsTrailingExpansion()) 149 if (isAfterExpansion && !m_run.allowsTrailingExpansion())
148 expansionOpportunityCount--; 150 expansionOpportunityCount--;
149 151
150 if (!expansionOpportunityCount) 152 if (!expansionOpportunityCount)
151 m_expansionPerOpportunity = 0; 153 m_expansionPerOpportunity = 0;
152 else 154 else
153 m_expansionPerOpportunity = m_expansion / expansionOpportunityCount; 155 m_expansionPerOpportunity = m_expansion / expansionOpportunityCount;
154 } 156 }
155 157
156 collectComplexTextRuns(); 158 collectComplexTextRuns();
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 720
719 lastCharacterIndex = characterIndex; 721 lastCharacterIndex = characterIndex;
720 } 722 }
721 if (!isMonotonic) 723 if (!isMonotonic)
722 complexTextRun.setIsNonMonotonic(); 724 complexTextRun.setIsNonMonotonic();
723 } 725 }
724 m_totalWidth += widthSinceLastCommit; 726 m_totalWidth += widthSinceLastCommit;
725 } 727 }
726 728
727 } // namespace WebCore 729 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698