return null if subshader fails

TBR=scroggo@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/279573002

git-svn-id: http://skia.googlecode.com/svn/trunk@14656 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
commit-bot@chromium.org 2014-05-08 19:22:52 +00:00
parent 888e4687d9
commit a69bda8d3c

View File

@ -58,8 +58,9 @@ uint32_t SkFilterShader::FilterShaderContext::getFlags() const {
SkShader::Context* SkFilterShader::onCreateContext(const ContextRec& rec, void* storage) const {
char* shaderContextStorage = (char*)storage + sizeof(FilterShaderContext);
SkShader::Context* shaderContext = fShader->createContext(rec, shaderContextStorage);
SkASSERT(shaderContext);
if (NULL == shaderContext) {
return NULL;
}
return SkNEW_PLACEMENT_ARGS(storage, FilterShaderContext, (*this, shaderContext, rec));
}