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) 2013 Google Inc. All rights reserved. | 5 * Copyright (C) 2013 Google Inc. All rights reserved. |
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. |
11 * | 11 * |
12 * This library is distributed in the hope that it will be useful, | 12 * This library is distributed in the hope that it will be useful, |
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 * Library General Public License for more details. | 15 * Library General Public License for more details. |
16 * | 16 * |
17 * You should have received a copy of the GNU Library General Public License | 17 * You should have received a copy of the GNU Library General Public License |
18 * along with this library; see the file COPYING.LIB. If not, write to | 18 * along with this library; see the file COPYING.LIB. If not, write to |
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
20 * Boston, MA 02110-1301, USA. | 20 * Boston, MA 02110-1301, USA. |
21 */ | 21 */ |
22 | 22 |
23 #ifndef FEComposite_h | 23 #ifndef FEComposite_h |
24 #define FEComposite_h | 24 #define FEComposite_h |
25 | 25 |
26 #include "SkXfermode.h" | 26 #include "SkXfermode.h" |
27 #include "platform/graphics/filters/FilterEffect.h" | 27 #include "platform/graphics/filters/FilterEffect.h" |
28 #include "wtf/text/WTFString.h" | |
29 | 28 |
30 namespace blink { | 29 namespace blink { |
31 | 30 |
32 enum CompositeOperationType { | 31 enum CompositeOperationType { |
33 FECOMPOSITE_OPERATOR_UNKNOWN = 0, | 32 FECOMPOSITE_OPERATOR_UNKNOWN = 0, |
34 FECOMPOSITE_OPERATOR_OVER = 1, | 33 FECOMPOSITE_OPERATOR_OVER = 1, |
35 FECOMPOSITE_OPERATOR_IN = 2, | 34 FECOMPOSITE_OPERATOR_IN = 2, |
36 FECOMPOSITE_OPERATOR_OUT = 3, | 35 FECOMPOSITE_OPERATOR_OUT = 3, |
37 FECOMPOSITE_OPERATOR_ATOP = 4, | 36 FECOMPOSITE_OPERATOR_ATOP = 4, |
38 FECOMPOSITE_OPERATOR_XOR = 5, | 37 FECOMPOSITE_OPERATOR_XOR = 5, |
(...skipping 28 matching lines...) Expand all Loading... |
67 virtual PassRefPtr<SkImageFilter> createImageFilterWithoutValidation(SkiaIma
geFilterBuilder*) override; | 66 virtual PassRefPtr<SkImageFilter> createImageFilterWithoutValidation(SkiaIma
geFilterBuilder*) override; |
68 | 67 |
69 protected: | 68 protected: |
70 virtual bool mayProduceInvalidPreMultipliedPixels() override { return m_type
== FECOMPOSITE_OPERATOR_ARITHMETIC; } | 69 virtual bool mayProduceInvalidPreMultipliedPixels() override { return m_type
== FECOMPOSITE_OPERATOR_ARITHMETIC; } |
71 | 70 |
72 private: | 71 private: |
73 FEComposite(Filter*, const CompositeOperationType&, float, float, float, flo
at); | 72 FEComposite(Filter*, const CompositeOperationType&, float, float, float, flo
at); |
74 | 73 |
75 PassRefPtr<SkImageFilter> createImageFilterInternal(SkiaImageFilterBuilder*,
bool requiresPMColorValidation); | 74 PassRefPtr<SkImageFilter> createImageFilterInternal(SkiaImageFilterBuilder*,
bool requiresPMColorValidation); |
76 | 75 |
77 template <int b1, int b4> | |
78 static inline void computeArithmeticPixelsNeon(unsigned char* source, unsign
ed char* destination, | |
79 unsigned pixelArrayLength, float k1, float k2, float k3, float k4); | |
80 static inline void platformArithmeticNeon(unsigned char* source, unsigned c
har* destination, | |
81 unsigned pixelArrayLength, float k1, float k2, float k3, float k4); | |
82 | |
83 CompositeOperationType m_type; | 76 CompositeOperationType m_type; |
84 float m_k1; | 77 float m_k1; |
85 float m_k2; | 78 float m_k2; |
86 float m_k3; | 79 float m_k3; |
87 float m_k4; | 80 float m_k4; |
88 }; | 81 }; |
89 | 82 |
90 } // namespace blink | 83 } // namespace blink |
91 | 84 |
92 #endif // FEComposite_h | 85 #endif // FEComposite_h |
OLD | NEW |