Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(364)

Side by Side Diff: Source/platform/graphics/filters/FEDropShadow.cpp

Issue 669123002: Fixed Shadow blur for transparent objects (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added missing virtual layout test to TestExpectations Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 68
69 PassRefPtr<SkImageFilter> FEDropShadow::createImageFilter(SkiaImageFilterBuilder * builder) 69 PassRefPtr<SkImageFilter> FEDropShadow::createImageFilter(SkiaImageFilterBuilder * builder)
70 { 70 {
71 RefPtr<SkImageFilter> input(builder->build(inputEffect(0), operatingColorSpa ce())); 71 RefPtr<SkImageFilter> input(builder->build(inputEffect(0), operatingColorSpa ce()));
72 float dx = filter()->applyHorizontalScale(m_dx); 72 float dx = filter()->applyHorizontalScale(m_dx);
73 float dy = filter()->applyVerticalScale(m_dy); 73 float dy = filter()->applyVerticalScale(m_dy);
74 float stdX = filter()->applyHorizontalScale(m_stdX); 74 float stdX = filter()->applyHorizontalScale(m_stdX);
75 float stdY = filter()->applyVerticalScale(m_stdY); 75 float stdY = filter()->applyVerticalScale(m_stdY);
76 Color color = adaptColorToOperatingColorSpace(m_shadowColor.combineWithAlpha (m_shadowOpacity)); 76 Color color = adaptColorToOperatingColorSpace(m_shadowColor.combineWithAlpha (m_shadowOpacity));
77 SkImageFilter::CropRect cropRect = getCropRect(builder->cropOffset()); 77 SkImageFilter::CropRect cropRect = getCropRect(builder->cropOffset());
78 return adoptRef(SkDropShadowImageFilter::Create(SkFloatToScalar(dx), SkFloat ToScalar(dy), SkFloatToScalar(stdX), SkFloatToScalar(stdY), color.rgb(), input.g et(), &cropRect)); 78 return adoptRef(SkDropShadowImageFilter::Create(SkFloatToScalar(dx), SkFloat ToScalar(dy), SkFloatToScalar(stdX), SkFloatToScalar(stdY), color.rgb(), SkDropS hadowImageFilter::kDrawShadowAndForeground_ShadowMode, input.get(), &cropRect, 0 ));
79 } 79 }
80 80
81 81
82 TextStream& FEDropShadow::externalRepresentation(TextStream& ts, int indent) con st 82 TextStream& FEDropShadow::externalRepresentation(TextStream& ts, int indent) con st
83 { 83 {
84 writeIndent(ts, indent); 84 writeIndent(ts, indent);
85 ts << "[feDropShadow"; 85 ts << "[feDropShadow";
86 FilterEffect::externalRepresentation(ts); 86 FilterEffect::externalRepresentation(ts);
87 ts << " stdDeviation=\"" << m_stdX << ", " << m_stdY << "\" dx=\"" << m_dx < < "\" dy=\"" << m_dy << "\" flood-color=\"" << m_shadowColor.nameForRenderTreeAs Text() <<"\" flood-opacity=\"" << m_shadowOpacity << "]\n"; 87 ts << " stdDeviation=\"" << m_stdX << ", " << m_stdY << "\" dx=\"" << m_dx < < "\" dy=\"" << m_dy << "\" flood-color=\"" << m_shadowColor.nameForRenderTreeAs Text() <<"\" flood-opacity=\"" << m_shadowOpacity << "]\n";
88 inputEffect(0)->externalRepresentation(ts, indent + 1); 88 inputEffect(0)->externalRepresentation(ts, indent + 1);
89 return ts; 89 return ts;
90 } 90 }
91 91
92 } // namespace blink 92 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698