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) 2013 Google Inc. All rights reserved. | 6 * Copyright (C) 2013 Google Inc. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 if (values.size() == 1) | 146 if (values.size() == 1) |
147 hueRotateMatrix(values[0], matrix); | 147 hueRotateMatrix(values[0], matrix); |
148 break; | 148 break; |
149 case FECOLORMATRIX_TYPE_LUMINANCETOALPHA: | 149 case FECOLORMATRIX_TYPE_LUMINANCETOALPHA: |
150 luminanceToAlphaMatrix(matrix); | 150 luminanceToAlphaMatrix(matrix); |
151 break; | 151 break; |
152 } | 152 } |
153 return SkColorFilter::MakeMatrixFilterRowMajor255(matrix); | 153 return SkColorFilter::MakeMatrixFilterRowMajor255(matrix); |
154 } | 154 } |
155 | 155 |
156 bool FEColorMatrix::affectsTransparentPixels() | 156 bool FEColorMatrix::affectsTransparentPixels() const |
157 { | 157 { |
158 // Because the input pixels are premultiplied, the only way clear pixels can
be | 158 // Because the input pixels are premultiplied, the only way clear pixels can
be |
159 // painted is if the additive component for the alpha is not 0. | 159 // painted is if the additive component for the alpha is not 0. |
160 return m_type == FECOLORMATRIX_TYPE_MATRIX && m_values.size() >= kColorMatri
xSize && m_values[19] > 0; | 160 return m_type == FECOLORMATRIX_TYPE_MATRIX && m_values.size() >= kColorMatri
xSize && m_values[19] > 0; |
161 } | 161 } |
162 | 162 |
163 sk_sp<SkImageFilter> FEColorMatrix::createImageFilter() | 163 sk_sp<SkImageFilter> FEColorMatrix::createImageFilter() |
164 { | 164 { |
165 sk_sp<SkImageFilter> input(SkiaImageFilterBuilder::build(inputEffect(0), ope
ratingColorSpace())); | 165 sk_sp<SkImageFilter> input(SkiaImageFilterBuilder::build(inputEffect(0), ope
ratingColorSpace())); |
166 sk_sp<SkColorFilter> filter = createColorFilter(m_type, m_values); | 166 sk_sp<SkColorFilter> filter = createColorFilter(m_type, m_values); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 ts << " "; | 224 ts << " "; |
225 } | 225 } |
226 ts << "\""; | 226 ts << "\""; |
227 } | 227 } |
228 ts << "]\n"; | 228 ts << "]\n"; |
229 inputEffect(0)->externalRepresentation(ts, indent + 1); | 229 inputEffect(0)->externalRepresentation(ts, indent + 1); |
230 return ts; | 230 return ts; |
231 } | 231 } |
232 | 232 |
233 } // namespace blink | 233 } // namespace blink |
OLD | NEW |