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

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

Issue 2701993002: DO NOT COMMIT: Results of running new (proposed) clang-format on Blink (Closed)
Patch Set: Created 3 years, 10 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 return SkPictureImageFilter::Make(ToSkPicture(builder.endRecording()), 188 return SkPictureImageFilter::Make(ToSkPicture(builder.endRecording()),
189 dstRect); 189 dstRect);
190 } 190 }
191 191
192 sk_sp<SkImageFilter> FEImage::createImageFilter() { 192 sk_sp<SkImageFilter> FEImage::createImageFilter() {
193 if (auto* layoutObject = referencedLayoutObject()) 193 if (auto* layoutObject = referencedLayoutObject())
194 return createImageFilterForLayoutObject(*layoutObject); 194 return createImageFilterForLayoutObject(*layoutObject);
195 195
196 // TODO(ccameron): Determine the correct color behavior for this function. 196 // TODO(ccameron): Determine the correct color behavior for this function.
197 // https://crbug.com/667431 197 // https://crbug.com/667431
198 sk_sp<SkImage> image = m_image 198 sk_sp<SkImage> image = m_image ? m_image->imageForCurrentFrame(
199 ? m_image->imageForCurrentFrame( 199 ColorBehavior::transformToGlobalTarget())
200 ColorBehavior::transformToGlobalTarget()) 200 : nullptr;
201 : nullptr;
202 if (!image) { 201 if (!image) {
203 // "A href reference that is an empty image (zero width or zero height), 202 // "A href reference that is an empty image (zero width or zero height),
204 // that fails to download, is non-existent, or that cannot be displayed 203 // that fails to download, is non-existent, or that cannot be displayed
205 // (e.g. because it is not in a supported image format) fills the filter 204 // (e.g. because it is not in a supported image format) fills the filter
206 // primitive subregion with transparent black." 205 // primitive subregion with transparent black."
207 return createTransparentBlack(); 206 return createTransparentBlack();
208 } 207 }
209 208
210 FloatRect srcRect = FloatRect(FloatPoint(), FloatSize(m_image->size())); 209 FloatRect srcRect = FloatRect(FloatPoint(), FloatSize(m_image->size()));
211 FloatRect dstRect = filterPrimitiveSubregion(); 210 FloatRect dstRect = filterPrimitiveSubregion();
212 211
213 m_preserveAspectRatio->transformRect(dstRect, srcRect); 212 m_preserveAspectRatio->transformRect(dstRect, srcRect);
214 213
215 return SkImageSource::Make(std::move(image), srcRect, dstRect, 214 return SkImageSource::Make(std::move(image), srcRect, dstRect,
216 kHigh_SkFilterQuality); 215 kHigh_SkFilterQuality);
217 } 216 }
218 217
219 } // namespace blink 218 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698