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

Side by Side Diff: Source/core/svg/graphics/filters/SVGFEImage.cpp

Issue 67483003: [SVG] Fix root element length values handling. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2006, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005 Rob Buis <buis@kde.org>
4 * Copyright (C) 2005 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2005 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2010 Dirk Schulze <krit@webkit.org> 5 * Copyright (C) 2010 Dirk Schulze <krit@webkit.org>
6 * Copyright (C) 2013 Google Inc. All rights reserved. 6 * Copyright (C) 2013 Google Inc. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 IntPoint paintLocation = absolutePaintRect().location(); 114 IntPoint paintLocation = absolutePaintRect().location();
115 destRect.move(-paintLocation.x(), -paintLocation.y()); 115 destRect.move(-paintLocation.x(), -paintLocation.y());
116 116
117 // FEImage results are always in ColorSpaceDeviceRGB 117 // FEImage results are always in ColorSpaceDeviceRGB
118 setResultColorSpace(ColorSpaceDeviceRGB); 118 setResultColorSpace(ColorSpaceDeviceRGB);
119 119
120 if (renderer) { 120 if (renderer) {
121 SVGElement* contextNode = toSVGElement(renderer->node()); 121 SVGElement* contextNode = toSVGElement(renderer->node());
122 if (contextNode->hasRelativeLengths()) { 122 if (contextNode->hasRelativeLengths()) {
123 SVGLengthContext lengthContext(contextNode); 123 SVGLengthContext lengthContext(contextNode);
124 float width = 0; 124 FloatSize viewportSize;
125 float height = 0;
126 125
127 // If we're referencing an element with percentage units, eg. <rect with="30%"> those values were resolved against the viewport. 126 // If we're referencing an element with percentage units, eg. <rect with="30%"> those values were resolved against the viewport.
128 // Build up a transformation that maps from the viewport space to th e filter primitive subregion. 127 // Build up a transformation that maps from the viewport space to th e filter primitive subregion.
129 if (lengthContext.determineViewport(width, height)) 128 if (lengthContext.determineViewport(viewportSize))
130 resultImage->context()->concatCTM(makeMapBetweenRects(FloatRect( 0, 0, width, height), destRect)); 129 resultImage->context()->concatCTM(makeMapBetweenRects(FloatRect( FloatPoint(), viewportSize), destRect));
131 } else { 130 } else {
132 const AffineTransform& absoluteTransform = filter()->absoluteTransfo rm(); 131 const AffineTransform& absoluteTransform = filter()->absoluteTransfo rm();
133 resultImage->context()->concatCTM(absoluteTransform); 132 resultImage->context()->concatCTM(absoluteTransform);
134 } 133 }
135 134
136 AffineTransform contentTransformation; 135 AffineTransform contentTransformation;
137 SVGRenderingContext::renderSubtree(resultImage->context(), renderer, con tentTransformation); 136 SVGRenderingContext::renderSubtree(resultImage->context(), renderer, con tentTransformation);
138 return; 137 return;
139 } 138 }
140 139
(...skipping 20 matching lines...) Expand all
161 if (!m_image) 160 if (!m_image)
162 return 0; 161 return 0;
163 162
164 if (!m_image->nativeImageForCurrentFrame()) 163 if (!m_image->nativeImageForCurrentFrame())
165 return 0; 164 return 0;
166 165
167 return adoptRef(new SkBitmapSource(m_image->nativeImageForCurrentFrame()->bi tmap())); 166 return adoptRef(new SkBitmapSource(m_image->nativeImageForCurrentFrame()->bi tmap()));
168 } 167 }
169 168
170 } // namespace WebCore 169 } // namespace WebCore
OLDNEW
« Source/core/svg/SVGLengthContext.cpp ('K') | « Source/core/svg/SVGLengthContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698