1 /* 2 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 3 * Copyright (C) 2013 Google Inc. All rights reserved. 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU Library General Public 7 * License as published by the Free Software Foundation; either 8 * version 2 of the License, or (at your option) any later version. 9 * 10 * This library is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * Library General Public License for more details. 14 * 15 * You should have received a copy of the GNU Library General Public License 16 * along with this library; see the file COPYING.LIB. If not, write to 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 * Boston, MA 02110-1301, USA. 19 */ 20 21 #ifndef FEDropShadow_h 22 #define FEDropShadow_h 23 24 #include "core/platform/graphics/Color.h" 25 #include "core/platform/graphics/filters/Filter.h" 26 #include "core/platform/graphics/filters/FilterEffect.h" 27 28 namespace WebCore { 29 30 class FEDropShadow : public FilterEffect { 31 public: 32 static PassRefPtr<FEDropShadow> create(Filter*, float, float, float, float, const Color&, float); 33 34 float stdDeviationX() const { return m_stdX; } 35 void setStdDeviationX(float stdX) { m_stdX = stdX; } 36 37 float stdDeviationY() const { return m_stdY; } 38 void setStdDeviationY(float stdY) { m_stdY = stdY; } 39 40 float dx() const { return m_dx; } 41 void setDx(float dx) { m_dx = dx; } 42 43 float dy() const { return m_dy; } 44 void setDy(float dy) { m_dy = dy; } 45 46 Color shadowColor() const { return m_shadowColor; } 47 void setShadowColor(const Color& shadowColor) { m_shadowColor = shadowColor; } 48 49 float shadowOpacity() const { return m_shadowOpacity; } 50 void setShadowOpacity(float shadowOpacity) { m_shadowOpacity = shadowOpacity; } 51 52 static float calculateStdDeviation(float); 53 54 virtual void determineAbsolutePaintRect(); 55 virtual FloatRect mapRect(const FloatRect&, bool forward = true) OVERRIDE FINAL; 56 57 virtual TextStream& externalRepresentation(TextStream&, int indention) const; 58 59 private: 60 FEDropShadow(Filter*, float, float, float, float, const Color&, float); 61 62 virtual void applySoftware() OVERRIDE; 63 64 float m_stdX; 65 float m_stdY; 66 float m_dx; 67 float m_dy; 68 Color m_shadowColor; 69 float m_shadowOpacity; 70 }; 71 72 } // namespace WebCore 73 74 #endif // FEDropShadow_h 75