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

Side by Side Diff: Source/core/rendering/svg/SVGTextRunRenderingContext.cpp

Issue 607483002: Separate advance from offset in GlypBuffer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressing Dominik's comments 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) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved. 3 * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 glyphOrigin.setY(svgFontData->horizontalOriginY() * scale); 106 glyphOrigin.setY(svgFontData->horizontalOriginY() * scale);
107 107
108 unsigned short resourceMode = context->textDrawingMode() == TextModeStroke ? ApplyToStrokeMode : ApplyToFillMode; 108 unsigned short resourceMode = context->textDrawingMode() == TextModeStroke ? ApplyToStrokeMode : ApplyToFillMode;
109 109
110 FloatPoint currentPoint = point; 110 FloatPoint currentPoint = point;
111 for (int i = 0; i < numGlyphs; ++i) { 111 for (int i = 0; i < numGlyphs; ++i) {
112 Glyph glyph = glyphBuffer.glyphAt(from + i); 112 Glyph glyph = glyphBuffer.glyphAt(from + i);
113 if (!glyph) 113 if (!glyph)
114 continue; 114 continue;
115 115
116 float advance = glyphBuffer.advanceAt(from + i).width(); 116 float advance = glyphBuffer.advanceAt(from + i);
117 SVGGlyph svgGlyph = fontElement->svgGlyphForGlyph(glyph); 117 SVGGlyph svgGlyph = fontElement->svgGlyphForGlyph(glyph);
118 ASSERT(!svgGlyph.isPartOfLigature); 118 ASSERT(!svgGlyph.isPartOfLigature);
119 ASSERT(svgGlyph.tableEntry == glyph); 119 ASSERT(svgGlyph.tableEntry == glyph);
120 120
121 SVGGlyphElement::inheritUnspecifiedAttributes(svgGlyph, svgFontData); 121 SVGGlyphElement::inheritUnspecifiedAttributes(svgGlyph, svgFontData);
122 122
123 // FIXME: Support arbitary SVG content as glyph (currently limited to <g lyph d="..."> situations). 123 // FIXME: Support arbitary SVG content as glyph (currently limited to <g lyph d="..."> situations).
124 if (svgGlyph.pathData.isEmpty()) { 124 if (svgGlyph.pathData.isEmpty()) {
125 if (isVerticalText) 125 if (isVerticalText)
126 currentPoint.move(0, advance); 126 currentPoint.move(0, advance);
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 // Restore original state of the SVG Font glyph table and the current font f allback list, 220 // Restore original state of the SVG Font glyph table and the current font f allback list,
221 // to assure the next lookup of the same glyph won't immediately return the fallback glyph. 221 // to assure the next lookup of the same glyph won't immediately return the fallback glyph.
222 page->setGlyphDataForCharacter(character, glyphData.glyph, originalFontData) ; 222 page->setGlyphDataForCharacter(character, glyphData.glyph, originalFontData) ;
223 ASSERT(fallbackGlyphData.fontData); 223 ASSERT(fallbackGlyphData.fontData);
224 return fallbackGlyphData; 224 return fallbackGlyphData;
225 } 225 }
226 226
227 } 227 }
228 228
229 #endif 229 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698