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

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

Issue 180893004: Adjust both x and y position when drawing glyphs (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: w/mac fix Created 6 years, 9 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/WidthIterator.cpp ('k') | no next file » | 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) 2007, 2008, 2010 Google Inc. All rights reserved. 2 * Copyright (c) 2007, 2008, 2010 Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 verticalData->getVerticalTranslationsForGlyphs(font, &glyphs[0], chu nkLength, reinterpret_cast<float*>(&translations[0])); 129 verticalData->getVerticalTranslationsForGlyphs(font, &glyphs[0], chu nkLength, reinterpret_cast<float*>(&translations[0]));
130 130
131 x = verticalOriginX; 131 x = verticalOriginX;
132 y = SkFloatToScalar(point.y() + horizontalOffset - point.x()); 132 y = SkFloatToScalar(point.y() + horizontalOffset - point.x());
133 133
134 float currentWidth = 0; 134 float currentWidth = 0;
135 for (unsigned i = 0; i < chunkLength; ++i, ++glyphIndex) { 135 for (unsigned i = 0; i < chunkLength; ++i, ++glyphIndex) {
136 pos[i].set( 136 pos[i].set(
137 x + SkIntToScalar(lroundf(translations[i].x())), 137 x + SkIntToScalar(lroundf(translations[i].x())),
138 y + -SkIntToScalar(-lroundf(currentWidth - translations[i].y ()))); 138 y + -SkIntToScalar(-lroundf(currentWidth - translations[i].y ())));
139 currentWidth += glyphBuffer.advanceAt(from + glyphIndex); 139 currentWidth += glyphBuffer.advanceAt(from + glyphIndex).width() ;
140 } 140 }
141 horizontalOffset += currentWidth; 141 horizontalOffset += currentWidth;
142 paintGlyphs(gc, font, glyphs, chunkLength, pos, textRect); 142 paintGlyphs(gc, font, glyphs, chunkLength, pos, textRect);
143 } 143 }
144 144
145 gc->setCTM(savedMatrix); 145 gc->setCTM(savedMatrix);
146 return; 146 return;
147 } 147 }
148 148
149 // FIXME: text rendering speed: 149 // FIXME: text rendering speed:
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 const FloatPoint& point, int height, 229 const FloatPoint& point, int height,
230 int from, int to) const 230 int from, int to) const
231 { 231 {
232 HarfBuzzShaper shaper(this, run); 232 HarfBuzzShaper shaper(this, run);
233 if (!shaper.shape()) 233 if (!shaper.shape())
234 return FloatRect(); 234 return FloatRect();
235 return shaper.selectionRect(point, height, from, to); 235 return shaper.selectionRect(point, height, from, to);
236 } 236 }
237 237
238 } // namespace WebCore 238 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/platform/fonts/WidthIterator.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698