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 Igalia, S.L. | 6 * Copyright (C) 2010 Igalia, S.L. |
7 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 7 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 , m_stdX(x) | 45 , m_stdX(x) |
46 , m_stdY(y) | 46 , m_stdY(y) |
47 { | 47 { |
48 } | 48 } |
49 | 49 |
50 PassRefPtrWillBeRawPtr<FEGaussianBlur> FEGaussianBlur::create(Filter* filter, fl
oat x, float y) | 50 PassRefPtrWillBeRawPtr<FEGaussianBlur> FEGaussianBlur::create(Filter* filter, fl
oat x, float y) |
51 { | 51 { |
52 return adoptRefWillBeNoop(new FEGaussianBlur(filter, x, y)); | 52 return adoptRefWillBeNoop(new FEGaussianBlur(filter, x, y)); |
53 } | 53 } |
54 | 54 |
55 float FEGaussianBlur::stdDeviationX() const | |
56 { | |
57 return m_stdX; | |
58 } | |
59 | |
60 void FEGaussianBlur::setStdDeviationX(float x) | |
61 { | |
62 m_stdX = x; | |
63 } | |
64 | |
65 float FEGaussianBlur::stdDeviationY() const | |
66 { | |
67 return m_stdY; | |
68 } | |
69 | |
70 void FEGaussianBlur::setStdDeviationY(float y) | |
71 { | |
72 m_stdY = y; | |
73 } | |
74 | |
75 IntSize FEGaussianBlur::calculateUnscaledKernelSize(const FloatPoint& std) | 55 IntSize FEGaussianBlur::calculateUnscaledKernelSize(const FloatPoint& std) |
76 { | 56 { |
77 ASSERT(std.x() >= 0 && std.y() >= 0); | 57 ASSERT(std.x() >= 0 && std.y() >= 0); |
78 | 58 |
79 IntSize kernelSize; | 59 IntSize kernelSize; |
80 // Limit the kernel size to 1000. A bigger radius won't make a big differenc
e for the result image but | 60 // Limit the kernel size to 1000. A bigger radius won't make a big differenc
e for the result image but |
81 // inflates the absolute paint rect to much. This is compatible with Firefox
' behavior. | 61 // inflates the absolute paint rect to much. This is compatible with Firefox
' behavior. |
82 if (std.x()) { | 62 if (std.x()) { |
83 int size = std::max<unsigned>(2, static_cast<unsigned>(floorf(std.x() *
gaussianKernelFactor() + 0.5f))); | 63 int size = std::max<unsigned>(2, static_cast<unsigned>(floorf(std.x() *
gaussianKernelFactor() + 0.5f))); |
84 kernelSize.setWidth(size); | 64 kernelSize.setWidth(size); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 { | 123 { |
144 writeIndent(ts, indent); | 124 writeIndent(ts, indent); |
145 ts << "[feGaussianBlur"; | 125 ts << "[feGaussianBlur"; |
146 FilterEffect::externalRepresentation(ts); | 126 FilterEffect::externalRepresentation(ts); |
147 ts << " stdDeviation=\"" << m_stdX << ", " << m_stdY << "\"]\n"; | 127 ts << " stdDeviation=\"" << m_stdX << ", " << m_stdY << "\"]\n"; |
148 inputEffect(0)->externalRepresentation(ts, indent + 1); | 128 inputEffect(0)->externalRepresentation(ts, indent + 1); |
149 return ts; | 129 return ts; |
150 } | 130 } |
151 | 131 |
152 } // namespace blink | 132 } // namespace blink |
OLD | NEW |