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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 return SkColorMatrixFilter::Create(matrix); | 154 return SkColorMatrixFilter::Create(matrix); |
155 } | 155 } |
156 | 156 |
157 bool FEColorMatrix::affectsTransparentPixels() | 157 bool FEColorMatrix::affectsTransparentPixels() |
158 { | 158 { |
159 // Because the input pixels are premultiplied, the only way clear pixels can
be | 159 // Because the input pixels are premultiplied, the only way clear pixels can
be |
160 // painted is if the additive component for the alpha is not 0. | 160 // painted is if the additive component for the alpha is not 0. |
161 return m_type == FECOLORMATRIX_TYPE_MATRIX && m_values.size() >= kColorMatri
xSize && m_values[19] > 0; | 161 return m_type == FECOLORMATRIX_TYPE_MATRIX && m_values.size() >= kColorMatri
xSize && m_values[19] > 0; |
162 } | 162 } |
163 | 163 |
164 PassRefPtr<SkImageFilter> FEColorMatrix::createImageFilter(SkiaImageFilterBuilde
r* builder) | 164 PassRefPtr<SkImageFilter> FEColorMatrix::createImageFilter(SkiaImageFilterBuilde
r& builder) |
165 { | 165 { |
166 RefPtr<SkImageFilter> input(builder->build(inputEffect(0), operatingColorSpa
ce())); | 166 RefPtr<SkImageFilter> input(builder.build(inputEffect(0), operatingColorSpac
e())); |
167 SkAutoTUnref<SkColorFilter> filter(createColorFilter(m_type, m_values)); | 167 SkAutoTUnref<SkColorFilter> filter(createColorFilter(m_type, m_values)); |
168 SkImageFilter::CropRect rect = getCropRect(builder->cropOffset()); | 168 SkImageFilter::CropRect rect = getCropRect(builder.cropOffset()); |
169 return adoptRef(SkColorFilterImageFilter::Create(filter, input.get(), &rect)
); | 169 return adoptRef(SkColorFilterImageFilter::Create(filter, input.get(), &rect)
); |
170 } | 170 } |
171 | 171 |
172 static TextStream& operator<<(TextStream& ts, const ColorMatrixType& type) | 172 static TextStream& operator<<(TextStream& ts, const ColorMatrixType& type) |
173 { | 173 { |
174 switch (type) { | 174 switch (type) { |
175 case FECOLORMATRIX_TYPE_UNKNOWN: | 175 case FECOLORMATRIX_TYPE_UNKNOWN: |
176 ts << "UNKNOWN"; | 176 ts << "UNKNOWN"; |
177 break; | 177 break; |
178 case FECOLORMATRIX_TYPE_MATRIX: | 178 case FECOLORMATRIX_TYPE_MATRIX: |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 ts << " "; | 225 ts << " "; |
226 } | 226 } |
227 ts << "\""; | 227 ts << "\""; |
228 } | 228 } |
229 ts << "]\n"; | 229 ts << "]\n"; |
230 inputEffect(0)->externalRepresentation(ts, indent + 1); | 230 inputEffect(0)->externalRepresentation(ts, indent + 1); |
231 return ts; | 231 return ts; |
232 } | 232 } |
233 | 233 |
234 } // namespace blink | 234 } // namespace blink |
OLD | NEW |