blob: 52ef365ea2de118352601a249fa79355bdf9196c [file] [log] [blame]
caryclark@google.comd26147a2011-12-15 14:16:43 +00001/*
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.comd6176b02012-08-23 18:14:13 +00007
djsollen@google.coma2ca41e2012-03-23 19:00:34 +00008#include "Sk1DPathEffect.h"
9#include "Sk2DPathEffect.h"
halcanaryba923d32015-12-07 12:02:33 -080010#include "SkAlphaThresholdFilter.h"
Robert Phillips19c22e92017-02-10 12:32:08 +000011#include "SkBitmapSourceDeserializer.h"
djsollen@google.coma2ca41e2012-03-23 19:00:34 +000012#include "SkBlurImageFilter.h"
13#include "SkBlurMaskFilter.h"
senorblanco@chromium.org392e14e2012-08-20 19:45:02 +000014#include "SkColorFilterImageFilter.h"
bsalomon86100022016-02-01 12:09:07 -080015#include "SkColorMatrixFilterRowMajor255.h"
commit-bot@chromium.org1c4c9ef2013-08-07 00:07:51 +000016#include "SkComposeImageFilter.h"
djsollen@google.coma2ca41e2012-03-23 19:00:34 +000017#include "SkCornerPathEffect.h"
Mike Reed76f70622017-05-23 23:00:14 -040018#include "../../src/effects/SkDashImpl.h"
djsollen@google.coma2ca41e2012-03-23 19:00:34 +000019#include "SkDiscretePathEffect.h"
sugoi@google.com781cc762013-01-15 15:40:19 +000020#include "SkDisplacementMapEffect.h"
junov@chromium.orgf44fcdc2013-08-07 20:00:55 +000021#include "SkDropShadowImageFilter.h"
Mike Reedfd87be82016-12-07 13:41:57 -050022#include "../../src/effects/SkEmbossMaskFilter.h"
djsollen@google.coma2ca41e2012-03-23 19:00:34 +000023#include "SkGradientShader.h"
Dominic Mazzoni394d4142017-02-14 11:15:31 -080024#include "SkHighContrastFilter.h"
fmalitacd56f812015-09-14 13:31:18 -070025#include "SkImageSource.h"
djsollen@google.coma2ca41e2012-03-23 19:00:34 +000026#include "SkLayerDrawLooper.h"
27#include "SkLayerRasterizer.h"
djsollen@google.com08337772012-06-26 14:33:13 +000028#include "SkLightingImageFilter.h"
mtklein083b8692016-04-06 12:27:07 -070029#include "SkLocalMatrixImageFilter.h"
commit-bot@chromium.org6c1ee2d2013-10-07 18:00:17 +000030#include "SkLumaColorFilter.h"
senorblanco@chromium.org35c5ff02012-08-22 18:34:16 +000031#include "SkMagnifierImageFilter.h"
senorblanco@chromium.orgb4ca9df2012-09-19 22:50:21 +000032#include "SkMatrixConvolutionImageFilter.h"
senorblanco@chromium.org4a9a6122012-12-04 14:18:50 +000033#include "SkMergeImageFilter.h"
djsollen@google.coma2ca41e2012-03-23 19:00:34 +000034#include "SkMorphologyImageFilter.h"
senorblanco@chromium.org4a9a6122012-12-04 14:18:50 +000035#include "SkOffsetImageFilter.h"
Sadrul Habib Chowdhury4189d1b2017-08-18 10:20:02 -040036#include "SkOverdrawColorFilter.h"
ajuma77b6ba32016-01-08 14:58:35 -080037#include "SkPaintImageFilter.h"
sugoi@google.come3b4c502013-04-05 13:47:09 +000038#include "SkPerlinNoiseShader.h"
commit-bot@chromium.org9e5f85e2014-03-12 14:46:41 +000039#include "SkPictureImageFilter.h"
Robert Phillipsa2cedff2017-03-28 11:59:48 -040040#include "SkRRectsGaussianEdgeMaskFilter.h"
djsollen@google.coma2ca41e2012-03-23 19:00:34 +000041#include "SkTableColorFilter.h"
sugoi@google.com0ac74b22013-09-26 17:03:38 +000042#include "SkTileImageFilter.h"
Mike Reed205c69d2017-07-25 11:57:23 -040043#include "SkToSRGBColorFilter.h"
senorblanco@chromium.org86fc2662013-05-31 17:49:12 +000044#include "SkXfermodeImageFilter.h"
djsollen@google.coma2ca41e2012-03-23 19:00:34 +000045
reed50b98b42016-02-03 16:31:35 -080046// 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
reed6054d682016-01-13 08:47:54 -080055/*
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 */
63void SkFlattenable::PrivateInitializer::InitEffects() {
Robert Phillips19c22e92017-02-10 12:32:08 +000064 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBitmapSourceDeserializer)
65
reed6054d682016-01-13 08:47:54 -080066 // MaskFilter
67 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkEmbossMaskFilter)
68 SkBlurMaskFilter::InitializeFlattenables();
Robert Phillipsa29a9562016-10-20 09:40:55 -040069 SkRRectsGaussianEdgeMaskFilter::InitializeFlattenables();
djsollen@google.com5370cd92012-03-28 20:47:01 +000070
reed6054d682016-01-13 08:47:54 -080071 // DrawLooper
reed6054d682016-01-13 08:47:54 -080072 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLayerDrawLooper)
commit-bot@chromium.orgc0b7e102013-10-23 17:06:21 +000073
reed6054d682016-01-13 08:47:54 -080074 // Rasterizer
75 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLayerRasterizer)
76
77 // ColorFilter
bsalomon86100022016-02-01 12:09:07 -080078 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColorMatrixFilterRowMajor255)
reed6054d682016-01-13 08:47:54 -080079 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLumaColorFilter)
Mike Reed205c69d2017-07-25 11:57:23 -040080 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkToSRGBColorFilter)
reed6054d682016-01-13 08:47:54 -080081 SkAlphaThresholdFilter::InitializeFlattenables();
reed6054d682016-01-13 08:47:54 -080082 SkTableColorFilter::InitializeFlattenables();
Matt Sarett030cbd52016-11-22 15:48:50 -050083 SkOverdrawColorFilter::InitializeFlattenables();
Dominic Mazzoni394d4142017-02-14 11:15:31 -080084 SkHighContrastFilter::InitializeFlattenables();
reed6054d682016-01-13 08:47:54 -080085
86 // Shader
Florin Malita14d54c22017-05-18 11:52:59 -040087 SkPerlinNoiseShader::InitializeFlattenables();
reed6054d682016-01-13 08:47:54 -080088 SkGradientShader::InitializeFlattenables();
reed6054d682016-01-13 08:47:54 -080089
reed6054d682016-01-13 08:47:54 -080090 // PathEffect
reed6054d682016-01-13 08:47:54 -080091 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkCornerPathEffect)
Mike Reed76f70622017-05-23 23:00:14 -040092 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDashImpl)
reed6054d682016-01-13 08:47:54 -080093 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)
reed6054d682016-01-13 08:47:54 -080097
98 // ImageFilter
vjiaoblacke1e5c742016-08-23 11:13:14 -070099 SkImageFilter::InitializeFlattenables();
Brian Salomon89cb8212017-01-09 10:48:23 -0500100 SkArithmeticImageFilter::InitializeFlattenables();
Mike Reed667a0072016-09-23 11:43:54 -0400101 SkXfermodeImageFilter::InitializeFlattenables();
reed6054d682016-01-13 08:47:54 -0800102 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)
mtklein083b8692016-04-06 12:27:07 -0700107 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLocalMatrixImageFilter)
reed6054d682016-01-13 08:47:54 -0800108 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPaintImageFilter)
109 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPictureImageFilter)
110 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkTileImageFilter)
reed6054d682016-01-13 08:47:54 -0800111 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)
reed6054d682016-01-13 08:47:54 -0800117 SkLightingImageFilter::InitializeFlattenables();
commit-bot@chromium.orgc0b7e102013-10-23 17:06:21 +0000118}