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 | */ |
| 7 | |
commit-bot@chromium.org | c0b7e10 | 2013-10-23 17:06:21 +0000 | [diff] [blame^] | 8 | #include "SkTypes.h" |
| 9 | |
caryclark@google.com | d26147a | 2011-12-15 14:16:43 +0000 | [diff] [blame] | 10 | #include "SkBitmapProcShader.h" |
commit-bot@chromium.org | c0b7e10 | 2013-10-23 17:06:21 +0000 | [diff] [blame^] | 11 | #include "SkMallocPixelRef.h" |
| 12 | #include "SkPathEffect.h" |
| 13 | #include "SkPixelRef.h" |
| 14 | #include "SkXfermode.h" |
| 15 | |
| 16 | #include "Sk1DPathEffect.h" |
| 17 | #include "Sk2DPathEffect.h" |
| 18 | #include "SkArithmeticMode.h" |
| 19 | #include "SkAvoidXfermode.h" |
| 20 | #include "SkBicubicImageFilter.h" |
| 21 | #include "SkBitmapSource.h" |
| 22 | #include "SkBlurDrawLooper.h" |
caryclark@google.com | d26147a | 2011-12-15 14:16:43 +0000 | [diff] [blame] | 23 | #include "SkBlurImageFilter.h" |
| 24 | #include "SkBlurMaskFilter.h" |
| 25 | #include "SkColorFilter.h" |
commit-bot@chromium.org | c0b7e10 | 2013-10-23 17:06:21 +0000 | [diff] [blame^] | 26 | #include "SkColorFilterImageFilter.h" |
| 27 | #include "SkColorMatrixFilter.h" |
| 28 | #include "SkColorShader.h" |
| 29 | #include "SkComposeImageFilter.h" |
| 30 | #include "SkComposeShader.h" |
caryclark@google.com | d26147a | 2011-12-15 14:16:43 +0000 | [diff] [blame] | 31 | #include "SkCornerPathEffect.h" |
| 32 | #include "SkDashPathEffect.h" |
commit-bot@chromium.org | c0b7e10 | 2013-10-23 17:06:21 +0000 | [diff] [blame^] | 33 | #include "SkDiscretePathEffect.h" |
| 34 | #include "SkDisplacementMapEffect.h" |
| 35 | #include "SkDropShadowImageFilter.h" |
| 36 | #include "SkEmptyShader.h" |
| 37 | #include "SkEmbossMaskFilter.h" |
| 38 | #include "SkFlattenable.h" |
caryclark@google.com | d26147a | 2011-12-15 14:16:43 +0000 | [diff] [blame] | 39 | #include "SkGradientShader.h" |
commit-bot@chromium.org | c0b7e10 | 2013-10-23 17:06:21 +0000 | [diff] [blame^] | 40 | #include "SkImages.h" |
caryclark@google.com | d26147a | 2011-12-15 14:16:43 +0000 | [diff] [blame] | 41 | #include "SkLayerDrawLooper.h" |
commit-bot@chromium.org | c0b7e10 | 2013-10-23 17:06:21 +0000 | [diff] [blame^] | 42 | #include "SkLayerRasterizer.h" |
| 43 | #include "SkLerpXfermode.h" |
| 44 | #include "SkLightingImageFilter.h" |
commit-bot@chromium.org | 6c1ee2d | 2013-10-07 18:00:17 +0000 | [diff] [blame] | 45 | #include "SkLumaColorFilter.h" |
tomhudson@google.com | b8bf9ce | 2012-08-13 15:48:18 +0000 | [diff] [blame] | 46 | #include "SkMagnifierImageFilter.h" |
commit-bot@chromium.org | c0b7e10 | 2013-10-23 17:06:21 +0000 | [diff] [blame^] | 47 | #include "SkMatrixConvolutionImageFilter.h" |
| 48 | #include "SkMergeImageFilter.h" |
| 49 | #include "SkMorphologyImageFilter.h" |
| 50 | #include "SkOffsetImageFilter.h" |
| 51 | #include "SkOnce.h" |
| 52 | #include "SkPerlinNoiseShader.h" |
| 53 | #include "SkPixelXorXfermode.h" |
| 54 | #include "SkRectShaderImageFilter.h" |
| 55 | #include "SkStippleMaskFilter.h" |
| 56 | #include "SkTableColorFilter.h" |
| 57 | #include "SkTestImageFilters.h" |
| 58 | #include "SkTileImageFilter.h" |
| 59 | #include "SkXfermodeImageFilter.h" |
caryclark@google.com | d26147a | 2011-12-15 14:16:43 +0000 | [diff] [blame] | 60 | |
commit-bot@chromium.org | c0b7e10 | 2013-10-23 17:06:21 +0000 | [diff] [blame^] | 61 | static void InitializeFlattenables(int*) { |
| 62 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkAvoidXfermode) |
| 63 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBicubicImageFilter) |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 64 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBitmapProcShader) |
commit-bot@chromium.org | c0b7e10 | 2013-10-23 17:06:21 +0000 | [diff] [blame^] | 65 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBitmapSource) |
| 66 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurDrawLooper) |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 67 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurImageFilter) |
commit-bot@chromium.org | c0b7e10 | 2013-10-23 17:06:21 +0000 | [diff] [blame^] | 68 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColorMatrixFilter) |
| 69 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColorShader) |
| 70 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkComposePathEffect) |
| 71 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkComposeShader) |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 72 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkCornerPathEffect) |
| 73 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDashPathEffect) |
commit-bot@chromium.org | c0b7e10 | 2013-10-23 17:06:21 +0000 | [diff] [blame^] | 74 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDilateImageFilter) |
| 75 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiscretePathEffect) |
| 76 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDisplacementMapEffect) |
| 77 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDropShadowImageFilter) |
| 78 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkEmbossMaskFilter) |
| 79 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkEmptyShader) |
| 80 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkErodeImageFilter) |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 81 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLayerDrawLooper) |
commit-bot@chromium.org | c0b7e10 | 2013-10-23 17:06:21 +0000 | [diff] [blame^] | 82 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLayerRasterizer) |
| 83 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLerpXfermode) |
commit-bot@chromium.org | 6c1ee2d | 2013-10-07 18:00:17 +0000 | [diff] [blame] | 84 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLumaColorFilter) |
commit-bot@chromium.org | c0b7e10 | 2013-10-23 17:06:21 +0000 | [diff] [blame^] | 85 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPath1DPathEffect) |
| 86 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(Sk2DPathEffect) |
| 87 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLine2DPathEffect) |
| 88 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPath2DPathEffect) |
| 89 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPerlinNoiseShader) |
| 90 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPixelXorXfermode) |
| 91 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkRectShaderImageFilter) |
| 92 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkStippleMaskFilter) |
| 93 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSumPathEffect) |
| 94 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkTileImageFilter) |
| 95 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkXfermodeImageFilter) |
tomhudson@google.com | b8bf9ce | 2012-08-13 15:48:18 +0000 | [diff] [blame] | 96 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkMagnifierImageFilter) |
commit-bot@chromium.org | c0b7e10 | 2013-10-23 17:06:21 +0000 | [diff] [blame^] | 97 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkMatrixConvolutionImageFilter) |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 98 | |
commit-bot@chromium.org | c0b7e10 | 2013-10-23 17:06:21 +0000 | [diff] [blame^] | 99 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkOffsetImageFilter) |
| 100 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkComposeImageFilter) |
| 101 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkMergeImageFilter) |
| 102 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColorFilterImageFilter) |
| 103 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDownSampleImageFilter) |
| 104 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkMallocPixelRef) |
| 105 | |
| 106 | SkArithmeticMode::InitializeFlattenables(); |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 107 | SkBlurMaskFilter::InitializeFlattenables(); |
| 108 | SkColorFilter::InitializeFlattenables(); |
| 109 | SkGradientShader::InitializeFlattenables(); |
commit-bot@chromium.org | c0b7e10 | 2013-10-23 17:06:21 +0000 | [diff] [blame^] | 110 | SkImages::InitializeFlattenables(); |
| 111 | SkLightingImageFilter::InitializeFlattenables(); |
| 112 | SkTableColorFilter::InitializeFlattenables(); |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 113 | SkXfermode::InitializeFlattenables(); |
caryclark@google.com | d26147a | 2011-12-15 14:16:43 +0000 | [diff] [blame] | 114 | } |
commit-bot@chromium.org | c0b7e10 | 2013-10-23 17:06:21 +0000 | [diff] [blame^] | 115 | |
| 116 | void SkFlattenable::InitializeFlattenablesIfNeeded() { |
| 117 | int dummy; |
| 118 | SK_DECLARE_STATIC_ONCE(once); |
| 119 | SkOnce(&once, InitializeFlattenables, &dummy); |
| 120 | } |