Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Dirk Schulze <krit@webkit.org> | |
| 3 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 4 * | 3 * |
| 5 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
| 8 * 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. |
| 9 * | 8 * |
| 10 * 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, |
| 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 * Library General Public License for more details. | 12 * Library General Public License for more details. |
| 14 * | 13 * |
| 15 * You should have received a copy of the GNU Library General Public License | 14 * 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 | 15 * along with this library; see the file COPYING.LIB. If not, write to |
| 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 18 * Boston, MA 02110-1301, USA. | 17 * Boston, MA 02110-1301, USA. |
| 19 */ | 18 */ |
| 20 | 19 |
| 21 #ifndef SourceAlpha_h | 20 #include "config.h" |
| 22 #define SourceAlpha_h | 21 #include "core/css/InlineVariablesIterator.h" |
| 23 | 22 |
| 24 #include "platform/graphics/filters/Filter.h" | 23 #include "RuntimeEnabledFeatures.h" |
| 25 #include "platform/graphics/filters/FilterEffect.h" | 24 #include "core/css/CSSVariableValue.h" |
| 25 #include "core/css/StylePropertySet.h" | |
| 26 #include "core/dom/Element.h" | |
| 26 | 27 |
| 27 namespace WebCore { | 28 namespace WebCore { |
| 28 | 29 |
| 29 class PLATFORM_EXPORT SourceAlpha : public FilterEffect { | 30 PassRefPtr<InlineVariablesIterator> InlineVariablesIterator::create(Element* ele ment) |
| 30 public: | 31 { |
| 31 static PassRefPtr<SourceAlpha> create(Filter*); | 32 ASSERT(RuntimeEnabledFeatures::cssVariablesEnabled()); |
| 33 RefPtr<InlineVariablesIterator> iterator = adoptRef(new InlineVariablesItera tor(element)); | |
| 32 | 34 |
| 33 static const AtomicString& effectName(); | 35 const StylePropertySet* propertySet = element->inlineStyle(); |
|
eseidel
2013/12/23 21:22:43
Shouldn't this be in the constructor itself instea
chrishtr
2013/12/23 22:06:46
Good point. I was following the existing structure
| |
| 36 if (propertySet) { | |
| 37 AbstractVariablesIterator::initRemainingNames(propertySet, iterator.get( )); | |
| 38 } | |
| 39 return iterator.release(); | |
| 40 } | |
| 34 | 41 |
| 35 virtual void determineAbsolutePaintRect(); | |
| 36 | 42 |
| 37 virtual FilterEffectType filterEffectType() const { return FilterEffectTypeS ourceInput; } | 43 MutableStylePropertySet* InlineVariablesIterator::propertySet() const |
| 38 | 44 { |
| 39 virtual TextStream& externalRepresentation(TextStream&, int indention) const ; | 45 return m_element->ensureMutableInlineStyle(); |
| 40 | 46 } |
| 41 private: | |
| 42 SourceAlpha(Filter* filter) | |
| 43 : FilterEffect(filter) | |
| 44 { | |
| 45 } | |
| 46 | |
| 47 virtual void applySoftware() OVERRIDE; | |
| 48 }; | |
| 49 | 47 |
| 50 } // namespace WebCore | 48 } // namespace WebCore |
| 51 | |
| 52 #endif // SourceAlpha_h | |
| OLD | NEW |