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

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

Issue 146503002: Revert 165189 "Rendering text-justify:distribute for 8 bit chara..." (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: 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 | Annotate | Revision Log
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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 , m_finalRoundingWidth(0) 68 , m_finalRoundingWidth(0)
69 , m_expansion(run.expansion()) 69 , m_expansion(run.expansion())
70 , m_leadingExpansion(0) 70 , m_leadingExpansion(0)
71 , m_afterExpansion(!run.allowsLeadingExpansion()) 71 , m_afterExpansion(!run.allowsLeadingExpansion())
72 , m_fallbackFonts(fallbackFonts) 72 , m_fallbackFonts(fallbackFonts)
73 , m_minGlyphBoundingBoxX(numeric_limits<float>::max()) 73 , m_minGlyphBoundingBoxX(numeric_limits<float>::max())
74 , m_maxGlyphBoundingBoxX(numeric_limits<float>::min()) 74 , m_maxGlyphBoundingBoxX(numeric_limits<float>::min())
75 , m_minGlyphBoundingBoxY(numeric_limits<float>::max()) 75 , m_minGlyphBoundingBoxY(numeric_limits<float>::max())
76 , m_maxGlyphBoundingBoxY(numeric_limits<float>::min()) 76 , m_maxGlyphBoundingBoxY(numeric_limits<float>::min())
77 , m_lastRoundingGlyph(0) 77 , m_lastRoundingGlyph(0)
78 , m_distributeJustification(false)
79 { 78 {
80 if (!m_expansion) 79 if (!m_expansion)
81 m_expansionPerOpportunity = 0; 80 m_expansionPerOpportunity = 0;
82 else { 81 else {
83 bool isAfterExpansion = m_afterExpansion; 82 bool isAfterExpansion = m_afterExpansion;
84 unsigned expansionOpportunityCount; 83 unsigned expansionOpportunityCount;
85 m_distributeJustification = m_run.isDistributeJustification();
86 if (m_run.is8Bit()) 84 if (m_run.is8Bit())
87 expansionOpportunityCount = Font::expansionOpportunityCount(m_run.ch aracters8(), m_end, m_run.ltr() ? LTR : RTL, isAfterExpansion, m_distributeJusti fication); 85 expansionOpportunityCount = Font::expansionOpportunityCount(m_run.ch aracters8(), m_end, m_run.ltr() ? LTR : RTL, isAfterExpansion);
88 else 86 else
89 expansionOpportunityCount = Font::expansionOpportunityCount(m_run.ch aracters16(), m_end, m_run.ltr() ? LTR : RTL, isAfterExpansion, m_distributeJust ification); 87 expansionOpportunityCount = Font::expansionOpportunityCount(m_run.c haracters16(), m_end, m_run.ltr() ? LTR : RTL, isAfterExpansion);
90 if (isAfterExpansion && !m_run.allowsTrailingExpansion()) 88 if (isAfterExpansion && !m_run.allowsTrailingExpansion())
91 expansionOpportunityCount--; 89 expansionOpportunityCount--;
92 90
93 if (!expansionOpportunityCount) 91 if (!expansionOpportunityCount)
94 m_expansionPerOpportunity = 0; 92 m_expansionPerOpportunity = 0;
95 else 93 else
96 m_expansionPerOpportunity = m_expansion / expansionOpportunityCount; 94 m_expansionPerOpportunity = m_expansion / expansionOpportunityCount;
97 } 95 }
98 96
99 collectComplexTextRuns(); 97 collectComplexTextRuns();
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 659
662 lastCharacterIndex = characterIndex; 660 lastCharacterIndex = characterIndex;
663 } 661 }
664 if (!isMonotonic) 662 if (!isMonotonic)
665 complexTextRun.setIsNonMonotonic(); 663 complexTextRun.setIsNonMonotonic();
666 } 664 }
667 m_totalWidth += widthSinceLastCommit; 665 m_totalWidth += widthSinceLastCommit;
668 } 666 }
669 667
670 } // namespace WebCore 668 } // namespace WebCore
OLDNEW
« no previous file with comments | « trunk/Source/platform/fonts/mac/ComplexTextController.h ('k') | trunk/Source/platform/text/TextRun.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698