OLD | NEW |
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 Loading... |
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 |
OLD | NEW |