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) Research In Motion Limited 2010. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
7 * Copyright (C) 2013 Google Inc. All rights reserved. | 7 * Copyright (C) 2013 Google Inc. All rights reserved. |
8 * | 8 * |
9 * This library is free software; you can redistribute it and/or | 9 * This library is free software; you can redistribute it and/or |
10 * modify it under the terms of the GNU Library General Public | 10 * modify it under the terms of the GNU Library General Public |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 | 78 |
79 bool FEMorphology::setRadiusY(float radiusY) | 79 bool FEMorphology::setRadiusY(float radiusY) |
80 { | 80 { |
81 radiusY = std::max(0.0f, radiusY); | 81 radiusY = std::max(0.0f, radiusY); |
82 if (m_radiusY == radiusY) | 82 if (m_radiusY == radiusY) |
83 return false; | 83 return false; |
84 m_radiusY = radiusY; | 84 m_radiusY = radiusY; |
85 return true; | 85 return true; |
86 } | 86 } |
87 | 87 |
88 FloatRect FEMorphology::mapRect(const FloatRect& rect, bool) const | 88 FloatRect FEMorphology::mapEffect(const FloatRect& rect) const |
89 { | 89 { |
90 FloatRect result = rect; | 90 FloatRect result = rect; |
91 result.inflateX(getFilter()->applyHorizontalScale(m_radiusX)); | 91 result.inflateX(getFilter()->applyHorizontalScale(m_radiusX)); |
92 result.inflateY(getFilter()->applyVerticalScale(m_radiusY)); | 92 result.inflateY(getFilter()->applyVerticalScale(m_radiusY)); |
93 return result; | 93 return result; |
94 } | 94 } |
95 | 95 |
96 sk_sp<SkImageFilter> FEMorphology::createImageFilter() | 96 sk_sp<SkImageFilter> FEMorphology::createImageFilter() |
97 { | 97 { |
98 sk_sp<SkImageFilter> input(SkiaImageFilterBuilder::build(inputEffect(0), ope
ratingColorSpace())); | 98 sk_sp<SkImageFilter> input(SkiaImageFilterBuilder::build(inputEffect(0), ope
ratingColorSpace())); |
(...skipping 26 matching lines...) Expand all Loading... |
125 writeIndent(ts, indent); | 125 writeIndent(ts, indent); |
126 ts << "[feMorphology"; | 126 ts << "[feMorphology"; |
127 FilterEffect::externalRepresentation(ts); | 127 FilterEffect::externalRepresentation(ts); |
128 ts << " operator=\"" << morphologyOperator() << "\" " | 128 ts << " operator=\"" << morphologyOperator() << "\" " |
129 << "radius=\"" << radiusX() << ", " << radiusY() << "\"]\n"; | 129 << "radius=\"" << radiusX() << ", " << radiusY() << "\"]\n"; |
130 inputEffect(0)->externalRepresentation(ts, indent + 1); | 130 inputEffect(0)->externalRepresentation(ts, indent + 1); |
131 return ts; | 131 return ts; |
132 } | 132 } |
133 | 133 |
134 } // namespace blink | 134 } // namespace blink |
OLD | NEW |