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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 sk_sp<SkImageFilter> color = | 116 sk_sp<SkImageFilter> color = |
117 SkiaImageFilterBuilder::build(inputEffect(0), operatingColorSpace()); | 117 SkiaImageFilterBuilder::build(inputEffect(0), operatingColorSpace()); |
118 sk_sp<SkImageFilter> displ = | 118 sk_sp<SkImageFilter> displ = |
119 SkiaImageFilterBuilder::build(inputEffect(1), operatingColorSpace()); | 119 SkiaImageFilterBuilder::build(inputEffect(1), operatingColorSpace()); |
120 SkDisplacementMapEffect::ChannelSelectorType typeX = | 120 SkDisplacementMapEffect::ChannelSelectorType typeX = |
121 toSkiaMode(m_xChannelSelector); | 121 toSkiaMode(m_xChannelSelector); |
122 SkDisplacementMapEffect::ChannelSelectorType typeY = | 122 SkDisplacementMapEffect::ChannelSelectorType typeY = |
123 toSkiaMode(m_yChannelSelector); | 123 toSkiaMode(m_yChannelSelector); |
124 SkImageFilter::CropRect cropRect = getCropRect(); | 124 SkImageFilter::CropRect cropRect = getCropRect(); |
125 // FIXME : Only applyHorizontalScale is used and applyVerticalScale is ignored | 125 // FIXME : Only applyHorizontalScale is used and applyVerticalScale is ignored |
126 // This can be fixed by adding a 2nd scale parameter to SkDisplacementMapEffec
t | 126 // This can be fixed by adding a 2nd scale parameter to |
| 127 // SkDisplacementMapEffect. |
127 return SkDisplacementMapEffect::Make( | 128 return SkDisplacementMapEffect::Make( |
128 typeX, typeY, SkFloatToScalar(getFilter()->applyHorizontalScale(m_scale)), | 129 typeX, typeY, SkFloatToScalar(getFilter()->applyHorizontalScale(m_scale)), |
129 std::move(displ), std::move(color), &cropRect); | 130 std::move(displ), std::move(color), &cropRect); |
130 } | 131 } |
131 | 132 |
132 static TextStream& operator<<(TextStream& ts, const ChannelSelectorType& type) { | 133 static TextStream& operator<<(TextStream& ts, const ChannelSelectorType& type) { |
133 switch (type) { | 134 switch (type) { |
134 case CHANNEL_UNKNOWN: | 135 case CHANNEL_UNKNOWN: |
135 ts << "UNKNOWN"; | 136 ts << "UNKNOWN"; |
136 break; | 137 break; |
(...skipping 20 matching lines...) Expand all Loading... |
157 FilterEffect::externalRepresentation(ts); | 158 FilterEffect::externalRepresentation(ts); |
158 ts << " scale=\"" << m_scale << "\" " | 159 ts << " scale=\"" << m_scale << "\" " |
159 << "xChannelSelector=\"" << m_xChannelSelector << "\" " | 160 << "xChannelSelector=\"" << m_xChannelSelector << "\" " |
160 << "yChannelSelector=\"" << m_yChannelSelector << "\"]\n"; | 161 << "yChannelSelector=\"" << m_yChannelSelector << "\"]\n"; |
161 inputEffect(0)->externalRepresentation(ts, indent + 1); | 162 inputEffect(0)->externalRepresentation(ts, indent + 1); |
162 inputEffect(1)->externalRepresentation(ts, indent + 1); | 163 inputEffect(1)->externalRepresentation(ts, indent + 1); |
163 return ts; | 164 return ts; |
164 } | 165 } |
165 | 166 |
166 } // namespace blink | 167 } // namespace blink |
OLD | NEW |