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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGFEDisplacementMapElement.cpp

Issue 1383013002: SVGFilterBuilder::getEffectById never return nullptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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) 2006 Oliver Hunt <oliver@nerget.com> 2 * Copyright (C) 2006 Oliver Hunt <oliver@nerget.com>
3 * 3 *
4 * This library is free software; you can redistribute it and/or 4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public 5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either 6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version. 7 * version 2 of the License, or (at your option) any later version.
8 * 8 *
9 * This library is distributed in the hope that it will be useful, 9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 return; 94 return;
95 } 95 }
96 96
97 SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); 97 SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName);
98 } 98 }
99 99
100 PassRefPtrWillBeRawPtr<FilterEffect> SVGFEDisplacementMapElement::build(SVGFilte rBuilder* filterBuilder, Filter* filter) 100 PassRefPtrWillBeRawPtr<FilterEffect> SVGFEDisplacementMapElement::build(SVGFilte rBuilder* filterBuilder, Filter* filter)
101 { 101 {
102 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr entValue()->value())); 102 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr entValue()->value()));
103 FilterEffect* input2 = filterBuilder->getEffectById(AtomicString(m_in2->curr entValue()->value())); 103 FilterEffect* input2 = filterBuilder->getEffectById(AtomicString(m_in2->curr entValue()->value()));
104 104 ASSERT(input1 && input2);
105 if (!input1 || !input2)
106 return nullptr;
107 105
108 RefPtrWillBeRawPtr<FilterEffect> effect = FEDisplacementMap::create(filter, m_xChannelSelector->currentValue()->enumValue(), m_yChannelSelector->currentValu e()->enumValue(), m_scale->currentValue()->value()); 106 RefPtrWillBeRawPtr<FilterEffect> effect = FEDisplacementMap::create(filter, m_xChannelSelector->currentValue()->enumValue(), m_yChannelSelector->currentValu e()->enumValue(), m_scale->currentValue()->value());
109 FilterEffectVector& inputEffects = effect->inputEffects(); 107 FilterEffectVector& inputEffects = effect->inputEffects();
110 inputEffects.reserveCapacity(2); 108 inputEffects.reserveCapacity(2);
111 inputEffects.append(input1); 109 inputEffects.append(input1);
112 inputEffects.append(input2); 110 inputEffects.append(input2);
113 return effect.release(); 111 return effect.release();
114 } 112 }
115 113
116 } // namespace blink 114 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698