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 | |
caryclark@google.com | d26147a | 2011-12-15 14:16:43 +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" |
caryclark@google.com | d26147a | 2011-12-15 14:16:43 +0000 | [diff] [blame] | 11 | #include "SkMallocPixelRef.h" |
| 12 | #include "SkPathEffect.h" |
| 13 | #include "SkPixelRef.h" |
caryclark@google.com | d26147a | 2011-12-15 14:16:43 +0000 | [diff] [blame] | 14 | #include "SkXfermode.h" |
| 15 | |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 16 | #include "Sk1DPathEffect.h" |
| 17 | #include "Sk2DPathEffect.h" |
senorblanco@chromium.org | 9a6eb0e | 2013-05-29 20:55:09 +0000 | [diff] [blame] | 18 | #include "SkArithmeticMode.h" |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 19 | #include "SkAvoidXfermode.h" |
senorblanco@chromium.org | 3f2d45a | 2013-01-18 20:48:20 +0000 | [diff] [blame] | 20 | #include "SkBicubicImageFilter.h" |
senorblanco@chromium.org | d912ca4 | 2012-08-23 19:10:04 +0000 | [diff] [blame] | 21 | #include "SkBitmapSource.h" |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 22 | #include "SkBlurDrawLooper.h" |
| 23 | #include "SkBlurImageFilter.h" |
| 24 | #include "SkBlurMaskFilter.h" |
| 25 | #include "SkColorFilter.h" |
senorblanco@chromium.org | 392e14e | 2012-08-20 19:45:02 +0000 | [diff] [blame] | 26 | #include "SkColorFilterImageFilter.h" |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 27 | #include "SkColorMatrixFilter.h" |
| 28 | #include "SkColorShader.h" |
commit-bot@chromium.org | 1c4c9ef | 2013-08-07 00:07:51 +0000 | [diff] [blame] | 29 | #include "SkComposeImageFilter.h" |
scroggo | b3c0f48 | 2012-07-02 19:07:57 +0000 | [diff] [blame] | 30 | #include "SkComposeShader.h" |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 31 | #include "SkCornerPathEffect.h" |
| 32 | #include "SkDashPathEffect.h" |
| 33 | #include "SkDiscretePathEffect.h" |
sugoi@google.com | 781cc76 | 2013-01-15 15:40:19 +0000 | [diff] [blame] | 34 | #include "SkDisplacementMapEffect.h" |
junov@chromium.org | f44fcdc | 2013-08-07 20:00:55 +0000 | [diff] [blame] | 35 | #include "SkDropShadowImageFilter.h" |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 36 | #include "SkEmptyShader.h" |
scroggo@google.com | 72ae6bd | 2012-04-20 18:42:55 +0000 | [diff] [blame] | 37 | #include "SkEmbossMaskFilter.h" |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 38 | #include "SkFlattenable.h" |
| 39 | #include "SkGradientShader.h" |
scroggo@google.com | 5a7c6be | 2012-10-04 21:46:08 +0000 | [diff] [blame] | 40 | #include "SkImages.h" |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 41 | #include "SkLayerDrawLooper.h" |
| 42 | #include "SkLayerRasterizer.h" |
reed@google.com | 8c6411a | 2013-05-22 13:21:32 +0000 | [diff] [blame] | 43 | #include "SkLerpXfermode.h" |
djsollen@google.com | 0833777 | 2012-06-26 14:33:13 +0000 | [diff] [blame] | 44 | #include "SkLightingImageFilter.h" |
commit-bot@chromium.org | 6c1ee2d | 2013-10-07 18:00:17 +0000 | [diff] [blame] | 45 | #include "SkLumaColorFilter.h" |
senorblanco@chromium.org | 35c5ff0 | 2012-08-22 18:34:16 +0000 | [diff] [blame] | 46 | #include "SkMagnifierImageFilter.h" |
senorblanco@chromium.org | b4ca9df | 2012-09-19 22:50:21 +0000 | [diff] [blame] | 47 | #include "SkMatrixConvolutionImageFilter.h" |
senorblanco@chromium.org | 4a9a612 | 2012-12-04 14:18:50 +0000 | [diff] [blame] | 48 | #include "SkMergeImageFilter.h" |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 49 | #include "SkMorphologyImageFilter.h" |
senorblanco@chromium.org | 4a9a612 | 2012-12-04 14:18:50 +0000 | [diff] [blame] | 50 | #include "SkOffsetImageFilter.h" |
commit-bot@chromium.org | c0b7e10 | 2013-10-23 17:06:21 +0000 | [diff] [blame^] | 51 | #include "SkOnce.h" |
sugoi@google.com | e3b4c50 | 2013-04-05 13:47:09 +0000 | [diff] [blame] | 52 | #include "SkPerlinNoiseShader.h" |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 53 | #include "SkPixelXorXfermode.h" |
commit-bot@chromium.org | cf292b7 | 2013-09-05 18:28:08 +0000 | [diff] [blame] | 54 | #include "SkRectShaderImageFilter.h" |
robertphillips@google.com | 088719e | 2012-06-05 13:22:14 +0000 | [diff] [blame] | 55 | #include "SkStippleMaskFilter.h" |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 56 | #include "SkTableColorFilter.h" |
| 57 | #include "SkTestImageFilters.h" |
sugoi@google.com | 0ac74b2 | 2013-09-26 17:03:38 +0000 | [diff] [blame] | 58 | #include "SkTileImageFilter.h" |
senorblanco@chromium.org | 86fc266 | 2013-05-31 17:49:12 +0000 | [diff] [blame] | 59 | #include "SkXfermodeImageFilter.h" |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 60 | |
commit-bot@chromium.org | c0b7e10 | 2013-10-23 17:06:21 +0000 | [diff] [blame^] | 61 | static void InitializeFlattenables(int*) { |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 62 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkAvoidXfermode) |
senorblanco@chromium.org | 3f2d45a | 2013-01-18 20:48:20 +0000 | [diff] [blame] | 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) |
senorblanco@chromium.org | d912ca4 | 2012-08-23 19:10:04 +0000 | [diff] [blame] | 65 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBitmapSource) |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 66 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurDrawLooper) |
| 67 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurImageFilter) |
| 68 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColorMatrixFilter) |
| 69 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColorShader) |
| 70 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkComposePathEffect) |
scroggo | b3c0f48 | 2012-07-02 19:07:57 +0000 | [diff] [blame] | 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) |
| 74 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDilateImageFilter) |
| 75 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiscretePathEffect) |
sugoi@google.com | 781cc76 | 2013-01-15 15:40:19 +0000 | [diff] [blame] | 76 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDisplacementMapEffect) |
junov@chromium.org | f44fcdc | 2013-08-07 20:00:55 +0000 | [diff] [blame] | 77 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDropShadowImageFilter) |
scroggo@google.com | 72ae6bd | 2012-04-20 18:42:55 +0000 | [diff] [blame] | 78 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkEmbossMaskFilter) |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 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) |
| 82 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLayerRasterizer) |
reed@google.com | 8c6411a | 2013-05-22 13:21:32 +0000 | [diff] [blame] | 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) |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 85 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPath1DPathEffect) |
scroggo@google.com | d8a6cc8 | 2012-09-12 18:53:49 +0000 | [diff] [blame] | 86 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(Sk2DPathEffect) |
| 87 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLine2DPathEffect) |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 88 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPath2DPathEffect) |
sugoi@google.com | e3b4c50 | 2013-04-05 13:47:09 +0000 | [diff] [blame] | 89 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPerlinNoiseShader) |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 90 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPixelXorXfermode) |
commit-bot@chromium.org | cf292b7 | 2013-09-05 18:28:08 +0000 | [diff] [blame] | 91 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkRectShaderImageFilter) |
robertphillips@google.com | 941ee93 | 2012-06-05 12:55:05 +0000 | [diff] [blame] | 92 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkStippleMaskFilter) |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 93 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSumPathEffect) |
sugoi@google.com | 0ac74b2 | 2013-09-26 17:03:38 +0000 | [diff] [blame] | 94 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkTileImageFilter) |
senorblanco@chromium.org | 86fc266 | 2013-05-31 17:49:12 +0000 | [diff] [blame] | 95 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkXfermodeImageFilter) |
bsalomon@google.com | 82aa748 | 2012-08-13 14:22:17 +0000 | [diff] [blame] | 96 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkMagnifierImageFilter) |
senorblanco@chromium.org | b4ca9df | 2012-09-19 22:50: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 | |
| 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) |
djsollen@google.com | 5370cd9 | 2012-03-28 20:47:01 +0000 | [diff] [blame] | 104 | SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkMallocPixelRef) |
| 105 | |
senorblanco@chromium.org | 9a6eb0e | 2013-05-29 20:55:09 +0000 | [diff] [blame] | 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(); |
scroggo@google.com | 5a7c6be | 2012-10-04 21:46:08 +0000 | [diff] [blame] | 110 | SkImages::InitializeFlattenables(); |
djsollen@google.com | 0833777 | 2012-06-26 14:33:13 +0000 | [diff] [blame] | 111 | SkLightingImageFilter::InitializeFlattenables(); |
djsollen@google.com | a2ca41e | 2012-03-23 19:00:34 +0000 | [diff] [blame] | 112 | SkTableColorFilter::InitializeFlattenables(); |
| 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 | } |