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

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

Issue 230443003: Fix application of OBB paint-servers when device scale != 1 (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase. Created 6 years, 8 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/core/rendering/svg/RenderSVGResourcePattern.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 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 isVerticalText = parentRenderObjectStyle->svgStyle()->isVerticalWritingM ode(); 116 isVerticalText = parentRenderObjectStyle->svgStyle()->isVerticalWritingM ode();
117 } 117 }
118 118
119 float scale = scaleEmToUnits(fontData->platformData().size(), fontFaceElemen t->unitsPerEm()); 119 float scale = scaleEmToUnits(fontData->platformData().size(), fontFaceElemen t->unitsPerEm());
120 ASSERT(activePaintingResource); 120 ASSERT(activePaintingResource);
121 121
122 FloatPoint glyphOrigin; 122 FloatPoint glyphOrigin;
123 glyphOrigin.setX(svgFontData->horizontalOriginX() * scale); 123 glyphOrigin.setX(svgFontData->horizontalOriginX() * scale);
124 glyphOrigin.setY(svgFontData->horizontalOriginY() * scale); 124 glyphOrigin.setY(svgFontData->horizontalOriginY() * scale);
125 125
126 unsigned short resourceMode = context->textDrawingMode() == TextModeStroke ? ApplyToStrokeMode : ApplyToFillMode;
127 // From a resource perspective this ought to be treated as "text mode".
128 resourceMode |= ApplyToTextMode;
129
126 FloatPoint currentPoint = point; 130 FloatPoint currentPoint = point;
127 RenderSVGResourceMode resourceMode = context->textDrawingMode() == TextModeS troke ? ApplyToStrokeMode : ApplyToFillMode;
128 for (int i = 0; i < numGlyphs; ++i) { 131 for (int i = 0; i < numGlyphs; ++i) {
129 Glyph glyph = glyphBuffer.glyphAt(from + i); 132 Glyph glyph = glyphBuffer.glyphAt(from + i);
130 if (!glyph) 133 if (!glyph)
131 continue; 134 continue;
132 135
133 float advance = glyphBuffer.advanceAt(from + i).width(); 136 float advance = glyphBuffer.advanceAt(from + i).width();
134 SVGGlyph svgGlyph = fontElement->svgGlyphForGlyph(glyph); 137 SVGGlyph svgGlyph = fontElement->svgGlyphForGlyph(glyph);
135 ASSERT(!svgGlyph.isPartOfLigature); 138 ASSERT(!svgGlyph.isPartOfLigature);
136 ASSERT(svgGlyph.tableEntry == glyph); 139 ASSERT(svgGlyph.tableEntry == glyph);
137 140
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 // Restore original state of the SVG Font glyph table and the current font f allback list, 246 // Restore original state of the SVG Font glyph table and the current font f allback list,
244 // to assure the next lookup of the same glyph won't immediately return the fallback glyph. 247 // to assure the next lookup of the same glyph won't immediately return the fallback glyph.
245 page->setGlyphDataForCharacter(character, glyphData.glyph, originalFontData) ; 248 page->setGlyphDataForCharacter(character, glyphData.glyph, originalFontData) ;
246 ASSERT(fallbackGlyphData.fontData); 249 ASSERT(fallbackGlyphData.fontData);
247 return fallbackGlyphData; 250 return fallbackGlyphData;
248 } 251 }
249 252
250 } 253 }
251 254
252 #endif 255 #endif
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/RenderSVGResourcePattern.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698