• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "SkTypes.h"
9 
10 #include "SkBitmapProcShader.h"
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"
23 #include "SkBlurImageFilter.h"
24 #include "SkBlurMaskFilter.h"
25 #include "SkColorFilter.h"
26 #include "SkColorFilterImageFilter.h"
27 #include "SkColorMatrixFilter.h"
28 #include "SkColorShader.h"
29 #include "SkComposeImageFilter.h"
30 #include "SkComposeShader.h"
31 #include "SkCornerPathEffect.h"
32 #include "SkDashPathEffect.h"
33 #include "SkDiscretePathEffect.h"
34 #include "SkDisplacementMapEffect.h"
35 #include "SkDropShadowImageFilter.h"
36 #include "SkEmptyShader.h"
37 #include "SkEmbossMaskFilter.h"
38 #include "SkFlattenable.h"
39 #include "SkGradientShader.h"
40 #include "SkLayerDrawLooper.h"
41 #include "SkLayerRasterizer.h"
42 #include "SkLerpXfermode.h"
43 #include "SkLightingImageFilter.h"
44 #include "SkLocalMatrixShader.h"
45 #include "SkLumaColorFilter.h"
46 #include "SkMagnifierImageFilter.h"
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 "SkPictureImageFilter.h"
54 #include "SkPictureShader.h"
55 #include "SkPixelXorXfermode.h"
56 #include "SkRectShaderImageFilter.h"
57 #include "SkStippleMaskFilter.h"
58 #include "SkTableColorFilter.h"
59 #include "SkTestImageFilters.h"
60 #include "SkTileImageFilter.h"
61 #include "SkMatrixImageFilter.h"
62 #include "SkXfermodeImageFilter.h"
63 
InitializeFlattenables()64 static void InitializeFlattenables() {
65     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkAvoidXfermode)
66     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBicubicImageFilter)
67     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBitmapProcShader)
68     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBitmapSource)
69     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurDrawLooper)
70     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurImageFilter)
71     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColorMatrixFilter)
72     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColorShader)
73     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkComposePathEffect)
74     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkComposeShader)
75     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkCornerPathEffect)
76     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDashPathEffect)
77     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDilateImageFilter)
78     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiscretePathEffect)
79     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDisplacementMapEffect)
80     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDropShadowImageFilter)
81     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkEmbossMaskFilter)
82     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkEmptyShader)
83     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkErodeImageFilter)
84     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLayerDrawLooper)
85     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLayerRasterizer)
86     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLerpXfermode)
87     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLocalMatrixShader)
88     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLumaColorFilter)
89     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPath1DPathEffect)
90     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(Sk2DPathEffect)
91     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLine2DPathEffect)
92     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPath2DPathEffect)
93     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPerlinNoiseShader)
94     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPictureImageFilter)
95     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPictureShader)
96     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPixelXorXfermode)
97     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkRectShaderImageFilter)
98     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkStippleMaskFilter)
99     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSumPathEffect)
100     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkTileImageFilter)
101     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkMatrixImageFilter)
102     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkXfermodeImageFilter)
103     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkMagnifierImageFilter)
104     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkMatrixConvolutionImageFilter)
105 
106     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkOffsetImageFilter)
107     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkComposeImageFilter)
108     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkMergeImageFilter)
109     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColorFilterImageFilter)
110     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDownSampleImageFilter)
111     SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkMallocPixelRef)
112 
113     SkArithmeticMode::InitializeFlattenables();
114     SkBlurMaskFilter::InitializeFlattenables();
115     SkColorFilter::InitializeFlattenables();
116     SkGradientShader::InitializeFlattenables();
117     SkLightingImageFilter::InitializeFlattenables();
118     SkTableColorFilter::InitializeFlattenables();
119     SkXfermode::InitializeFlattenables();
120 
121 }
122 
InitializeFlattenablesIfNeeded()123 void SkFlattenable::InitializeFlattenablesIfNeeded() {
124     SK_DECLARE_STATIC_ONCE(once);
125     SkOnce(&once, InitializeFlattenables);
126 }
127