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 | |
Mike Klein | 6ed2a38 | 2018-10-20 07:57:07 -0400 | [diff] [blame^] | 8 | #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.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 12 | #include "Sk1DPathEffect.h" |
| 13 | #include "Sk2DPathEffect.h" |
Mike Klein | 6ed2a38 | 2018-10-20 07:57:07 -0400 | [diff] [blame^] | 14 | #include "SkBitmapProcShader.h" |
| 15 | #include "SkColorFilter.h" |
| 16 | #include "SkColorFilterShader.h" |
bsalomon | 8610002 | 2016-02-01 12:09:07 -0800 | [diff] [blame] | 17 | #include "SkColorMatrixFilterRowMajor255.h" |
Mike Klein | 6ed2a38 | 2018-10-20 07:57:07 -0400 | [diff] [blame^] | 18 | #include "SkColorShader.h" |
| 19 | #include "SkComposeShader.h" |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 20 | #include "SkCornerPathEffect.h" |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 21 | #include "SkDiscretePathEffect.h" |
Mike Klein | 6ed2a38 | 2018-10-20 07:57:07 -0400 | [diff] [blame^] | 22 | #include "SkEmptyShader.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" |
Mike Klein | 6ed2a38 | 2018-10-20 07:57:07 -0400 | [diff] [blame^] | 25 | #include "SkImageShader.h" |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 26 | #include "SkLayerDrawLooper.h" |
Robert Phillips | a8cdbd7 | 2018-07-17 12:30:40 -0400 | [diff] [blame] | 27 | #include "SkLightingShader.h" |
Mike Klein | 6ed2a38 | 2018-10-20 07:57:07 -0400 | [diff] [blame^] | 28 | #include "SkLocalMatrixShader.h" |
commit-bot@chromium.org | 6c1ee2d | 2013-10-07 18:00:17 +0000 | [diff] [blame] | 29 | #include "SkLumaColorFilter.h" |
Robert Phillips | a8cdbd7 | 2018-07-17 12:30:40 -0400 | [diff] [blame] | 30 | #include "SkNormalSource.h" |
Sadrul Habib Chowdhury | 4189d1b | 2017-08-18 10:20:02 -0400 | [diff] [blame] | 31 | #include "SkOverdrawColorFilter.h" |
Mike Klein | 6ed2a38 | 2018-10-20 07:57:07 -0400 | [diff] [blame^] | 32 | #include "SkPathEffect.h" |
sugoi@google.com | e3b4c50 | 2013-04-05 13:47:09 +0000 | [diff] [blame] | 33 | #include "SkPerlinNoiseShader.h" |
Mike Klein | 6ed2a38 | 2018-10-20 07:57:07 -0400 | [diff] [blame^] | 34 | #include "SkPictureShader.h" |
| 35 | #include "SkRecordedDrawable.h" |
| 36 | #include "SkShaderBase.h" |
Mike Reed | 6e87eee | 2018-01-18 16:06:54 -0500 | [diff] [blame] | 37 | #include "SkShaderMaskFilter.h" |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 38 | #include "SkTableColorFilter.h" |
Mike Reed | 205c69d | 2017-07-25 11:57:23 -0400 | [diff] [blame] | 39 | #include "SkToSRGBColorFilter.h" |
reed | 50b98b4 | 2016-02-03 16:31:35 -0800 | [diff] [blame] | 40 | |
reed | 6054d68 | 2016-01-13 08:47:54 -0800 | [diff] [blame] | 41 | /* |
Mike Klein | 6ed2a38 | 2018-10-20 07:57:07 -0400 | [diff] [blame^] | 42 | * Register most effects for deserialization. |
reed | 6054d68 | 2016-01-13 08:47:54 -0800 | [diff] [blame] | 43 | * |
Mike Klein | 6ed2a38 | 2018-10-20 07:57:07 -0400 | [diff] [blame^] | 44 | * 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. |
reed | 6054d68 | 2016-01-13 08:47:54 -0800 | [diff] [blame] | 48 | */ |
| 49 | void SkFlattenable::PrivateInitializer::InitEffects() { |
Mike Klein | 6ed2a38 | 2018-10-20 07:57:07 -0400 | [diff] [blame^] | 50 | // 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.com | 5370cd9 | 2012-03-28 20:47:01 +0000 | [diff] [blame] | 62 | |
Mike Klein | 6ed2a38 | 2018-10-20 07:57:07 -0400 | [diff] [blame^] | 63 | // Color filters. |
bsalomon | 8610002 | 2016-02-01 12:09:07 -0800 | [diff] [blame] | 64 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColorMatrixFilterRowMajor255) |
reed | 6054d68 | 2016-01-13 08:47:54 -0800 | [diff] [blame] | 65 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLumaColorFilter) |
Mike Reed | 205c69d | 2017-07-25 11:57:23 -0400 | [diff] [blame] | 66 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkToSRGBColorFilter) |
Mike Klein | 6ed2a38 | 2018-10-20 07:57:07 -0400 | [diff] [blame^] | 67 | SkColorFilter::InitializeFlattenables(); |
Dominic Mazzoni | 394d414 | 2017-02-14 11:15:31 -0800 | [diff] [blame] | 68 | SkHighContrastFilter::InitializeFlattenables(); |
Mike Klein | 6ed2a38 | 2018-10-20 07:57:07 -0400 | [diff] [blame^] | 69 | SkOverdrawColorFilter::InitializeFlattenables(); |
| 70 | SkTableColorFilter::InitializeFlattenables(); |
reed | 6054d68 | 2016-01-13 08:47:54 -0800 | [diff] [blame] | 71 | |
Mike Klein | 6ed2a38 | 2018-10-20 07:57:07 -0400 | [diff] [blame^] | 72 | // Mask filters. |
| 73 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkEmbossMaskFilter) |
| 74 | SkMaskFilter::InitializeFlattenables(); |
| 75 | SkShaderMaskFilter::InitializeFlattenables(); |
reed | 6054d68 | 2016-01-13 08:47:54 -0800 | [diff] [blame] | 76 | |
Mike Klein | 6ed2a38 | 2018-10-20 07:57:07 -0400 | [diff] [blame^] | 77 | // Path effects. |
reed | 6054d68 | 2016-01-13 08:47:54 -0800 | [diff] [blame] | 78 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkCornerPathEffect) |
Mike Reed | 76f7062 | 2017-05-23 23:00:14 -0400 | [diff] [blame] | 79 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDashImpl) |
reed | 6054d68 | 2016-01-13 08:47:54 -0800 | [diff] [blame] | 80 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiscretePathEffect) |
reed | 6054d68 | 2016-01-13 08:47:54 -0800 | [diff] [blame] | 81 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLine2DPathEffect) |
Mike Reed | 0ef539a | 2018-07-18 13:28:42 -0400 | [diff] [blame] | 82 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkMatrixPE) |
Mike Klein | 6ed2a38 | 2018-10-20 07:57:07 -0400 | [diff] [blame^] | 83 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkOpPE) |
| 84 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPath1DPathEffect) |
| 85 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPath2DPathEffect) |
Mike Reed | 0ef539a | 2018-07-18 13:28:42 -0400 | [diff] [blame] | 86 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkStrokePE) |
Mike Klein | 6ed2a38 | 2018-10-20 07:57:07 -0400 | [diff] [blame^] | 87 | 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.org | c0b7e10 | 2013-10-23 17:06:21 +0000 | [diff] [blame] | 94 | } |