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

Unified Diff: Source/core/css/resolver/FilterOperationResolver.cpp

Issue 24932003: Use DEFINE_CSS_VALUE_TYPE_CASTS instead of using manual type cast function for CSSShaderValue (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/CSSValue.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/FilterOperationResolver.cpp
diff --git a/Source/core/css/resolver/FilterOperationResolver.cpp b/Source/core/css/resolver/FilterOperationResolver.cpp
index 39d0f95001ba6714fcb0da62395bcda6bbb3e54a..d389ca2dddff1b45092e769b125e7a813912086b 100644
--- a/Source/core/css/resolver/FilterOperationResolver.cpp
+++ b/Source/core/css/resolver/FilterOperationResolver.cpp
@@ -102,8 +102,8 @@ static StyleShader* cachedOrPendingStyleShaderFromValue(CSSShaderValue* value, S
static StyleShader* styleShader(CSSValue* value, StyleResolverState& state)
{
- if (value->isCSSShaderValue())
- return cachedOrPendingStyleShaderFromValue(static_cast<CSSShaderValue*>(value), state);
+ if (value->isShaderValue())
+ return cachedOrPendingStyleShaderFromValue(toCSSShaderValue(value), state);
return 0;
}
@@ -252,8 +252,12 @@ static PassRefPtr<CustomFilterOperation> createCustomFilterOperationWithInlineSy
unsigned shadersListLength = shadersList->length();
ASSERT(shadersListLength);
- CSSShaderValue* vertexShader = toCSSShaderValue(shadersList->itemWithoutBoundsCheck(0));
+ CSSShaderValue* vertexShader = 0;
CSSShaderValue* fragmentShader = 0;
+
+ if (shadersList->itemWithoutBoundsCheck(0)->isShaderValue())
+ vertexShader = toCSSShaderValue(shadersList->itemWithoutBoundsCheck(0));
+
CustomFilterProgramType programType = PROGRAM_TYPE_BLENDS_ELEMENT_TEXTURE;
CustomFilterProgramMixSettings mixSettings;
@@ -264,7 +268,9 @@ static PassRefPtr<CustomFilterOperation> createCustomFilterOperationWithInlineSy
CSSValueListIterator iterator(mixFunction);
ASSERT(mixFunction->length());
- fragmentShader = toCSSShaderValue(iterator.value());
+ if (iterator.value()->isShaderValue())
+ fragmentShader = toCSSShaderValue(iterator.value());
+
iterator.advance();
ASSERT(mixFunction->length() <= 3);
@@ -280,7 +286,8 @@ static PassRefPtr<CustomFilterOperation> createCustomFilterOperationWithInlineSy
}
} else {
programType = PROGRAM_TYPE_NO_ELEMENT_TEXTURE;
- fragmentShader = toCSSShaderValue(fragmentShaderOrMixFunction);
+ if (fragmentShaderOrMixFunction->isShaderValue())
+ fragmentShader = toCSSShaderValue(fragmentShaderOrMixFunction);
}
}
« no previous file with comments | « Source/core/css/CSSValue.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698