diff options
Diffstat (limited to 'chromium/third_party/WebKit/Source/platform/graphics/filters/FEColorMatrix.h')
-rw-r--r-- | chromium/third_party/WebKit/Source/platform/graphics/filters/FEColorMatrix.h | 34 |
1 files changed, 3 insertions, 31 deletions
diff --git a/chromium/third_party/WebKit/Source/platform/graphics/filters/FEColorMatrix.h b/chromium/third_party/WebKit/Source/platform/graphics/filters/FEColorMatrix.h index cd7cf1b5d06..4612161960d 100644 --- a/chromium/third_party/WebKit/Source/platform/graphics/filters/FEColorMatrix.h +++ b/chromium/third_party/WebKit/Source/platform/graphics/filters/FEColorMatrix.h @@ -49,7 +49,7 @@ public: virtual PassRefPtr<SkImageFilter> createImageFilter(SkiaImageFilterBuilder*) OVERRIDE; - virtual TextStream& externalRepresentation(TextStream&, int indention) const; + virtual TextStream& externalRepresentation(TextStream&, int indention) const OVERRIDE; static inline void calculateSaturateComponents(float* components, float value); static inline void calculateHueRotateComponents(float* components, float value); @@ -58,41 +58,13 @@ private: FEColorMatrix(Filter*, ColorMatrixType, const Vector<float>&); virtual void applySoftware() OVERRIDE; - virtual bool applySkia() OVERRIDE; + + virtual bool affectsTransparentPixels() OVERRIDE; ColorMatrixType m_type; Vector<float> m_values; }; -inline void FEColorMatrix::calculateSaturateComponents(float* components, float value) -{ - components[0] = (0.213 + 0.787 * value); - components[1] = (0.715 - 0.715 * value); - components[2] = (0.072 - 0.072 * value); - components[3] = (0.213 - 0.213 * value); - components[4] = (0.715 + 0.285 * value); - components[5] = (0.072 - 0.072 * value); - components[6] = (0.213 - 0.213 * value); - components[7] = (0.715 - 0.715 * value); - components[8] = (0.072 + 0.928 * value); -} - -inline void FEColorMatrix::calculateHueRotateComponents(float* components, float value) -{ - float cosHue = cos(value * piFloat / 180); - float sinHue = sin(value * piFloat / 180); - components[0] = 0.213 + cosHue * 0.787 - sinHue * 0.213; - components[1] = 0.715 - cosHue * 0.715 - sinHue * 0.715; - components[2] = 0.072 - cosHue * 0.072 + sinHue * 0.928; - components[3] = 0.213 - cosHue * 0.213 + sinHue * 0.143; - components[4] = 0.715 + cosHue * 0.285 + sinHue * 0.140; - components[5] = 0.072 - cosHue * 0.072 - sinHue * 0.283; - components[6] = 0.213 - cosHue * 0.213 - sinHue * 0.787; - components[7] = 0.715 - cosHue * 0.715 + sinHue * 0.715; - components[8] = 0.072 + cosHue * 0.928 + sinHue * 0.072; -} - - } // namespace WebCore #endif // FEColorMatrix_h |