diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkGlobalInitialization_core.cpp | 1 | ||||
-rw-r--r-- | src/effects/imagefilters/SkAlphaThresholdFilter.cpp (renamed from src/effects/SkAlphaThresholdFilter.cpp) | 0 | ||||
-rw-r--r-- | src/effects/imagefilters/SkArithmeticImageFilter.cpp (renamed from src/effects/SkArithmeticImageFilter.cpp) | 0 | ||||
-rw-r--r-- | src/effects/imagefilters/SkColorFilterImageFilter.cpp (renamed from src/effects/SkColorFilterImageFilter.cpp) | 0 | ||||
-rw-r--r-- | src/effects/imagefilters/SkComposeImageFilter.cpp (renamed from src/effects/SkComposeImageFilter.cpp) | 0 | ||||
-rw-r--r-- | src/effects/imagefilters/SkDisplacementMapEffect.cpp (renamed from src/effects/SkDisplacementMapEffect.cpp) | 0 | ||||
-rw-r--r-- | src/effects/imagefilters/SkDropShadowImageFilter.cpp (renamed from src/effects/SkDropShadowImageFilter.cpp) | 0 | ||||
-rw-r--r-- | src/effects/imagefilters/SkImageSource.cpp (renamed from src/effects/SkImageSource.cpp) | 0 | ||||
-rw-r--r-- | src/effects/imagefilters/SkLightingImageFilter.cpp (renamed from src/effects/SkLightingImageFilter.cpp) | 0 | ||||
-rw-r--r-- | src/effects/imagefilters/SkMagnifierImageFilter.cpp (renamed from src/effects/SkMagnifierImageFilter.cpp) | 0 | ||||
-rw-r--r-- | src/effects/imagefilters/SkMatrixConvolutionImageFilter.cpp (renamed from src/effects/SkMatrixConvolutionImageFilter.cpp) | 0 | ||||
-rw-r--r-- | src/effects/imagefilters/SkMergeImageFilter.cpp (renamed from src/effects/SkMergeImageFilter.cpp) | 0 | ||||
-rw-r--r-- | src/effects/imagefilters/SkMorphologyImageFilter.cpp (renamed from src/effects/SkMorphologyImageFilter.cpp) | 0 | ||||
-rw-r--r-- | src/effects/imagefilters/SkOffsetImageFilter.cpp (renamed from src/effects/SkOffsetImageFilter.cpp) | 0 | ||||
-rw-r--r-- | src/effects/imagefilters/SkPaintImageFilter.cpp (renamed from src/effects/SkPaintImageFilter.cpp) | 0 | ||||
-rw-r--r-- | src/effects/imagefilters/SkPictureImageFilter.cpp (renamed from src/effects/SkPictureImageFilter.cpp) | 0 | ||||
-rw-r--r-- | src/effects/imagefilters/SkTileImageFilter.cpp (renamed from src/effects/SkTileImageFilter.cpp) | 0 | ||||
-rw-r--r-- | src/effects/imagefilters/SkXfermodeImageFilter.cpp (renamed from src/effects/SkXfermodeImageFilter.cpp) | 0 | ||||
-rw-r--r-- | src/ports/SkGlobalInitialization_default.cpp | 49 | ||||
-rw-r--r-- | src/ports/SkGlobalInitialization_default_imagefilters.cpp | 57 | ||||
-rw-r--r-- | src/ports/SkGlobalInitialization_none_imagefilters.cpp | 10 |
21 files changed, 68 insertions, 49 deletions
diff --git a/src/core/SkGlobalInitialization_core.cpp b/src/core/SkGlobalInitialization_core.cpp index cb4d1d0549..27f801d6c1 100644 --- a/src/core/SkGlobalInitialization_core.cpp +++ b/src/core/SkGlobalInitialization_core.cpp @@ -50,6 +50,7 @@ void SkFlattenable::PrivateInitializer::InitCore() { // Now initialize any optional/additional effects (implemented in src/ports) InitEffects(); + InitImageFilters(); // Finalize flattenable initialization. SkFlattenable::Finalize(); diff --git a/src/effects/SkAlphaThresholdFilter.cpp b/src/effects/imagefilters/SkAlphaThresholdFilter.cpp index 9dc8ae4b02..9dc8ae4b02 100644 --- a/src/effects/SkAlphaThresholdFilter.cpp +++ b/src/effects/imagefilters/SkAlphaThresholdFilter.cpp diff --git a/src/effects/SkArithmeticImageFilter.cpp b/src/effects/imagefilters/SkArithmeticImageFilter.cpp index 3fc065536b..3fc065536b 100644 --- a/src/effects/SkArithmeticImageFilter.cpp +++ b/src/effects/imagefilters/SkArithmeticImageFilter.cpp diff --git a/src/effects/SkColorFilterImageFilter.cpp b/src/effects/imagefilters/SkColorFilterImageFilter.cpp index fcbe2261db..fcbe2261db 100644 --- a/src/effects/SkColorFilterImageFilter.cpp +++ b/src/effects/imagefilters/SkColorFilterImageFilter.cpp diff --git a/src/effects/SkComposeImageFilter.cpp b/src/effects/imagefilters/SkComposeImageFilter.cpp index 842588d9c6..842588d9c6 100644 --- a/src/effects/SkComposeImageFilter.cpp +++ b/src/effects/imagefilters/SkComposeImageFilter.cpp diff --git a/src/effects/SkDisplacementMapEffect.cpp b/src/effects/imagefilters/SkDisplacementMapEffect.cpp index 8983fcacbd..8983fcacbd 100644 --- a/src/effects/SkDisplacementMapEffect.cpp +++ b/src/effects/imagefilters/SkDisplacementMapEffect.cpp diff --git a/src/effects/SkDropShadowImageFilter.cpp b/src/effects/imagefilters/SkDropShadowImageFilter.cpp index 36a9d7110d..36a9d7110d 100644 --- a/src/effects/SkDropShadowImageFilter.cpp +++ b/src/effects/imagefilters/SkDropShadowImageFilter.cpp diff --git a/src/effects/SkImageSource.cpp b/src/effects/imagefilters/SkImageSource.cpp index 960de37b33..960de37b33 100644 --- a/src/effects/SkImageSource.cpp +++ b/src/effects/imagefilters/SkImageSource.cpp diff --git a/src/effects/SkLightingImageFilter.cpp b/src/effects/imagefilters/SkLightingImageFilter.cpp index 064c16d48a..064c16d48a 100644 --- a/src/effects/SkLightingImageFilter.cpp +++ b/src/effects/imagefilters/SkLightingImageFilter.cpp diff --git a/src/effects/SkMagnifierImageFilter.cpp b/src/effects/imagefilters/SkMagnifierImageFilter.cpp index 40624ab05a..40624ab05a 100644 --- a/src/effects/SkMagnifierImageFilter.cpp +++ b/src/effects/imagefilters/SkMagnifierImageFilter.cpp diff --git a/src/effects/SkMatrixConvolutionImageFilter.cpp b/src/effects/imagefilters/SkMatrixConvolutionImageFilter.cpp index 9e71ab629e..9e71ab629e 100644 --- a/src/effects/SkMatrixConvolutionImageFilter.cpp +++ b/src/effects/imagefilters/SkMatrixConvolutionImageFilter.cpp diff --git a/src/effects/SkMergeImageFilter.cpp b/src/effects/imagefilters/SkMergeImageFilter.cpp index 3225ba8821..3225ba8821 100644 --- a/src/effects/SkMergeImageFilter.cpp +++ b/src/effects/imagefilters/SkMergeImageFilter.cpp diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/imagefilters/SkMorphologyImageFilter.cpp index 8b3e76cb5d..8b3e76cb5d 100644 --- a/src/effects/SkMorphologyImageFilter.cpp +++ b/src/effects/imagefilters/SkMorphologyImageFilter.cpp diff --git a/src/effects/SkOffsetImageFilter.cpp b/src/effects/imagefilters/SkOffsetImageFilter.cpp index 8dacc11120..8dacc11120 100644 --- a/src/effects/SkOffsetImageFilter.cpp +++ b/src/effects/imagefilters/SkOffsetImageFilter.cpp diff --git a/src/effects/SkPaintImageFilter.cpp b/src/effects/imagefilters/SkPaintImageFilter.cpp index c0be41fdb9..c0be41fdb9 100644 --- a/src/effects/SkPaintImageFilter.cpp +++ b/src/effects/imagefilters/SkPaintImageFilter.cpp diff --git a/src/effects/SkPictureImageFilter.cpp b/src/effects/imagefilters/SkPictureImageFilter.cpp index b9c298dbac..b9c298dbac 100644 --- a/src/effects/SkPictureImageFilter.cpp +++ b/src/effects/imagefilters/SkPictureImageFilter.cpp diff --git a/src/effects/SkTileImageFilter.cpp b/src/effects/imagefilters/SkTileImageFilter.cpp index 7ced09ec6e..7ced09ec6e 100644 --- a/src/effects/SkTileImageFilter.cpp +++ b/src/effects/imagefilters/SkTileImageFilter.cpp diff --git a/src/effects/SkXfermodeImageFilter.cpp b/src/effects/imagefilters/SkXfermodeImageFilter.cpp index 7393ab9485..7393ab9485 100644 --- a/src/effects/SkXfermodeImageFilter.cpp +++ b/src/effects/imagefilters/SkXfermodeImageFilter.cpp diff --git a/src/ports/SkGlobalInitialization_default.cpp b/src/ports/SkGlobalInitialization_default.cpp index 83a35acd4e..22aabc2314 100644 --- a/src/ports/SkGlobalInitialization_default.cpp +++ b/src/ports/SkGlobalInitialization_default.cpp @@ -7,48 +7,21 @@ #include "Sk1DPathEffect.h" #include "Sk2DPathEffect.h" -#include "SkAlphaThresholdFilter.h" -#include "SkBlurImageFilter.h" -#include "SkColorFilterImageFilter.h" #include "SkColorMatrixFilterRowMajor255.h" -#include "SkComposeImageFilter.h" #include "SkCornerPathEffect.h" #include "../../src/effects/SkDashImpl.h" #include "SkDiscretePathEffect.h" -#include "SkDisplacementMapEffect.h" -#include "SkDropShadowImageFilter.h" #include "../../src/effects/SkEmbossMaskFilter.h" #include "SkGradientShader.h" #include "SkHighContrastFilter.h" -#include "SkImageSource.h" #include "SkLayerDrawLooper.h" -#include "SkLightingImageFilter.h" -#include "SkLocalMatrixImageFilter.h" #include "SkLumaColorFilter.h" -#include "SkMagnifierImageFilter.h" -#include "SkMatrixConvolutionImageFilter.h" -#include "SkMergeImageFilter.h" -#include "SkMorphologyImageFilter.h" -#include "SkOffsetImageFilter.h" #include "SkOverdrawColorFilter.h" -#include "SkPaintImageFilter.h" #include "SkPerlinNoiseShader.h" -#include "SkPictureImageFilter.h" #include "SkShaderMaskFilter.h" #include "SkTableColorFilter.h" -#include "SkTileImageFilter.h" #include "SkToSRGBColorFilter.h" #include "../../src/effects/SkTrimPE.h" -#include "SkXfermodeImageFilter.h" - -// Security note: -// -// As new subclasses are added here, they should be reviewed by chrome security before they -// support deserializing cross-process: chrome-security@google.com. SampleFilterFuzz.cpp should -// also be amended to exercise the new subclass. -// -// See SkReadBuffer::isCrossProcess() and SkPicture::PictureIOSecurityPrecautionsEnabled() -// /* * None of these are strictly "required" for Skia to operate. @@ -71,7 +44,6 @@ void SkFlattenable::PrivateInitializer::InitEffects() { SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColorMatrixFilterRowMajor255) SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLumaColorFilter) SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkToSRGBColorFilter) - SkAlphaThresholdFilter::InitializeFlattenables(); SkTableColorFilter::InitializeFlattenables(); SkOverdrawColorFilter::InitializeFlattenables(); SkHighContrastFilter::InitializeFlattenables(); @@ -88,25 +60,4 @@ void SkFlattenable::PrivateInitializer::InitEffects() { SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLine2DPathEffect) SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPath2DPathEffect) SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkTrimPE) - - // ImageFilter - SkImageFilter::InitializeFlattenables(); - SkArithmeticImageFilter::InitializeFlattenables(); - SkXfermodeImageFilter::InitializeFlattenables(); - SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDilateImageFilter) - SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDisplacementMapEffect) - SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDropShadowImageFilter) - SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkErodeImageFilter) - SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkImageSource) - SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLocalMatrixImageFilter) - SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPaintImageFilter) - SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPictureImageFilter) - SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkTileImageFilter) - 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) - SkLightingImageFilter::InitializeFlattenables(); } diff --git a/src/ports/SkGlobalInitialization_default_imagefilters.cpp b/src/ports/SkGlobalInitialization_default_imagefilters.cpp new file mode 100644 index 0000000000..5d731778e3 --- /dev/null +++ b/src/ports/SkGlobalInitialization_default_imagefilters.cpp @@ -0,0 +1,57 @@ +/* + * Copyright 2011 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#include "SkFlattenablePriv.h" +#include "SkAlphaThresholdFilter.h" +#include "SkBlurImageFilter.h" +#include "SkColorFilterImageFilter.h" +#include "SkComposeImageFilter.h" +#include "SkDisplacementMapEffect.h" +#include "SkDropShadowImageFilter.h" +#include "SkImageSource.h" +#include "SkLightingImageFilter.h" +#include "SkLocalMatrixImageFilter.h" +#include "SkMagnifierImageFilter.h" +#include "SkMatrixConvolutionImageFilter.h" +#include "SkMergeImageFilter.h" +#include "SkMorphologyImageFilter.h" +#include "SkOffsetImageFilter.h" +#include "SkPaintImageFilter.h" +#include "SkPictureImageFilter.h" +#include "SkTileImageFilter.h" +#include "SkXfermodeImageFilter.h" + +/* + * None of these are strictly "required" for Skia to operate. + * + * These are the bulk of our "effects" -- subclasses of various effects on SkPaint. + * + * Clients should feel free to dup this file and modify it as needed. This function "InitEffects" + * will automatically be called before any of skia's effects are asked to be deserialized. + */ +void SkFlattenable::PrivateInitializer::InitImageFilters() { + SkAlphaThresholdFilter::InitializeFlattenables(); + SkImageFilter::InitializeFlattenables(); + SkArithmeticImageFilter::InitializeFlattenables(); + SkXfermodeImageFilter::InitializeFlattenables(); + SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDilateImageFilter) + SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDisplacementMapEffect) + SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDropShadowImageFilter) + SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkErodeImageFilter) + SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkImageSource) + SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLocalMatrixImageFilter) + SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPaintImageFilter) + SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPictureImageFilter) + SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkTileImageFilter) + 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) + SkLightingImageFilter::InitializeFlattenables(); +} diff --git a/src/ports/SkGlobalInitialization_none_imagefilters.cpp b/src/ports/SkGlobalInitialization_none_imagefilters.cpp new file mode 100644 index 0000000000..c3b622fa1a --- /dev/null +++ b/src/ports/SkGlobalInitialization_none_imagefilters.cpp @@ -0,0 +1,10 @@ +/* + * Copyright 2017 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#include "SkFlattenable.h" + +void SkFlattenable::PrivateInitializer::InitImageFilters() {} |