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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGFEConvolveMatrixElement.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) 2009 Dirk Schulze <krit@webkit.org> 2 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org>
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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 invalidate(); 152 invalidate();
153 return; 153 return;
154 } 154 }
155 155
156 SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); 156 SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName);
157 } 157 }
158 158
159 PassRefPtrWillBeRawPtr<FilterEffect> SVGFEConvolveMatrixElement::build(SVGFilter Builder* filterBuilder, Filter* filter) 159 PassRefPtrWillBeRawPtr<FilterEffect> SVGFEConvolveMatrixElement::build(SVGFilter Builder* filterBuilder, Filter* filter)
160 { 160 {
161 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr entValue()->value())); 161 FilterEffect* input1 = filterBuilder->getEffectById(AtomicString(m_in1->curr entValue()->value()));
162 162 ASSERT(input1);
163 if (!input1)
164 return nullptr;
165 163
166 int orderXValue = orderX()->currentValue()->value(); 164 int orderXValue = orderX()->currentValue()->value();
167 int orderYValue = orderY()->currentValue()->value(); 165 int orderYValue = orderY()->currentValue()->value();
168 if (!m_order->isSpecified()) { 166 if (!m_order->isSpecified()) {
169 orderXValue = 3; 167 orderXValue = 3;
170 orderYValue = 3; 168 orderYValue = 3;
171 } 169 }
172 170
173 int targetXValue = m_targetX->currentValue()->value(); 171 int targetXValue = m_targetX->currentValue()->value();
174 // The spec says the default value is: targetX = floor ( orderX / 2 )) 172 // The spec says the default value is: targetX = floor ( orderX / 2 ))
(...skipping 17 matching lines...) Expand all
192 190
193 RefPtrWillBeRawPtr<FilterEffect> effect = FEConvolveMatrix::create(filter, 191 RefPtrWillBeRawPtr<FilterEffect> effect = FEConvolveMatrix::create(filter,
194 IntSize(orderXValue, orderYValue), divisorValue, 192 IntSize(orderXValue, orderYValue), divisorValue,
195 m_bias->currentValue()->value(), IntPoint(targetXValue, targetYValue), m _edgeMode->currentValue()->enumValue(), 193 m_bias->currentValue()->value(), IntPoint(targetXValue, targetYValue), m _edgeMode->currentValue()->enumValue(),
196 m_preserveAlpha->currentValue()->value(), m_kernelMatrix->currentValue() ->toFloatVector()); 194 m_preserveAlpha->currentValue()->value(), m_kernelMatrix->currentValue() ->toFloatVector());
197 effect->inputEffects().append(input1); 195 effect->inputEffects().append(input1);
198 return effect.release(); 196 return effect.release();
199 } 197 }
200 198
201 } // namespace blink 199 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698