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) 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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 bool FETurbulence::setStitchTiles(bool stitch) | 121 bool FETurbulence::setStitchTiles(bool stitch) |
122 { | 122 { |
123 if (m_stitchTiles == stitch) | 123 if (m_stitchTiles == stitch) |
124 return false; | 124 return false; |
125 m_stitchTiles = stitch; | 125 m_stitchTiles = stitch; |
126 return true; | 126 return true; |
127 } | 127 } |
128 | 128 |
129 sk_sp<SkShader> FETurbulence::createShader() const | 129 sk_sp<SkShader> FETurbulence::createShader() const |
130 { | 130 { |
131 const SkISize size = SkISize::Make( | 131 const SkISize size = SkISize::Make(effectBoundaries().width(), effectBoundar
ies().height()); |
132 filterPrimitiveSubregion().width(), | |
133 filterPrimitiveSubregion().height()); | |
134 // Frequency should be scaled by page zoom, but not by primitiveUnits. | 132 // Frequency should be scaled by page zoom, but not by primitiveUnits. |
135 // So we apply only the transform scale (as Filter::apply*Scale() do) | 133 // So we apply only the transform scale (as Filter::apply*Scale() do) |
136 // and not the target bounding box scale (as SVGFilter::apply*Scale() | 134 // and not the target bounding box scale (as SVGFilter::apply*Scale() |
137 // would do). Note also that we divide by the scale since this is | 135 // would do). Note also that we divide by the scale since this is |
138 // a frequency, not a period. | 136 // a frequency, not a period. |
139 float baseFrequencyX = m_baseFrequencyX / getFilter()->scale(); | 137 float baseFrequencyX = m_baseFrequencyX / getFilter()->scale(); |
140 float baseFrequencyY = m_baseFrequencyY / getFilter()->scale(); | 138 float baseFrequencyY = m_baseFrequencyY / getFilter()->scale(); |
141 return (type() == FETURBULENCE_TYPE_FRACTALNOISE) ? | 139 return (type() == FETURBULENCE_TYPE_FRACTALNOISE) ? |
142 SkPerlinNoiseShader::MakeFractalNoise(SkFloatToScalar(baseFrequencyX), | 140 SkPerlinNoiseShader::MakeFractalNoise(SkFloatToScalar(baseFrequencyX), |
143 SkFloatToScalar(baseFrequencyY), numOctaves(), SkFloatToScalar(seed(
)), | 141 SkFloatToScalar(baseFrequencyY), numOctaves(), SkFloatToScalar(seed(
)), |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 FilterEffect::externalRepresentation(ts); | 179 FilterEffect::externalRepresentation(ts); |
182 ts << " type=\"" << type() << "\" " | 180 ts << " type=\"" << type() << "\" " |
183 << "baseFrequency=\"" << baseFrequencyX() << ", " << baseFrequencyY() <<
"\" " | 181 << "baseFrequency=\"" << baseFrequencyX() << ", " << baseFrequencyY() <<
"\" " |
184 << "seed=\"" << seed() << "\" " | 182 << "seed=\"" << seed() << "\" " |
185 << "numOctaves=\"" << numOctaves() << "\" " | 183 << "numOctaves=\"" << numOctaves() << "\" " |
186 << "stitchTiles=\"" << stitchTiles() << "\"]\n"; | 184 << "stitchTiles=\"" << stitchTiles() << "\"]\n"; |
187 return ts; | 185 return ts; |
188 } | 186 } |
189 | 187 |
190 } // namespace blink | 188 } // namespace blink |
OLD | NEW |