notice null colorfilter in legacy unflattening
BUG=skia:3117 Review URL: https://codereview.chromium.org/691383003
This commit is contained in:
parent
f539b8cdee
commit
b969fc0f83
@ -85,9 +85,17 @@ SkColorFilterImageFilter::SkColorFilterImageFilter(SkColorFilter* cf,
|
||||
}
|
||||
|
||||
#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
|
||||
SkColorFilterImageFilter::SkColorFilterImageFilter(SkReadBuffer& buffer)
|
||||
: INHERITED(1, buffer) {
|
||||
SkColorFilterImageFilter::SkColorFilterImageFilter(SkReadBuffer& buffer) : INHERITED(1, buffer) {
|
||||
fColorFilter = buffer.readColorFilter();
|
||||
// we aren't prepared for this to be NULL, and it can't ever be when we're NOT supporting
|
||||
// SK_SUPPORT_LEGACY_DEEPFLATTENING, as we always go through a factory which can detect
|
||||
// NULL. However, since here we're in the legacy code, we assign a dummy filter so we
|
||||
// don't crash with a null-ptr.
|
||||
if (NULL == fColorFilter) {
|
||||
// colormatrix identity is effectively a no-op
|
||||
fColorFilter = SkColorMatrixFilter::Create(SkColorMatrix());
|
||||
SkASSERT(fColorFilter);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user