diff options
author | 2014-12-01 10:56:05 -0800 | |
---|---|---|
committer | 2014-12-01 10:56:05 -0800 | |
commit | 6e78293ee896020104ffc4c23b565073e9a49893 (patch) | |
tree | ddbfc5b976c891adf2e318008043a76e9c4a7f8d /src/effects/SkColorFilterImageFilter.cpp | |
parent | 52c293547b973f7fb5de3c83f5062b07d759ab88 (diff) |
Revert of Remove SK_SUPPORT_LEGACY_DEEPFLATTENING. (patchset #1 id:1 of https://codereview.chromium.org/769953002/)
Reason for revert:
Breaks canary builds. Will reland after the Chromium change lands.
Original issue's description:
> Remove SK_SUPPORT_LEGACY_DEEPFLATTENING.
>
> This was needed for pictures before v33, and we're now requiring v35+.
>
> Will follow up with the same for skia/ext/pixel_ref_utils_unittest.cc
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/52c293547b973f7fb5de3c83f5062b07d759ab88
TBR=reed@google.com,mtklein@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:
Review URL: https://codereview.chromium.org/768183002
Diffstat (limited to 'src/effects/SkColorFilterImageFilter.cpp')
-rwxr-xr-x | src/effects/SkColorFilterImageFilter.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/effects/SkColorFilterImageFilter.cpp b/src/effects/SkColorFilterImageFilter.cpp index 10976d77f0..012f1329a4 100755 --- a/src/effects/SkColorFilterImageFilter.cpp +++ b/src/effects/SkColorFilterImageFilter.cpp @@ -84,6 +84,21 @@ SkColorFilterImageFilter::SkColorFilterImageFilter(SkColorFilter* cf, : INHERITED(1, &input, cropRect, uniqueID), fColorFilter(SkRef(cf)) { } +#ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING +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 + SkFlattenable* SkColorFilterImageFilter::CreateProc(SkReadBuffer& buffer) { SK_IMAGEFILTER_UNFLATTEN_COMMON(common, 1); SkAutoTUnref<SkColorFilter> cf(buffer.readColorFilter()); |