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

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

Issue 1376473002: Move feConvolveMatrix error handling to FEConvolveMatrix (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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) 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 183
184 RefPtr<SkImageFilter> result = adoptRef(SkPictureImageFilter::Create(recordi ng.get(), dstRect)); 184 RefPtr<SkImageFilter> result = adoptRef(SkPictureImageFilter::Create(recordi ng.get(), dstRect));
185 return result.release(); 185 return result.release();
186 } 186 }
187 187
188 PassRefPtr<SkImageFilter> FEImage::createImageFilter(SkiaImageFilterBuilder* bui lder) 188 PassRefPtr<SkImageFilter> FEImage::createImageFilter(SkiaImageFilterBuilder* bui lder)
189 { 189 {
190 if (auto* layoutObject = referencedLayoutObject()) 190 if (auto* layoutObject = referencedLayoutObject())
191 return createImageFilterForLayoutObject(*layoutObject, builder); 191 return createImageFilterForLayoutObject(*layoutObject, builder);
192 192
193 FloatRect dstRect = filterPrimitiveSubregion();
194
195 RefPtr<SkImage> image = m_image ? m_image->imageForCurrentFrame() : nullptr; 193 RefPtr<SkImage> image = m_image ? m_image->imageForCurrentFrame() : nullptr;
196 if (!image) { 194 if (!image) {
197 // "A href reference that is an empty image (zero width or zero height), that fails 195 // "A href reference that is an empty image (zero width or zero height), that fails
198 // to download, is non-existent, or that cannot be displayed (e.g. becau se it is 196 // to download, is non-existent, or that cannot be displayed (e.g. becau se it is
199 // not in a supported image format) fills the filter primitive subregion with 197 // not in a supported image format) fills the filter primitive subregion with
200 // transparent black." 198 // transparent black."
201 return adoptRef(SkPictureImageFilter::Create(nullptr, dstRect)); 199 return createTransparentBlack();
202 } 200 }
203 201
204 FloatRect srcRect = FloatRect(FloatPoint(), m_image->size()); 202 FloatRect srcRect = FloatRect(FloatPoint(), m_image->size());
203 FloatRect dstRect = filterPrimitiveSubregion();
205 204
206 m_preserveAspectRatio->transformRect(dstRect, srcRect); 205 m_preserveAspectRatio->transformRect(dstRect, srcRect);
207 206
208 return adoptRef(SkImageSource::Create(image.get(), srcRect, dstRect, kHigh_S kFilterQuality)); 207 return adoptRef(SkImageSource::Create(image.get(), srcRect, dstRect, kHigh_S kFilterQuality));
209 } 208 }
210 209
211 } // namespace blink 210 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698