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

Side by Side Diff: Source/core/svg/SVGEnumeration.cpp

Issue 447193002: Add support for additional blend modes to SVGFEBlendElement (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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
« no previous file with comments | « Source/core/svg/SVGEnumeration.h ('k') | Source/core/svg/SVGFEBlendElement.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2014 Google Inc. All rights reserved. 2 * Copyright (C) 2014 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 String SVGEnumerationBase::valueAsString() const 60 String SVGEnumerationBase::valueAsString() const
61 { 61 {
62 StringEntries::const_iterator it = m_entries.begin(); 62 StringEntries::const_iterator it = m_entries.begin();
63 StringEntries::const_iterator itEnd = m_entries.end(); 63 StringEntries::const_iterator itEnd = m_entries.end();
64 for (; it != itEnd; ++it) { 64 for (; it != itEnd; ++it) {
65 if (m_value == it->first) 65 if (m_value == it->first)
66 return it->second; 66 return it->second;
67 } 67 }
68 68
69 ASSERT(m_value < maxEnumValue()); 69 ASSERT(m_value < maxInternalEnumValue());
70 return emptyString(); 70 return emptyString();
71 } 71 }
72 72
73 void SVGEnumerationBase::setValue(unsigned short value, ExceptionState& exceptio nState) 73 void SVGEnumerationBase::setValue(unsigned short value, ExceptionState& exceptio nState)
74 { 74 {
75 if (!value) { 75 if (!value) {
76 exceptionState.throwTypeError("The enumeration value provided is 0, whic h is not settable."); 76 exceptionState.throwTypeError("The enumeration value provided is 0, whic h is not settable.");
77 return; 77 return;
78 } 78 }
79 79
80 if (value > maxEnumValue()) { 80 if (value > maxExposedEnumValue()) {
81 exceptionState.throwTypeError("The enumeration value provided (" + Strin g::number(value) + ") is larger than the largest allowed value (" + String::numb er(maxEnumValue()) + ")."); 81 exceptionState.throwTypeError("The enumeration value provided (" + Strin g::number(value) + ") is larger than the largest allowed value (" + String::numb er(maxExposedEnumValue()) + ").");
82 return; 82 return;
83 } 83 }
84 84
85 m_value = value; 85 m_value = value;
86 notifyChange(); 86 notifyChange();
87 } 87 }
88 88
89 void SVGEnumerationBase::setValueAsString(const String& string, ExceptionState& exceptionState) 89 void SVGEnumerationBase::setValueAsString(const String& string, ExceptionState& exceptionState)
90 { 90 {
91 StringEntries::const_iterator it = m_entries.begin(); 91 StringEntries::const_iterator it = m_entries.begin();
(...skipping 26 matching lines...) Expand all
118 animationElement->animateDiscreteType<unsigned short>(percentage, fromEnumer ation, toEnumeration, m_value); 118 animationElement->animateDiscreteType<unsigned short>(percentage, fromEnumer ation, toEnumeration, m_value);
119 } 119 }
120 120
121 float SVGEnumerationBase::calculateDistance(PassRefPtr<SVGPropertyBase>, SVGElem ent*) 121 float SVGEnumerationBase::calculateDistance(PassRefPtr<SVGPropertyBase>, SVGElem ent*)
122 { 122 {
123 // No paced animations for boolean. 123 // No paced animations for boolean.
124 return -1; 124 return -1;
125 } 125 }
126 126
127 } 127 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGEnumeration.h ('k') | Source/core/svg/SVGFEBlendElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698