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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/filters/FETurbulence.cpp

Issue 1375793003: Update error-handling for fe*Lighting and feTurbulence (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
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/filters/FELighting.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) 2009 Dirk Schulze <krit@webkit.org> 5 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
6 * Copyright (C) 2010 Renata Hodovan <reni@inf.u-szeged.hu> 6 * Copyright (C) 2010 Renata Hodovan <reni@inf.u-szeged.hu>
7 * Copyright (C) 2011 Gabor Loki <loki@webkit.org> 7 * Copyright (C) 2011 Gabor Loki <loki@webkit.org>
8 * Copyright (C) 2013 Google Inc. All rights reserved. 8 * Copyright (C) 2013 Google Inc. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 SkPerlinNoiseShader::CreateFractalNoise(SkFloatToScalar(baseFrequencyX), 142 SkPerlinNoiseShader::CreateFractalNoise(SkFloatToScalar(baseFrequencyX),
143 SkFloatToScalar(baseFrequencyY), numOctaves(), SkFloatToScalar(seed( )), 143 SkFloatToScalar(baseFrequencyY), numOctaves(), SkFloatToScalar(seed( )),
144 stitchTiles() ? &size : 0) : 144 stitchTiles() ? &size : 0) :
145 SkPerlinNoiseShader::CreateTurbulence(SkFloatToScalar(baseFrequencyX), 145 SkPerlinNoiseShader::CreateTurbulence(SkFloatToScalar(baseFrequencyX),
146 SkFloatToScalar(baseFrequencyY), numOctaves(), SkFloatToScalar(seed( )), 146 SkFloatToScalar(baseFrequencyY), numOctaves(), SkFloatToScalar(seed( )),
147 stitchTiles() ? &size : 0); 147 stitchTiles() ? &size : 0);
148 } 148 }
149 149
150 PassRefPtr<SkImageFilter> FETurbulence::createImageFilter(SkiaImageFilterBuilder * builder) 150 PassRefPtr<SkImageFilter> FETurbulence::createImageFilter(SkiaImageFilterBuilder * builder)
151 { 151 {
152 if (m_baseFrequencyX < 0 || m_baseFrequencyY < 0)
153 return createTransparentBlack(builder);
154
152 SkAutoTUnref<SkShader> shader(createShader()); 155 SkAutoTUnref<SkShader> shader(createShader());
153 SkImageFilter::CropRect rect = getCropRect(builder->cropOffset()); 156 SkImageFilter::CropRect rect = getCropRect(builder->cropOffset());
154 return adoptRef(SkRectShaderImageFilter::Create(shader, &rect)); 157 return adoptRef(SkRectShaderImageFilter::Create(shader, &rect));
155 } 158 }
156 159
157 static TextStream& operator<<(TextStream& ts, const TurbulenceType& type) 160 static TextStream& operator<<(TextStream& ts, const TurbulenceType& type)
158 { 161 {
159 switch (type) { 162 switch (type) {
160 case FETURBULENCE_TYPE_UNKNOWN: 163 case FETURBULENCE_TYPE_UNKNOWN:
161 ts << "UNKNOWN"; 164 ts << "UNKNOWN";
(...skipping 15 matching lines...) Expand all
177 FilterEffect::externalRepresentation(ts); 180 FilterEffect::externalRepresentation(ts);
178 ts << " type=\"" << type() << "\" " 181 ts << " type=\"" << type() << "\" "
179 << "baseFrequency=\"" << baseFrequencyX() << ", " << baseFrequencyY() << "\" " 182 << "baseFrequency=\"" << baseFrequencyX() << ", " << baseFrequencyY() << "\" "
180 << "seed=\"" << seed() << "\" " 183 << "seed=\"" << seed() << "\" "
181 << "numOctaves=\"" << numOctaves() << "\" " 184 << "numOctaves=\"" << numOctaves() << "\" "
182 << "stitchTiles=\"" << stitchTiles() << "\"]\n"; 185 << "stitchTiles=\"" << stitchTiles() << "\"]\n";
183 return ts; 186 return ts;
184 } 187 }
185 188
186 } // namespace blink 189 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/filters/FELighting.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698