reorg global initialization, separating core from optional
Chrome will be changed to just inherit our files, with no need to have their own copy. see https://codereview.chromium.org/1581533007/ BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1580873002 Review URL: https://codereview.chromium.org/1580873002
This commit is contained in:
parent
f5883a6d75
commit
6054d686e6
@ -127,6 +127,7 @@
|
||||
'<(skia_src_path)/core/SkFontStream.h',
|
||||
'<(skia_src_path)/core/SkGeometry.cpp',
|
||||
'<(skia_src_path)/core/SkGeometry.h',
|
||||
'<(skia_src_path)/core/SkGlobalInitialization_core.cpp',
|
||||
'<(skia_src_path)/core/SkGlyph.h',
|
||||
'<(skia_src_path)/core/SkGlyphCache.cpp',
|
||||
'<(skia_src_path)/core/SkGlyphCache.h',
|
||||
|
@ -49,7 +49,7 @@ class SkPrivateEffectInitializer;
|
||||
#define SK_DECLARE_PUBLIC_FLATTENABLE_DESERIALIZATION_PROCS(flattenable) \
|
||||
private: \
|
||||
static SkFlattenable* CreateProc(SkReadBuffer&); \
|
||||
friend class ::SkPrivateEffectInitializer; \
|
||||
friend class SkFlattenable::PrivateInitializer; \
|
||||
public: \
|
||||
Factory getFactory() const override { return CreateProc; }
|
||||
|
||||
@ -108,6 +108,13 @@ public:
|
||||
*/
|
||||
virtual void flatten(SkWriteBuffer&) const {}
|
||||
|
||||
protected:
|
||||
class PrivateInitializer {
|
||||
public:
|
||||
static void InitCore();
|
||||
static void InitEffects();
|
||||
};
|
||||
|
||||
private:
|
||||
static void InitializeFlattenablesIfNeeded();
|
||||
|
||||
|
59
src/core/SkGlobalInitialization_core.cpp
Normal file
59
src/core/SkGlobalInitialization_core.cpp
Normal file
@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright 2016 Google Inc.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license that can be
|
||||
* found in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "SkBitmapProcShader.h"
|
||||
#include "SkColorFilter.h"
|
||||
#include "SkColorFilterShader.h"
|
||||
#include "SkColorShader.h"
|
||||
#include "SkComposeShader.h"
|
||||
#include "SkEmptyShader.h"
|
||||
#include "SkFlattenable.h"
|
||||
#include "SkImageShader.h"
|
||||
#include "SkLocalMatrixShader.h"
|
||||
#include "SkOnce.h"
|
||||
#include "SkPathEffect.h"
|
||||
#include "SkPictureShader.h"
|
||||
#include "SkMatrixImageFilter.h"
|
||||
#include "SkXfermode.h"
|
||||
|
||||
/*
|
||||
* Registers all of the required effects subclasses for picture deserialization.
|
||||
*
|
||||
* Optional subclasses (e.g. Blur) should be registered in the ports/ version of this file,
|
||||
* inside the InitEffects() method.
|
||||
*/
|
||||
void SkFlattenable::PrivateInitializer::InitCore() {
|
||||
// Shader
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBitmapProcShader)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColorFilterShader)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColorShader)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkComposeShader)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkEmptyShader)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkImageShader)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLocalMatrixShader)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPictureShader)
|
||||
|
||||
// PathEffect
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkComposePathEffect)
|
||||
|
||||
// ImageFilter
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkMatrixImageFilter)
|
||||
|
||||
// ColorFilter
|
||||
SkColorFilter::InitializeFlattenables();
|
||||
|
||||
// Xfermode
|
||||
SkXfermode::InitializeFlattenables();
|
||||
|
||||
// Now initialize any optional/additional effects (implemented in src/ports)
|
||||
InitEffects();
|
||||
};
|
||||
|
||||
SK_DECLARE_STATIC_ONCE(once);
|
||||
void SkFlattenable::InitializeFlattenablesIfNeeded() {
|
||||
SkOnce(&once, SkFlattenable::PrivateInitializer::InitCore);
|
||||
}
|
@ -1,151 +0,0 @@
|
||||
/*
|
||||
* 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 "SkTypes.h"
|
||||
|
||||
#include "SkBitmapProcShader.h"
|
||||
#include "SkMallocPixelRef.h"
|
||||
#include "SkPathEffect.h"
|
||||
#include "SkPixelRef.h"
|
||||
#include "SkXfermode.h"
|
||||
|
||||
#include "Sk1DPathEffect.h"
|
||||
#include "Sk2DPathEffect.h"
|
||||
#include "SkAlphaThresholdFilter.h"
|
||||
#include "SkArithmeticMode.h"
|
||||
#include "SkArcToPathEffect.h"
|
||||
#include "SkBitmapSourceDeserializer.h"
|
||||
#include "SkBlurDrawLooper.h"
|
||||
#include "SkBlurImageFilter.h"
|
||||
#include "SkBlurMaskFilter.h"
|
||||
#include "SkColorCubeFilter.h"
|
||||
#include "SkColorFilter.h"
|
||||
#include "SkColorFilterImageFilter.h"
|
||||
#include "SkColorFilterShader.h"
|
||||
#include "SkColorMatrixFilter.h"
|
||||
#include "SkColorShader.h"
|
||||
#include "SkComposeImageFilter.h"
|
||||
#include "SkComposeShader.h"
|
||||
#include "SkCornerPathEffect.h"
|
||||
#include "SkDashPathEffect.h"
|
||||
#include "SkDiscretePathEffect.h"
|
||||
#include "SkDisplacementMapEffect.h"
|
||||
#include "SkDropShadowImageFilter.h"
|
||||
#include "SkEmptyShader.h"
|
||||
#include "SkEmbossMaskFilter.h"
|
||||
#include "SkFlattenable.h"
|
||||
#include "SkGradientShader.h"
|
||||
#include "SkImageShader.h"
|
||||
#include "SkImageSource.h"
|
||||
#include "SkLayerDrawLooper.h"
|
||||
#include "SkLayerRasterizer.h"
|
||||
#include "SkLerpXfermode.h"
|
||||
#include "SkLightingImageFilter.h"
|
||||
#include "SkLightingShader.h"
|
||||
#include "SkLocalMatrixShader.h"
|
||||
#include "SkLumaColorFilter.h"
|
||||
#include "SkMagnifierImageFilter.h"
|
||||
#include "SkMatrixConvolutionImageFilter.h"
|
||||
#include "SkMergeImageFilter.h"
|
||||
#include "SkMorphologyImageFilter.h"
|
||||
#include "SkOffsetImageFilter.h"
|
||||
#include "SkOnce.h"
|
||||
#include "SkPaintImageFilter.h"
|
||||
#include "SkPerlinNoiseShader.h"
|
||||
#include "SkPictureImageFilter.h"
|
||||
#include "SkPictureShader.h"
|
||||
#include "SkPixelXorXfermode.h"
|
||||
#include "SkTableColorFilter.h"
|
||||
#include "SkTestImageFilters.h"
|
||||
#include "SkTileImageFilter.h"
|
||||
#include "SkMatrixImageFilter.h"
|
||||
#include "SkXfermodeImageFilter.h"
|
||||
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
//
|
||||
// Adding new classes to Init() below has security consequences in Chrome.
|
||||
//
|
||||
// In particular, it is important that we don't create code paths that
|
||||
// deserialize untrusted data as SkImageFilters; SkImageFilters are sent from
|
||||
// Chrome renderers (untrusted) to the main (trusted) process.
|
||||
//
|
||||
// If you add a new SkImageFilter here _or_ other effect that can be part of
|
||||
// an SkImageFilter, it's a good idea to have chrome-security@google.com sign
|
||||
// off on the CL, and at minimum extend SampleFilterFuzz.cpp to fuzz it.
|
||||
//
|
||||
// SkPictures are untrusted data. Please be extremely careful not to allow
|
||||
// SkPictures created in a Chrome renderer to be deserialized in the main process.
|
||||
//
|
||||
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
||||
|
||||
class SkPrivateEffectInitializer {
|
||||
public:
|
||||
static void Init() {
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkArcToPathEffect)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBitmapProcShader)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBitmapSourceDeserializer)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurDrawLooper)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurImageFilter)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColorCubeFilter)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColorFilterShader)
|
||||
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(SkImageShader)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkImageSource)
|
||||
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(SkPaintImageFilter)
|
||||
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(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)
|
||||
|
||||
SkAlphaThresholdFilter::InitializeFlattenables();
|
||||
SkArithmeticMode::InitializeFlattenables();
|
||||
SkBlurMaskFilter::InitializeFlattenables();
|
||||
SkColorFilter::InitializeFlattenables();
|
||||
SkGradientShader::InitializeFlattenables();
|
||||
SkLightingImageFilter::InitializeFlattenables();
|
||||
SkLightingShader::InitializeFlattenables();
|
||||
SkTableColorFilter::InitializeFlattenables();
|
||||
SkXfermode::InitializeFlattenables();
|
||||
}
|
||||
};
|
||||
|
||||
SK_DECLARE_STATIC_ONCE(once);
|
||||
void SkFlattenable::InitializeFlattenablesIfNeeded() {
|
||||
SkOnce(&once, SkPrivateEffectInitializer::Init);
|
||||
}
|
@ -5,10 +5,6 @@
|
||||
* found in the LICENSE file.
|
||||
*/
|
||||
|
||||
#include "SkBitmapProcShader.h"
|
||||
#include "SkPathEffect.h"
|
||||
#include "SkXfermode.h"
|
||||
|
||||
#include "Sk1DPathEffect.h"
|
||||
#include "Sk2DPathEffect.h"
|
||||
#include "SkAlphaThresholdFilter.h"
|
||||
@ -19,112 +15,103 @@
|
||||
#include "SkBlurImageFilter.h"
|
||||
#include "SkBlurMaskFilter.h"
|
||||
#include "SkColorCubeFilter.h"
|
||||
#include "SkColorFilter.h"
|
||||
#include "SkColorFilterImageFilter.h"
|
||||
#include "SkColorFilterShader.h"
|
||||
#include "SkColorMatrixFilter.h"
|
||||
#include "SkColorShader.h"
|
||||
#include "SkComposeImageFilter.h"
|
||||
#include "SkComposeShader.h"
|
||||
#include "SkCornerPathEffect.h"
|
||||
#include "SkDashPathEffect.h"
|
||||
#include "SkDiscretePathEffect.h"
|
||||
#include "SkDisplacementMapEffect.h"
|
||||
#include "SkDropShadowImageFilter.h"
|
||||
#include "SkEmptyShader.h"
|
||||
#include "SkEmbossMaskFilter.h"
|
||||
#include "SkFlattenable.h"
|
||||
#include "SkGradientShader.h"
|
||||
#include "SkImageShader.h"
|
||||
#include "SkImageSource.h"
|
||||
#include "SkLayerDrawLooper.h"
|
||||
#include "SkLayerRasterizer.h"
|
||||
#include "SkLerpXfermode.h"
|
||||
#include "SkLightingImageFilter.h"
|
||||
#include "SkLightingShader.h"
|
||||
#include "SkLocalMatrixShader.h"
|
||||
#include "SkLumaColorFilter.h"
|
||||
#include "SkMagnifierImageFilter.h"
|
||||
#include "SkMatrixConvolutionImageFilter.h"
|
||||
#include "SkMergeImageFilter.h"
|
||||
#include "SkMorphologyImageFilter.h"
|
||||
#include "SkOffsetImageFilter.h"
|
||||
#include "SkOnce.h"
|
||||
#include "SkPaintImageFilter.h"
|
||||
#include "SkPerlinNoiseShader.h"
|
||||
#include "SkPictureImageFilter.h"
|
||||
#include "SkPictureShader.h"
|
||||
#include "SkPixelXorXfermode.h"
|
||||
#include "SkTableColorFilter.h"
|
||||
#include "SkTestImageFilters.h"
|
||||
#include "SkTileImageFilter.h"
|
||||
#include "SkMatrixImageFilter.h"
|
||||
#include "SkXfermodeImageFilter.h"
|
||||
|
||||
class SkPrivateEffectInitializer {
|
||||
public:
|
||||
static void Init() {
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkArcToPathEffect)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBitmapProcShader)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBitmapSourceDeserializer)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurDrawLooper)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurImageFilter)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColorCubeFilter)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColorMatrixFilter)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColorFilterShader)
|
||||
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(SkImageShader)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkImageSource)
|
||||
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(SkPaintImageFilter)
|
||||
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(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)
|
||||
/*
|
||||
* 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::InitEffects() {
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBitmapSourceDeserializer)
|
||||
|
||||
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)
|
||||
// MaskFilter
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkEmbossMaskFilter)
|
||||
SkBlurMaskFilter::InitializeFlattenables();
|
||||
|
||||
SkAlphaThresholdFilter::InitializeFlattenables();
|
||||
SkArithmeticMode::InitializeFlattenables();
|
||||
SkBlurMaskFilter::InitializeFlattenables();
|
||||
SkColorFilter::InitializeFlattenables();
|
||||
SkGradientShader::InitializeFlattenables();
|
||||
SkLightingImageFilter::InitializeFlattenables();
|
||||
SkLightingShader::InitializeFlattenables();
|
||||
SkTableColorFilter::InitializeFlattenables();
|
||||
SkXfermode::InitializeFlattenables();
|
||||
}
|
||||
};
|
||||
// DrawLooper
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurDrawLooper)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLayerDrawLooper)
|
||||
|
||||
SK_DECLARE_STATIC_ONCE(once);
|
||||
void SkFlattenable::InitializeFlattenablesIfNeeded() {
|
||||
SkOnce(&once, SkPrivateEffectInitializer::Init);
|
||||
// Rasterizer
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLayerRasterizer)
|
||||
|
||||
// ColorFilter
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColorCubeFilter)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkColorMatrixFilter)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLumaColorFilter)
|
||||
SkAlphaThresholdFilter::InitializeFlattenables();
|
||||
SkArithmeticMode::InitializeFlattenables();
|
||||
SkTableColorFilter::InitializeFlattenables();
|
||||
|
||||
// Shader
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPerlinNoiseShader)
|
||||
SkGradientShader::InitializeFlattenables();
|
||||
SkLightingShader::InitializeFlattenables();
|
||||
|
||||
// Xfermode
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLerpXfermode)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPixelXorXfermode)
|
||||
|
||||
// PathEffect
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkArcToPathEffect)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkCornerPathEffect)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDashPathEffect)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkDiscretePathEffect)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPath1DPathEffect)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkLine2DPathEffect)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPath2DPathEffect)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkSumPathEffect)
|
||||
|
||||
// ImageFilter
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurImageFilter)
|
||||
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(SkPaintImageFilter)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkPictureImageFilter)
|
||||
SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkTileImageFilter)
|
||||
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)
|
||||
SkLightingImageFilter::InitializeFlattenables();
|
||||
}
|
||||
|
10
src/ports/SkGlobalInitialization_none.cpp
Normal file
10
src/ports/SkGlobalInitialization_none.cpp
Normal file
@ -0,0 +1,10 @@
|
||||
/*
|
||||
* Copyright 2016 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::InitEffects() {}
|
Loading…
Reference in New Issue
Block a user