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

Unified Diff: Source/WebCore/svg/SVGFEImageElement.cpp

Issue 9117045: Merge 105612 - <feImage> has problems referencing local elements (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/963/
Patch Set: Created 8 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: Source/WebCore/svg/SVGFEImageElement.cpp
===================================================================
--- Source/WebCore/svg/SVGFEImageElement.cpp (revision 105779)
+++ Source/WebCore/svg/SVGFEImageElement.cpp (working copy)
@@ -33,7 +33,6 @@
#include "RenderObject.h"
#include "RenderSVGResource.h"
#include "SVGElementInstance.h"
-#include "SVGImageBufferTools.h"
#include "SVGNames.h"
#include "SVGPreserveAspectRatio.h"
@@ -183,27 +182,9 @@
if (!m_cachedImage && !m_targetImage)
requestImageResource();
- if (!m_cachedImage && !m_targetImage) {
- Element* hrefElement = SVGURIReference::targetElementFromIRIString(href(), document());
- if (!hrefElement || !hrefElement->isSVGElement())
- return 0;
-
- RenderObject* renderer = hrefElement->renderer();
- if (!renderer)
- return 0;
-
- IntRect targetRect = enclosingIntRect(renderer->objectBoundingBox());
-
- if (targetRect.isEmpty())
- return 0;
-
- m_targetImage = ImageBuffer::create(targetRect.size(), ColorSpaceLinearRGB);
-
- AffineTransform contentTransformation;
- SVGImageBufferTools::renderSubtreeToImageBuffer(m_targetImage.get(), renderer, contentTransformation);
- }
-
- return FEImage::create(filter, m_targetImage ? m_targetImage->copyImage(CopyBackingStore) : m_cachedImage->imageForRenderer(renderer()), preserveAspectRatio());
+ if (!m_cachedImage && !m_targetImage)
+ return FEImage::createWithIRIReference(filter, document(), href(), preserveAspectRatio());
+ return FEImage::createWithImage(filter, m_cachedImage->imageForRenderer(renderer()), preserveAspectRatio());
}
void SVGFEImageElement::addSubresourceAttributeURLs(ListHashSet<KURL>& urls) const
« no previous file with comments | « Source/WebCore/rendering/svg/RenderSVGResourceFilterPrimitive.cpp ('k') | Source/WebCore/svg/graphics/filters/SVGFEImage.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698