caryclark@google.com | d26147a | 2011-12-15 14:16:43 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2011 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
rmistry@google.com | d6176b0 | 2012-08-23 18:14:13 +0000 | [diff] [blame] | 7 | |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 8 | #include "Sk1DPathEffect.h" |
| 9 | #include "Sk2DPathEffect.h" |
halcanary | ba923d3 | 2015-12-07 12:02:33 -0800 | [diff] [blame] | 10 | #include "SkAlphaThresholdFilter.h" |
Robert Phillips | 19c22e9 | 2017-02-10 12:32:08 +0000 | [diff] [blame] | 11 | #include "SkBitmapSourceDeserializer.h" |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 12 | #include "SkBlurImageFilter.h" |
| 13 | #include "SkBlurMaskFilter.h" |
senorblanco@chromium.org | 392e14e | 2012-08-20 19:45:02 +0000 | [diff] [blame] | 14 | #include "SkColorFilterImageFilter.h" |
bsalomon | 8610002 | 2016-02-01 12:09:07 -0800 | [diff] [blame] | 15 | #include "SkColorMatrixFilterRowMajor255.h" |
commit-bot@chromium.org | 1c4c9ef | 2013-08-07 00:07:51 +0000 | [diff] [blame] | 16 | #include "SkComposeImageFilter.h" |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 17 | #include "SkCornerPathEffect.h" |
Mike Reed | 76f7062 | 2017-05-23 23:00:14 -0400 | [diff] [blame] | 18 | #include "../../src/effects/SkDashImpl.h" |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 19 | #include "SkDiscretePathEffect.h" |
sugoi@google.com | 781cc76 | 2013-01-15 15:40:19 +0000 | [diff] [blame] | 20 | #include "SkDisplacementMapEffect.h" |
junov@chromium.org | f44fcdc | 2013-08-07 20:00:55 +0000 | [diff] [blame] | 21 | #include "SkDropShadowImageFilter.h" |
Mike Reed | fd87be8 | 2016-12-07 13:41:57 -0500 | [diff] [blame] | 22 | #include "../../src/effects/SkEmbossMaskFilter.h" |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 23 | #include "SkGradientShader.h" |
Dominic Mazzoni | 394d414 | 2017-02-14 11:15:31 -0800 | [diff] [blame] | 24 | #include "SkHighContrastFilter.h" |
fmalita | cd56f81 | 2015-09-14 13:31:18 -0700 | [diff] [blame] | 25 | #include "SkImageSource.h" |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 26 | #include "SkLayerDrawLooper.h" |
| 27 | #include "SkLayerRasterizer.h" |
djsollen@google.com | 0833777 | 2012-06-26 14:33:13 +0000 | [diff] [blame] | 28 | #include "SkLightingImageFilter.h" |
mtklein | 083b869 | 2016-04-06 12:27:07 -0700 | [diff] [blame] | 29 | #include "SkLocalMatrixImageFilter.h" |
commit-bot@chromium.org | 6c1ee2d | 2013-10-07 18:00:17 +0000 | [diff] [blame] | 30 | #include "SkLumaColorFilter.h" |
senorblanco@chromium.org | 35c5ff0 | 2012-08-22 18:34:16 +0000 | [diff] [blame] | 31 | #include "SkMagnifierImageFilter.h" |
senorblanco@chromium.org | b4ca9df | 2012-09-19 22:50:21 +0000 | [diff] [blame] | 32 | #include "SkMatrixConvolutionImageFilter.h" |
senorblanco@chromium.org | 4a9a612 | 2012-12-04 14:18:50 +0000 | [diff] [blame] | 33 | #include "SkMergeImageFilter.h" |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 34 | #include "SkMorphologyImageFilter.h" |
senorblanco@chromium.org | 4a9a612 | 2012-12-04 14:18:50 +0000 | [diff] [blame] | 35 | #include "SkOffsetImageFilter.h" |
Sadrul Habib Chowdhury | 4189d1b | 2017-08-18 10:20:02 -0400 | [diff] [blame^] | 36 | #include "SkOverdrawColorFilter.h" |
ajuma | 77b6ba3 | 2016-01-08 14:58:35 -0800 | [diff] [blame] | 37 | #include "SkPaintImageFilter.h" |
sugoi@google.com | e3b4c50 | 2013-04-05 13:47:09 +0000 | [diff] [blame] | 38 | #include "SkPerlinNoiseShader.h" |
commit-bot@chromium.org | 9e5f85e | 2014-03-12 14:46:41 +0000 | [diff] [blame] | 39 | #include "SkPictureImageFilter.h" |
Robert Phillips | a2cedff | 2017-03-28 11:59:48 -0400 | [diff] [blame] | 40 | #include "SkRRectsGaussianEdgeMaskFilter.h" |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 41 | #include "SkTableColorFilter.h" |
sugoi@google.com | 0ac74b2 | 2013-09-26 17:03:38 +0000 | [diff] [blame] | 42 | #include "SkTileImageFilter.h" |
Mike Reed | 205c69d | 2017-07-25 11:57:23 -0400 | [diff] [blame] | 43 | #include "SkToSRGBColorFilter.h" |
senorblanco@chromium.org | 86fc266 | 2013-05-31 17:49:12 +0000 | [diff] [blame] | 44 | #include "SkXfermodeImageFilter.h" |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 45 | |
reed | 50b98b4 | 2016-02-03 16:31:35 -0800 | [diff] [blame] | 46 | // Security note: |
| 47 | // |
| 48 | // As new subclasses are added here, they should be reviewed by chrome security before they |
| 49 | // support deserializing cross-process: chrome-security@google.com. SampleFilterFuzz.cpp should |
| 50 | // also be amended to exercise the new subclass. |
| 51 | // |
| 52 | // See SkReadBuffer::isCrossProcess() and SkPicture::PictureIOSecurityPrecautionsEnabled() |
| 53 | // |
| 54 | |
reed | 6054d68 | 2016-01-13 08:47:54 -0800 | [diff] [blame] | 55 | /* |
| 56 | * None of these are strictly "required" for Skia to operate. |
| 57 | * |
| 58 | * These are the bulk of our "effects" -- subclasses of various effects on SkPaint. |
| 59 | * |
| 60 | * Clients should feel free to dup this file and modify it as needed. This function "InitEffects" |
| 61 | * will automatically be called before any of skia's effects are asked to be deserialized. |
| 62 | */ |
| 63 | void SkFlattenable::PrivateInitializer::InitEffects() { |
Robert Phillips | 19c22e9 | 2017-02-10 12:32:08 +0000 | [diff] [blame] | 64 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBitmapSourceDeserializer) |
| 65 | |
reed | 6054d68 | 2016-01-13 08:47:54 -0800 | [diff] [blame] | 66 | // MaskFilter |
| 67 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkEmbossMaskFilter) |
| 68 | SkBlurMaskFilter::InitializeFlattenables(); |
Robert Phillips | a29a956 | 2016-10-20 09:40:55 -0400 | [diff] [blame] | 69 | SkRRectsGaussianEdgeMaskFilter::InitializeFlattenables(); |
djsollen@google.com | 5370cd9 | 2012-03-28 20:47:01 +0000 | [diff] [blame] | 70 | |
reed | 6054d68 | 2016-01-13 08:47:54 -0800 | [diff] [blame] | 71 | // DrawLooper |
reed | 6054d68 | 2016-01-13 08:47:54 -0800 | [diff] [blame] | 72 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLayerDrawLooper) |
commit-bot@chromium.org | c0b7e10 | 2013-10-23 17:06:21 +0000 | [diff] [blame] | 73 | |
reed | 6054d68 | 2016-01-13 08:47:54 -0800 | [diff] [blame] | 74 | // Rasterizer |
| 75 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLayerRasterizer) |
| 76 | |
| 77 | // ColorFilter |
bsalomon | 8610002 | 2016-02-01 12:09:07 -0800 | [diff] [blame] | 78 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColorMatrixFilterRowMajor255) |
reed | 6054d68 | 2016-01-13 08:47:54 -0800 | [diff] [blame] | 79 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLumaColorFilter) |
Mike Reed | 205c69d | 2017-07-25 11:57:23 -0400 | [diff] [blame] | 80 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkToSRGBColorFilter) |
reed | 6054d68 | 2016-01-13 08:47:54 -0800 | [diff] [blame] | 81 | SkAlphaThresholdFilter::InitializeFlattenables(); |
reed | 6054d68 | 2016-01-13 08:47:54 -0800 | [diff] [blame] | 82 | SkTableColorFilter::InitializeFlattenables(); |
Matt Sarett | 030cbd5 | 2016-11-22 15:48:50 -0500 | [diff] [blame] | 83 | SkOverdrawColorFilter::InitializeFlattenables(); |
Dominic Mazzoni | 394d414 | 2017-02-14 11:15:31 -0800 | [diff] [blame] | 84 | SkHighContrastFilter::InitializeFlattenables(); |
reed | 6054d68 | 2016-01-13 08:47:54 -0800 | [diff] [blame] | 85 | |
| 86 | // Shader |
Florin Malita | 14d54c2 | 2017-05-18 11:52:59 -0400 | [diff] [blame] | 87 | SkPerlinNoiseShader::InitializeFlattenables(); |
reed | 6054d68 | 2016-01-13 08:47:54 -0800 | [diff] [blame] | 88 | SkGradientShader::InitializeFlattenables(); |
reed | 6054d68 | 2016-01-13 08:47:54 -0800 | [diff] [blame] | 89 | |
reed | 6054d68 | 2016-01-13 08:47:54 -0800 | [diff] [blame] | 90 | // PathEffect |
reed | 6054d68 | 2016-01-13 08:47:54 -0800 | [diff] [blame] | 91 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkCornerPathEffect) |
Mike Reed | 76f7062 | 2017-05-23 23:00:14 -0400 | [diff] [blame] | 92 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDashImpl) |
reed | 6054d68 | 2016-01-13 08:47:54 -0800 | [diff] [blame] | 93 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiscretePathEffect) |
| 94 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPath1DPathEffect) |
| 95 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLine2DPathEffect) |
| 96 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPath2DPathEffect) |
reed | 6054d68 | 2016-01-13 08:47:54 -0800 | [diff] [blame] | 97 | |
| 98 | // ImageFilter |
vjiaoblack | e1e5c74 | 2016-08-23 11:13:14 -0700 | [diff] [blame] | 99 | SkImageFilter::InitializeFlattenables(); |
Brian Salomon | 89cb821 | 2017-01-09 10:48:23 -0500 | [diff] [blame] | 100 | SkArithmeticImageFilter::InitializeFlattenables(); |
Mike Reed | 667a007 | 2016-09-23 11:43:54 -0400 | [diff] [blame] | 101 | SkXfermodeImageFilter::InitializeFlattenables(); |
reed | 6054d68 | 2016-01-13 08:47:54 -0800 | [diff] [blame] | 102 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDilateImageFilter) |
| 103 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDisplacementMapEffect) |
| 104 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDropShadowImageFilter) |
| 105 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkErodeImageFilter) |
| 106 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkImageSource) |
mtklein | 083b869 | 2016-04-06 12:27:07 -0700 | [diff] [blame] | 107 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLocalMatrixImageFilter) |
reed | 6054d68 | 2016-01-13 08:47:54 -0800 | [diff] [blame] | 108 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPaintImageFilter) |
| 109 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPictureImageFilter) |
| 110 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkTileImageFilter) |
reed | 6054d68 | 2016-01-13 08:47:54 -0800 | [diff] [blame] | 111 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkMagnifierImageFilter) |
| 112 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkMatrixConvolutionImageFilter) |
| 113 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkOffsetImageFilter) |
| 114 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkComposeImageFilter) |
| 115 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkMergeImageFilter) |
| 116 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColorFilterImageFilter) |
reed | 6054d68 | 2016-01-13 08:47:54 -0800 | [diff] [blame] | 117 | SkLightingImageFilter::InitializeFlattenables(); |
commit-bot@chromium.org | c0b7e10 | 2013-10-23 17:06:21 +0000 | [diff] [blame] | 118 | } |