blob: d402c02e21e04dffa9f46d2cda7b0bf2aed03e3e [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 */
7
commit-bot@chromium.orgc0b7e102013-10-23 17:06:21 +00008#include "SkTypes.h"
9
caryclark@google.comd26147a2011-12-15 14:16:43 +000010#include "SkBitmapProcShader.h"
commit-bot@chromium.orgc0b7e102013-10-23 17:06:21 +000011#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.comd26147a2011-12-15 14:16:43 +000023#include "SkBlurImageFilter.h"
24#include "SkBlurMaskFilter.h"
25#include "SkColorFilter.h"
commit-bot@chromium.orgc0b7e102013-10-23 17:06:21 +000026#include "SkColorFilterImageFilter.h"
27#include "SkColorMatrixFilter.h"
28#include "SkColorShader.h"
29#include "SkComposeImageFilter.h"
30#include "SkComposeShader.h"
caryclark@google.comd26147a2011-12-15 14:16:43 +000031#include "SkCornerPathEffect.h"
32#include "SkDashPathEffect.h"
commit-bot@chromium.orgc0b7e102013-10-23 17:06:21 +000033#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.comd26147a2011-12-15 14:16:43 +000039#include "SkGradientShader.h"
commit-bot@chromium.orgc0b7e102013-10-23 17:06:21 +000040#include "SkImages.h"
caryclark@google.comd26147a2011-12-15 14:16:43 +000041#include "SkLayerDrawLooper.h"
commit-bot@chromium.orgc0b7e102013-10-23 17:06:21 +000042#include "SkLayerRasterizer.h"
43#include "SkLerpXfermode.h"
44#include "SkLightingImageFilter.h"
commit-bot@chromium.org6c1ee2d2013-10-07 18:00:17 +000045#include "SkLumaColorFilter.h"
tomhudson@google.comb8bf9ce2012-08-13 15:48:18 +000046#include "SkMagnifierImageFilter.h"
commit-bot@chromium.orgc0b7e102013-10-23 17:06:21 +000047#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.comd26147a2011-12-15 14:16:43 +000060
commit-bot@chromium.orgc0b7e102013-10-23 17:06:21 +000061static void InitializeFlattenables(int*) {
62 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkAvoidXfermode)
63 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBicubicImageFilter)
djsollen@google.coma2ca41e2012-03-23 19:00:34 +000064 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBitmapProcShader)
commit-bot@chromium.orgc0b7e102013-10-23 17:06:21 +000065 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBitmapSource)
66 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurDrawLooper)
djsollen@google.coma2ca41e2012-03-23 19:00:34 +000067 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurImageFilter)
commit-bot@chromium.orgc0b7e102013-10-23 17:06:21 +000068 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.coma2ca41e2012-03-23 19:00:34 +000072 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkCornerPathEffect)
73 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDashPathEffect)
commit-bot@chromium.orgc0b7e102013-10-23 17:06:21 +000074 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.coma2ca41e2012-03-23 19:00:34 +000081 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLayerDrawLooper)
commit-bot@chromium.orgc0b7e102013-10-23 17:06:21 +000082 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLayerRasterizer)
83 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLerpXfermode)
commit-bot@chromium.org6c1ee2d2013-10-07 18:00:17 +000084 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLumaColorFilter)
commit-bot@chromium.orgc0b7e102013-10-23 17:06:21 +000085 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.comb8bf9ce2012-08-13 15:48:18 +000096 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkMagnifierImageFilter)
commit-bot@chromium.orgc0b7e102013-10-23 17:06:21 +000097 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkMatrixConvolutionImageFilter)
djsollen@google.coma2ca41e2012-03-23 19:00:34 +000098
commit-bot@chromium.orgc0b7e102013-10-23 17:06:21 +000099 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.coma2ca41e2012-03-23 19:00:34 +0000107 SkBlurMaskFilter::InitializeFlattenables();
108 SkColorFilter::InitializeFlattenables();
109 SkGradientShader::InitializeFlattenables();
commit-bot@chromium.orgc0b7e102013-10-23 17:06:21 +0000110 SkImages::InitializeFlattenables();
111 SkLightingImageFilter::InitializeFlattenables();
112 SkTableColorFilter::InitializeFlattenables();
djsollen@google.coma2ca41e2012-03-23 19:00:34 +0000113 SkXfermode::InitializeFlattenables();
caryclark@google.comd26147a2011-12-15 14:16:43 +0000114}
commit-bot@chromium.orgc0b7e102013-10-23 17:06:21 +0000115
116void SkFlattenable::InitializeFlattenablesIfNeeded() {
117 int dummy;
118 SK_DECLARE_STATIC_ONCE(once);
119 SkOnce(&once, InitializeFlattenables, &dummy);
120}