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

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

Issue 678163002: Oilpan: move SVG property hierarchy to the heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased upto r185213 Created 6 years, 1 month 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 2 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 20 matching lines...) Expand all
31 namespace blink { 31 namespace blink {
32 32
33 SVGTextLayoutEngineBaseline::SVGTextLayoutEngineBaseline(const Font& font) 33 SVGTextLayoutEngineBaseline::SVGTextLayoutEngineBaseline(const Font& font)
34 : m_font(font) 34 : m_font(font)
35 { 35 {
36 } 36 }
37 37
38 float SVGTextLayoutEngineBaseline::calculateBaselineShift(const SVGRenderStyle& style, SVGElement* contextElement) const 38 float SVGTextLayoutEngineBaseline::calculateBaselineShift(const SVGRenderStyle& style, SVGElement* contextElement) const
39 { 39 {
40 if (style.baselineShift() == BS_LENGTH) { 40 if (style.baselineShift() == BS_LENGTH) {
41 RefPtr<SVGLength> baselineShiftValueLength = style.baselineShiftValue(); 41 RefPtrWillBeRawPtr<SVGLength> baselineShiftValueLength = style.baselineS hiftValue();
42 if (baselineShiftValueLength->unitType() == LengthTypePercentage) 42 if (baselineShiftValueLength->unitType() == LengthTypePercentage)
43 return baselineShiftValueLength->valueAsPercentage() * m_font.fontDe scription().computedPixelSize(); 43 return baselineShiftValueLength->valueAsPercentage() * m_font.fontDe scription().computedPixelSize();
44 44
45 SVGLengthContext lengthContext(contextElement); 45 SVGLengthContext lengthContext(contextElement);
46 return baselineShiftValueLength->value(lengthContext); 46 return baselineShiftValueLength->value(lengthContext);
47 } 47 }
48 48
49 switch (style.baselineShift()) { 49 switch (style.baselineShift()) {
50 case BS_BASELINE: 50 case BS_BASELINE:
51 return 0; 51 return 0;
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 xOrientationShift = metrics.width(); 222 xOrientationShift = metrics.width();
223 223
224 // Horizontal advance calculation. 224 // Horizontal advance calculation.
225 if (angle && !orientationIsMultiplyOf180Degrees) 225 if (angle && !orientationIsMultiplyOf180Degrees)
226 return metrics.height(); 226 return metrics.height();
227 227
228 return metrics.width(); 228 return metrics.width();
229 } 229 }
230 230
231 } 231 }
OLDNEW
« no previous file with comments | « Source/core/rendering/svg/SVGTextLayoutAttributesBuilder.cpp ('k') | Source/core/svg/LinearGradientAttributes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698