blob: f5b53709236e17818e8638ae1730e33a4ae7b140 [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
Mike Klein6ed2a382018-10-20 07:57:07 -04008#include "../../src/effects/SkDashImpl.h"
9#include "../../src/effects/SkEmbossMaskFilter.h"
10#include "../../src/effects/SkOpPE.h"
11#include "../../src/effects/SkTrimPE.h"
djsollen@google.coma2ca41e2012-03-23 19:00:34 +000012#include "Sk1DPathEffect.h"
13#include "Sk2DPathEffect.h"
Mike Klein6ed2a382018-10-20 07:57:07 -040014#include "SkBitmapProcShader.h"
15#include "SkColorFilter.h"
16#include "SkColorFilterShader.h"
bsalomon86100022016-02-01 12:09:07 -080017#include "SkColorMatrixFilterRowMajor255.h"
Mike Klein6ed2a382018-10-20 07:57:07 -040018#include "SkColorShader.h"
19#include "SkComposeShader.h"
djsollen@google.coma2ca41e2012-03-23 19:00:34 +000020#include "SkCornerPathEffect.h"
djsollen@google.coma2ca41e2012-03-23 19:00:34 +000021#include "SkDiscretePathEffect.h"
Mike Klein6ed2a382018-10-20 07:57:07 -040022#include "SkEmptyShader.h"
djsollen@google.coma2ca41e2012-03-23 19:00:34 +000023#include "SkGradientShader.h"
Dominic Mazzoni394d4142017-02-14 11:15:31 -080024#include "SkHighContrastFilter.h"
Mike Klein6ed2a382018-10-20 07:57:07 -040025#include "SkImageShader.h"
djsollen@google.coma2ca41e2012-03-23 19:00:34 +000026#include "SkLayerDrawLooper.h"
Robert Phillipsa8cdbd72018-07-17 12:30:40 -040027#include "SkLightingShader.h"
Mike Klein6ed2a382018-10-20 07:57:07 -040028#include "SkLocalMatrixShader.h"
commit-bot@chromium.org6c1ee2d2013-10-07 18:00:17 +000029#include "SkLumaColorFilter.h"
Robert Phillipsa8cdbd72018-07-17 12:30:40 -040030#include "SkNormalSource.h"
Sadrul Habib Chowdhury4189d1b2017-08-18 10:20:02 -040031#include "SkOverdrawColorFilter.h"
Mike Klein6ed2a382018-10-20 07:57:07 -040032#include "SkPathEffect.h"
sugoi@google.come3b4c502013-04-05 13:47:09 +000033#include "SkPerlinNoiseShader.h"
Mike Klein6ed2a382018-10-20 07:57:07 -040034#include "SkPictureShader.h"
35#include "SkRecordedDrawable.h"
36#include "SkShaderBase.h"
Mike Reed6e87eee2018-01-18 16:06:54 -050037#include "SkShaderMaskFilter.h"
djsollen@google.coma2ca41e2012-03-23 19:00:34 +000038#include "SkTableColorFilter.h"
Mike Reed205c69d2017-07-25 11:57:23 -040039#include "SkToSRGBColorFilter.h"
reed50b98b42016-02-03 16:31:35 -080040
reed6054d682016-01-13 08:47:54 -080041/*
Mike Klein6ed2a382018-10-20 07:57:07 -040042 * Register most effects for deserialization.
reed6054d682016-01-13 08:47:54 -080043 *
Mike Klein6ed2a382018-10-20 07:57:07 -040044 * None of these are strictly required for Skia to operate,
45 * so if you're not using deserialization yourself, you can
46 * build and link SkGlobalInitialization_none.cpp instead,
47 * or modify/replace this file as needed.
reed6054d682016-01-13 08:47:54 -080048 */
49void SkFlattenable::PrivateInitializer::InitEffects() {
Mike Klein6ed2a382018-10-20 07:57:07 -040050 // Shaders.
51 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColor4Shader)
52 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColorFilterShader)
53 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColorShader)
54 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkComposeShader)
55 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkEmptyShader)
56 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLocalMatrixShader)
57 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPictureShader)
58 SkGradientShader::InitializeFlattenables();
59 SkLightingShader::InitializeFlattenables();
60 SkPerlinNoiseShader::InitializeFlattenables();
61 SkShaderBase::InitializeFlattenables();
djsollen@google.com5370cd92012-03-28 20:47:01 +000062
Mike Klein6ed2a382018-10-20 07:57:07 -040063 // Color filters.
bsalomon86100022016-02-01 12:09:07 -080064 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColorMatrixFilterRowMajor255)
reed6054d682016-01-13 08:47:54 -080065 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLumaColorFilter)
Mike Reed205c69d2017-07-25 11:57:23 -040066 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkToSRGBColorFilter)
Mike Klein6ed2a382018-10-20 07:57:07 -040067 SkColorFilter::InitializeFlattenables();
Dominic Mazzoni394d4142017-02-14 11:15:31 -080068 SkHighContrastFilter::InitializeFlattenables();
Mike Klein6ed2a382018-10-20 07:57:07 -040069 SkOverdrawColorFilter::InitializeFlattenables();
70 SkTableColorFilter::InitializeFlattenables();
reed6054d682016-01-13 08:47:54 -080071
Mike Klein6ed2a382018-10-20 07:57:07 -040072 // Mask filters.
73 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkEmbossMaskFilter)
74 SkMaskFilter::InitializeFlattenables();
75 SkShaderMaskFilter::InitializeFlattenables();
reed6054d682016-01-13 08:47:54 -080076
Mike Klein6ed2a382018-10-20 07:57:07 -040077 // Path effects.
reed6054d682016-01-13 08:47:54 -080078 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkCornerPathEffect)
Mike Reed76f70622017-05-23 23:00:14 -040079 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDashImpl)
reed6054d682016-01-13 08:47:54 -080080 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiscretePathEffect)
reed6054d682016-01-13 08:47:54 -080081 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLine2DPathEffect)
Mike Reed0ef539a2018-07-18 13:28:42 -040082 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkMatrixPE)
Mike Klein6ed2a382018-10-20 07:57:07 -040083 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkOpPE)
84 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPath1DPathEffect)
85 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPath2DPathEffect)
Mike Reed0ef539a2018-07-18 13:28:42 -040086 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkStrokePE)
Mike Klein6ed2a382018-10-20 07:57:07 -040087 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkTrimPE)
88 SkPathEffect::InitializeFlattenables();
89
90 // Misc.
91 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLayerDrawLooper)
92 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkRecordedDrawable)
93 SkNormalSource::InitializeFlattenables();
commit-bot@chromium.orgc0b7e102013-10-23 17:06:21 +000094}