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

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

Issue 325283002: Consolidate Glyph and GlyphBufferGlyph. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase 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 | Annotate | Revision Log
« no previous file with comments | « Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp ('k') | Source/platform/fonts/mac/FontMac.cpp » ('j') | 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 983 matching lines...) Expand 10 before | Expand all | Expand 10 after
994 else 994 else
995 clusterEnd = isRunEnd ? currentRun->startIndex() + currentRun->n umCharacters() : currentRun->startIndex() + glyphToCharacterIndexes[i + 1]; 995 clusterEnd = isRunEnd ? currentRun->startIndex() + currentRun->n umCharacters() : currentRun->startIndex() + glyphToCharacterIndexes[i + 1];
996 996
997 graphemesInCluster = countGraphemesInCluster(m_normalizedBuffer.get( ), m_normalizedBufferLength, clusterStart, clusterEnd); 997 graphemesInCluster = countGraphemesInCluster(m_normalizedBuffer.get( ), m_normalizedBufferLength, clusterStart, clusterEnd);
998 if (!graphemesInCluster || !clusterAdvance) 998 if (!graphemesInCluster || !clusterAdvance)
999 continue; 999 continue;
1000 1000
1001 float glyphAdvanceX = clusterAdvance / graphemesInCluster; 1001 float glyphAdvanceX = clusterAdvance / graphemesInCluster;
1002 for (unsigned j = 0; j < graphemesInCluster; ++j) { 1002 for (unsigned j = 0; j < graphemesInCluster; ++j) {
1003 // Do not put emphasis marks on space, separator, and control ch aracters. 1003 // Do not put emphasis marks on space, separator, and control ch aracters.
1004 GlyphBufferGlyph glyphToAdd = Character::canReceiveTextEmphasis( m_run[currentCharacterIndex]) ? 1 : 0; 1004 Glyph glyphToAdd = Character::canReceiveTextEmphasis(m_run[curre ntCharacterIndex]) ? 1 : 0;
1005 glyphBuffer->add(glyphToAdd, currentRun->fontData(), createGlyph BufferAdvance(glyphAdvanceX, 0)); 1005 glyphBuffer->add(glyphToAdd, currentRun->fontData(), createGlyph BufferAdvance(glyphAdvanceX, 0));
1006 } 1006 }
1007 clusterStart = clusterEnd; 1007 clusterStart = clusterEnd;
1008 clusterAdvance = 0; 1008 clusterAdvance = 0;
1009 } 1009 }
1010 } 1010 }
1011 } 1011 }
1012 1012
1013 bool HarfBuzzShaper::fillGlyphBuffer(GlyphBuffer* glyphBuffer) 1013 bool HarfBuzzShaper::fillGlyphBuffer(GlyphBuffer* glyphBuffer)
1014 { 1014 {
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
1122 point.x() + fromX, point.x() + toX, 1122 point.x() + fromX, point.x() + toX,
1123 point.y(), height); 1123 point.y(), height);
1124 } 1124 }
1125 1125
1126 return Font::pixelSnappedSelectionRect( 1126 return Font::pixelSnappedSelectionRect(
1127 point.x() + toX, point.x() + fromX, 1127 point.x() + toX, point.x() + fromX,
1128 point.y(), height); 1128 point.y(), height);
1129 } 1129 }
1130 1130
1131 } // namespace WebCore 1131 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/platform/fonts/harfbuzz/FontHarfBuzz.cpp ('k') | Source/platform/fonts/mac/FontMac.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698