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

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

Issue 613193002: Avoid drawing emphasis marks over ellipsis glyphs (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added antialiased test in TestExpectations 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 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after
1016 clusterEnd = isRunEnd ? currentRun->startIndex() + currentRun->n umCharacters() : currentRun->startIndex() + glyphToCharacterIndexes[i + 1]; 1016 clusterEnd = isRunEnd ? currentRun->startIndex() + currentRun->n umCharacters() : currentRun->startIndex() + glyphToCharacterIndexes[i + 1];
1017 1017
1018 graphemesInCluster = countGraphemesInCluster(m_normalizedBuffer.get( ), m_normalizedBufferLength, clusterStart, clusterEnd); 1018 graphemesInCluster = countGraphemesInCluster(m_normalizedBuffer.get( ), m_normalizedBufferLength, clusterStart, clusterEnd);
1019 if (!graphemesInCluster || !clusterAdvance) 1019 if (!graphemesInCluster || !clusterAdvance)
1020 continue; 1020 continue;
1021 1021
1022 float glyphAdvanceX = clusterAdvance / graphemesInCluster; 1022 float glyphAdvanceX = clusterAdvance / graphemesInCluster;
1023 for (unsigned j = 0; j < graphemesInCluster; ++j) { 1023 for (unsigned j = 0; j < graphemesInCluster; ++j) {
1024 // Do not put emphasis marks on space, separator, and control ch aracters. 1024 // Do not put emphasis marks on space, separator, and control ch aracters.
1025 Glyph glyphToAdd = Character::canReceiveTextEmphasis(m_run[curre ntCharacterIndex]) ? 1 : 0; 1025 Glyph glyphToAdd = Character::canReceiveTextEmphasis(m_run[curre ntCharacterIndex]) ? 1 : 0;
1026 if (m_run.rtl() && currentCharacterIndex >= m_toIndex)
1027 glyphToAdd = 0;
Dominik Röttsches 2014/09/30 12:27:00 Can m_toIndex be factored into the clusterEnd comp
Habib Virji 2014/09/30 13:28:40 Reason to add special handling was returning befor
Dominik Röttsches 2014/09/30 13:48:24 Yes, I understood your analysis. Please take a loo
Dominik Röttsches 2014/10/01 07:35:35 I looked at this a bit more closely again - this f
1026 glyphBuffer->add(glyphToAdd, currentRun->fontData(), glyphAdvanc eX); 1028 glyphBuffer->add(glyphToAdd, currentRun->fontData(), glyphAdvanc eX);
1027 } 1029 }
1028 clusterStart = clusterEnd; 1030 clusterStart = clusterEnd;
1029 clusterAdvance = 0; 1031 clusterAdvance = 0;
1030 } 1032 }
1031 } 1033 }
1032 } 1034 }
1033 1035
1034 bool HarfBuzzShaper::fillGlyphBuffer(GlyphBuffer* glyphBuffer) 1036 bool HarfBuzzShaper::fillGlyphBuffer(GlyphBuffer* glyphBuffer)
1035 { 1037 {
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
1143 point.x() + fromX, point.x() + toX, 1145 point.x() + fromX, point.x() + toX,
1144 point.y(), height); 1146 point.y(), height);
1145 } 1147 }
1146 1148
1147 return Font::pixelSnappedSelectionRect( 1149 return Font::pixelSnappedSelectionRect(
1148 point.x() + toX, point.x() + fromX, 1150 point.x() + toX, point.x() + fromX,
1149 point.y(), height); 1151 point.y(), height);
1150 } 1152 }
1151 1153
1152 } // namespace blink 1154 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698