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 */ 7 8 #include "include/core/SkFlattenable.h" 9 10 #if defined(SK_DISABLE_EFFECT_DESERIALIZATION) 11 InitEffects()12 void SkFlattenable::PrivateInitializer::InitEffects() {} InitImageFilters()13 void SkFlattenable::PrivateInitializer::InitImageFilters() {} 14 15 #else 16 17 #include "include/core/SkColorFilter.h" 18 #include "include/core/SkPathEffect.h" 19 #include "include/effects/Sk1DPathEffect.h" 20 #include "include/effects/Sk2DPathEffect.h" 21 #include "include/effects/SkCornerPathEffect.h" 22 #include "include/effects/SkDiscretePathEffect.h" 23 #include "include/effects/SkGradientShader.h" 24 #include "include/effects/SkHighContrastFilter.h" 25 #include "include/effects/SkLayerDrawLooper.h" 26 #include "include/effects/SkLumaColorFilter.h" 27 #include "include/effects/SkOverdrawColorFilter.h" 28 #include "include/effects/SkPerlinNoiseShader.h" 29 #include "include/effects/SkShaderMaskFilter.h" 30 #include "include/effects/SkTableColorFilter.h" 31 #include "src/core/SkColorFilter_Matrix.h" 32 #include "src/core/SkNormalSource.h" 33 #include "src/core/SkRecordedDrawable.h" 34 #include "src/effects/SkDashImpl.h" 35 #include "src/effects/SkEmbossMaskFilter.h" 36 #include "src/effects/SkOpPE.h" 37 #include "src/effects/SkTrimPE.h" 38 #include "src/shaders/SkBitmapProcShader.h" 39 #include "src/shaders/SkColorFilterShader.h" 40 #include "src/shaders/SkColorShader.h" 41 #include "src/shaders/SkComposeShader.h" 42 #include "src/shaders/SkEmptyShader.h" 43 #include "src/shaders/SkImageShader.h" 44 #include "src/shaders/SkLightingShader.h" 45 #include "src/shaders/SkLocalMatrixShader.h" 46 #include "src/shaders/SkPictureShader.h" 47 #include "src/shaders/SkRTShader.h" 48 #include "src/shaders/SkShaderBase.h" 49 50 #include "include/effects/SkImageFilters.h" 51 #include "src/core/SkLocalMatrixImageFilter.h" 52 #include "src/core/SkMatrixImageFilter.h" 53 54 /* 55 * Register most effects for deserialization. 56 * 57 * None of these are strictly required for Skia to operate, so if you're 58 * not using deserialization yourself, you can define 59 * SK_DISABLE_EFFECT_SERIALIZATION, or modify/replace this file as needed. 60 */ InitEffects()61 void SkFlattenable::PrivateInitializer::InitEffects() { 62 // Shaders. 63 SK_REGISTER_FLATTENABLE(SkColor4Shader); 64 SK_REGISTER_FLATTENABLE(SkColorFilterShader); 65 SK_REGISTER_FLATTENABLE(SkColorShader); 66 SK_REGISTER_FLATTENABLE(SkShader_Blend); 67 SK_REGISTER_FLATTENABLE(SkShader_Lerp); 68 SK_REGISTER_FLATTENABLE(SkShader_LerpRed); 69 SK_REGISTER_FLATTENABLE(SkEmptyShader); 70 SK_REGISTER_FLATTENABLE(SkLocalMatrixShader); 71 SK_REGISTER_FLATTENABLE(SkPictureShader); 72 SK_REGISTER_FLATTENABLE(SkRTShader); 73 SkGradientShader::RegisterFlattenables(); 74 SkLightingShader::RegisterFlattenables(); 75 SkPerlinNoiseShader::RegisterFlattenables(); 76 SkShaderBase::RegisterFlattenables(); 77 78 // Color filters. 79 SkColorFilter_Matrix::RegisterFlattenables(); 80 SK_REGISTER_FLATTENABLE(SkLumaColorFilter); 81 SkColorFilter::RegisterFlattenables(); 82 SkHighContrastFilter::RegisterFlattenables(); 83 SkOverdrawColorFilter::RegisterFlattenables(); 84 SkTableColorFilter::RegisterFlattenables(); 85 86 // Mask filters. 87 SK_REGISTER_FLATTENABLE(SkEmbossMaskFilter); 88 SkMaskFilter::RegisterFlattenables(); 89 SkShaderMaskFilter::RegisterFlattenables(); 90 91 // Path effects. 92 SK_REGISTER_FLATTENABLE(SkCornerPathEffect); 93 SK_REGISTER_FLATTENABLE(SkDashImpl); 94 SK_REGISTER_FLATTENABLE(SkDiscretePathEffect); 95 SK_REGISTER_FLATTENABLE(SkLine2DPathEffect); 96 SK_REGISTER_FLATTENABLE(SkMatrixPE); 97 SK_REGISTER_FLATTENABLE(SkOpPE); 98 SK_REGISTER_FLATTENABLE(SkPath1DPathEffect); 99 SK_REGISTER_FLATTENABLE(SkPath2DPathEffect); 100 SK_REGISTER_FLATTENABLE(SkStrokePE); 101 SK_REGISTER_FLATTENABLE(SkTrimPE); 102 SkPathEffect::RegisterFlattenables(); 103 104 // Misc. 105 SK_REGISTER_FLATTENABLE(SkLayerDrawLooper); 106 SK_REGISTER_FLATTENABLE(SkRecordedDrawable); 107 SkNormalSource::RegisterFlattenables(); 108 } 109 110 /* 111 * Register SkImageFilters for deserialization. 112 * 113 * None of these are strictly required for Skia to operate, so if you're 114 * not using deserialization yourself, you can define 115 * SK_DISABLE_EFFECT_SERIALIZATION, or modify/replace this file as needed. 116 */ InitImageFilters()117 void SkFlattenable::PrivateInitializer::InitImageFilters() { 118 SkImageFilters::RegisterFlattenables(); 119 SK_REGISTER_FLATTENABLE(SkLocalMatrixImageFilter); 120 SK_REGISTER_FLATTENABLE(SkMatrixImageFilter); 121 } 122 123 #endif 124