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 2004, 2005 Rob Buis <buis@kde.org> | 3 2004, 2005 Rob Buis <buis@kde.org> |
4 2005 Eric Seidel <eric@webkit.org> | 4 2005 Eric Seidel <eric@webkit.org> |
5 2009 Dirk Schulze <krit@webkit.org> | 5 2009 Dirk Schulze <krit@webkit.org> |
6 | 6 |
7 This library is free software; you can redistribute it and/or | 7 This library is free software; you can redistribute it and/or |
8 modify it under the terms of the GNU Library General Public | 8 modify it under the terms of the GNU Library General Public |
9 License as published by the Free Software Foundation; either | 9 License as published by the Free Software Foundation; either |
10 version 2 of the License, or (at your option) any later version. | 10 version 2 of the License, or (at your option) any later version. |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 return ((std::max((255 - alphaA) * colorB + colorA * 255, (255 - alphaB) * c
olorA + colorB * 255)) / 255); | 98 return ((std::max((255 - alphaA) * colorB + colorA * 255, (255 - alphaB) * c
olorA + colorB * 255)) / 255); |
99 } | 99 } |
100 | 100 |
101 void FEBlend::apply(Filter* filter) | 101 void FEBlend::apply(Filter* filter) |
102 { | 102 { |
103 m_in->apply(filter); | 103 m_in->apply(filter); |
104 m_in2->apply(filter); | 104 m_in2->apply(filter); |
105 if (!m_in->resultImage() || !m_in2->resultImage()) | 105 if (!m_in->resultImage() || !m_in2->resultImage()) |
106 return; | 106 return; |
107 | 107 |
108 if (m_mode == FEBLEND_MODE_UNKNOWN) | 108 if (m_mode <= FEBLEND_MODE_UNKNOWN || m_mode > FEBLEND_MODE_LIGHTEN) |
109 return; | 109 return; |
110 | 110 |
111 if (!getEffectContext()) | 111 if (!getEffectContext()) |
112 return; | 112 return; |
113 | 113 |
114 IntRect effectADrawingRect = calculateDrawingIntRect(m_in->scaledSubRegion()
); | 114 IntRect effectADrawingRect = calculateDrawingIntRect(m_in->scaledSubRegion()
); |
115 RefPtr<CanvasPixelArray> srcPixelArrayA(m_in->resultImage()->getPremultiplie
dImageData(effectADrawingRect)->data()); | 115 RefPtr<CanvasPixelArray> srcPixelArrayA(m_in->resultImage()->getPremultiplie
dImageData(effectADrawingRect)->data()); |
116 | 116 |
117 IntRect effectBDrawingRect = calculateDrawingIntRect(m_in2->scaledSubRegion(
)); | 117 IntRect effectBDrawingRect = calculateDrawingIntRect(m_in2->scaledSubRegion(
)); |
118 RefPtr<CanvasPixelArray> srcPixelArrayB(m_in2->resultImage()->getPremultipli
edImageData(effectBDrawingRect)->data()); | 118 RefPtr<CanvasPixelArray> srcPixelArrayB(m_in2->resultImage()->getPremultipli
edImageData(effectBDrawingRect)->data()); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 FilterEffect::externalRepresentation(ts); | 177 FilterEffect::externalRepresentation(ts); |
178 ts << " mode=\"" << m_mode << "\"]\n"; | 178 ts << " mode=\"" << m_mode << "\"]\n"; |
179 m_in->externalRepresentation(ts, indent + 1); | 179 m_in->externalRepresentation(ts, indent + 1); |
180 m_in2->externalRepresentation(ts, indent + 1); | 180 m_in2->externalRepresentation(ts, indent + 1); |
181 return ts; | 181 return ts; |
182 } | 182 } |
183 | 183 |
184 } // namespace WebCore | 184 } // namespace WebCore |
185 | 185 |
186 #endif // ENABLE(FILTERS) | 186 #endif // ENABLE(FILTERS) |
OLD | NEW |