Index: src/ports/SkGlobalInitialization_default.cpp |
diff --git a/src/ports/SkGlobalInitialization_default.cpp b/src/ports/SkGlobalInitialization_default.cpp |
index af386e01ca1e4d3213c973448c8c3162ddcd7eae..1893ed01fc728cd42a3bbd23aaa0897f142afcc6 100644 |
--- a/src/ports/SkGlobalInitialization_default.cpp |
+++ b/src/ports/SkGlobalInitialization_default.cpp |
@@ -59,62 +59,64 @@ |
#include "SkMatrixImageFilter.h" |
#include "SkXfermodeImageFilter.h" |
-static void InitializeFlattenables() { |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkAvoidXfermode) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBitmapProcShader) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBitmapSource) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurDrawLooper) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurImageFilter) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColorMatrixFilter) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColorShader) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkComposePathEffect) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkComposeShader) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkCornerPathEffect) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDashPathEffect) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDilateImageFilter) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiscretePathEffect) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDisplacementMapEffect) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDropShadowImageFilter) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkEmbossMaskFilter) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkEmptyShader) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkErodeImageFilter) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLayerDrawLooper) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLayerRasterizer) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLerpXfermode) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLocalMatrixShader) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLumaColorFilter) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPath1DPathEffect) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLine2DPathEffect) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPath2DPathEffect) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPerlinNoiseShader) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPictureImageFilter) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPictureShader) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPixelXorXfermode) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkRectShaderImageFilter) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSumPathEffect) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkTileImageFilter) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkMatrixImageFilter) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkXfermodeImageFilter) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkMagnifierImageFilter) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkMatrixConvolutionImageFilter) |
+class SkPrivateEffectInitializer { |
+public: |
+ static void Init() { |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkAvoidXfermode) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBitmapProcShader) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBitmapSource) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurDrawLooper) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurImageFilter) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColorMatrixFilter) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColorShader) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkComposePathEffect) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkComposeShader) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkCornerPathEffect) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDashPathEffect) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDilateImageFilter) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiscretePathEffect) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDisplacementMapEffect) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDropShadowImageFilter) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkEmbossMaskFilter) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkEmptyShader) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkErodeImageFilter) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLayerDrawLooper) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLayerRasterizer) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLerpXfermode) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLocalMatrixShader) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLumaColorFilter) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPath1DPathEffect) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLine2DPathEffect) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPath2DPathEffect) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPerlinNoiseShader) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPictureImageFilter) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPictureShader) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPixelXorXfermode) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkRectShaderImageFilter) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSumPathEffect) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkTileImageFilter) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkMatrixImageFilter) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkXfermodeImageFilter) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkMagnifierImageFilter) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkMatrixConvolutionImageFilter) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkOffsetImageFilter) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkComposeImageFilter) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkMergeImageFilter) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColorFilterImageFilter) |
- SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDownSampleImageFilter) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkOffsetImageFilter) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkComposeImageFilter) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkMergeImageFilter) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColorFilterImageFilter) |
+ SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDownSampleImageFilter) |
- SkArithmeticMode::InitializeFlattenables(); |
- SkBlurMaskFilter::InitializeFlattenables(); |
- SkColorFilter::InitializeFlattenables(); |
- SkGradientShader::InitializeFlattenables(); |
- SkLightingImageFilter::InitializeFlattenables(); |
- SkTableColorFilter::InitializeFlattenables(); |
- SkXfermode::InitializeFlattenables(); |
- |
-} |
+ SkArithmeticMode::InitializeFlattenables(); |
+ SkBlurMaskFilter::InitializeFlattenables(); |
+ SkColorFilter::InitializeFlattenables(); |
+ SkGradientShader::InitializeFlattenables(); |
+ SkLightingImageFilter::InitializeFlattenables(); |
+ SkTableColorFilter::InitializeFlattenables(); |
+ SkXfermode::InitializeFlattenables(); |
+ } |
+}; |
void SkFlattenable::InitializeFlattenablesIfNeeded() { |
SK_DECLARE_STATIC_ONCE(once); |
- SkOnce(&once, InitializeFlattenables); |
+ SkOnce(&once, SkPrivateEffectInitializer::Init); |
} |