OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
3 * Copyright (C) 2013 Google Inc. All rights reserved. | 3 * Copyright (C) 2013 Google Inc. All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 const Filter* filter = this->getFilter(); | 58 const Filter* filter = this->getFilter(); |
59 DCHECK(filter); | 59 DCHECK(filter); |
60 | 60 |
61 FloatRect offsetRect = rect; | 61 FloatRect offsetRect = rect; |
62 offsetRect.move(filter->applyHorizontalScale(m_dx), | 62 offsetRect.move(filter->applyHorizontalScale(m_dx), |
63 filter->applyVerticalScale(m_dy)); | 63 filter->applyVerticalScale(m_dy)); |
64 | 64 |
65 IntSize kernelSize = | 65 IntSize kernelSize = |
66 FEGaussianBlur::calculateKernelSize(filter, FloatPoint(m_stdX, m_stdY)); | 66 FEGaussianBlur::calculateKernelSize(filter, FloatPoint(m_stdX, m_stdY)); |
67 | 67 |
68 // We take the half kernel size and multiply it with three, because we run box
blur three times. | 68 // We take the half kernel size and multiply it by three, because we run box |
| 69 // blur three times. |
69 FloatRect result = unionRect(rect, offsetRect); | 70 FloatRect result = unionRect(rect, offsetRect); |
70 result.inflateX(3.0f * kernelSize.width() * 0.5f); | 71 result.inflateX(3.0f * kernelSize.width() * 0.5f); |
71 result.inflateY(3.0f * kernelSize.height() * 0.5f); | 72 result.inflateY(3.0f * kernelSize.height() * 0.5f); |
72 return result; | 73 return result; |
73 } | 74 } |
74 | 75 |
75 sk_sp<SkImageFilter> FEDropShadow::createImageFilter() { | 76 sk_sp<SkImageFilter> FEDropShadow::createImageFilter() { |
76 sk_sp<SkImageFilter> input( | 77 sk_sp<SkImageFilter> input( |
77 SkiaImageFilterBuilder::build(inputEffect(0), operatingColorSpace())); | 78 SkiaImageFilterBuilder::build(inputEffect(0), operatingColorSpace())); |
78 float dx = getFilter()->applyHorizontalScale(m_dx); | 79 float dx = getFilter()->applyHorizontalScale(m_dx); |
(...skipping 17 matching lines...) Expand all Loading... |
96 FilterEffect::externalRepresentation(ts); | 97 FilterEffect::externalRepresentation(ts); |
97 ts << " stdDeviation=\"" << m_stdX << ", " << m_stdY << "\" dx=\"" << m_dx | 98 ts << " stdDeviation=\"" << m_stdX << ", " << m_stdY << "\" dx=\"" << m_dx |
98 << "\" dy=\"" << m_dy << "\" flood-color=\"" | 99 << "\" dy=\"" << m_dy << "\" flood-color=\"" |
99 << m_shadowColor.nameForLayoutTreeAsText() << "\" flood-opacity=\"" | 100 << m_shadowColor.nameForLayoutTreeAsText() << "\" flood-opacity=\"" |
100 << m_shadowOpacity << "]\n"; | 101 << m_shadowOpacity << "]\n"; |
101 inputEffect(0)->externalRepresentation(ts, indent + 1); | 102 inputEffect(0)->externalRepresentation(ts, indent + 1); |
102 return ts; | 103 return ts; |
103 } | 104 } |
104 | 105 |
105 } // namespace blink | 106 } // namespace blink |
OLD | NEW |