Simplify flattening to just write enough to call the factory/public-constructor for...
authorreed <reed@google.com>
Thu, 21 Aug 2014 14:59:51 +0000 (07:59 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 21 Aug 2014 14:59:51 +0000 (07:59 -0700)
commit9fa60daad4d5f54c0dbe3dbcc7608a8f6d721187
tree59cc3af7f1a48aec372c05ca29a2fbef703bceb8
parent5d74806b478a884bd763aee7e3e33cff1c506e50
Simplify flattening to just write enough to call the factory/public-constructor for the class. We want to *not* rely on private constructors, and not rely on calling through the inheritance hierarchy for either flattening or unflattening(CreateProc).

Refactoring pattern:

1. guard the existing constructor(readbuffer) with the legacy build-flag
2. If you are a instancable subclass, implement CreateProc(readbuffer) to create a new instances from the buffer params (or return NULL).

If you're a shader subclass
1. You must read/write the local matrix if your class accepts that in its factory/constructor, else ignore it.

R=robertphillips@google.com, mtklein@google.com, senorblanco@google.com, senorblanco@chromium.org, sugoi@chromium.org

Author: reed@google.com

Review URL: https://codereview.chromium.org/395603002
128 files changed:
gm/imagefiltersbase.cpp
gm/imagefiltersgraph.cpp
include/core/SkColorFilter.h
include/core/SkDrawLooper.h
include/core/SkFlattenable.h
include/core/SkImageFilter.h
include/core/SkMaskFilter.h
include/core/SkPathEffect.h
include/core/SkPicture.h
include/core/SkRasterizer.h
include/core/SkShader.h
include/core/SkXfermode.h
include/effects/Sk1DPathEffect.h
include/effects/Sk2DPathEffect.h
include/effects/SkAvoidXfermode.h
include/effects/SkBitmapSource.h
include/effects/SkBlurDrawLooper.h
include/effects/SkBlurImageFilter.h
include/effects/SkColorFilterImageFilter.h
include/effects/SkColorMatrixFilter.h
include/effects/SkComposeImageFilter.h
include/effects/SkCornerPathEffect.h
include/effects/SkDashPathEffect.h
include/effects/SkDiscretePathEffect.h
include/effects/SkDisplacementMapEffect.h
include/effects/SkDropShadowImageFilter.h
include/effects/SkEmbossMaskFilter.h
include/effects/SkLayerDrawLooper.h
include/effects/SkLayerRasterizer.h
include/effects/SkLerpXfermode.h
include/effects/SkLightingImageFilter.h
include/effects/SkLumaColorFilter.h
include/effects/SkMagnifierImageFilter.h
include/effects/SkMatrixConvolutionImageFilter.h
include/effects/SkMatrixImageFilter.h
include/effects/SkMergeImageFilter.h
include/effects/SkMorphologyImageFilter.h
include/effects/SkOffsetImageFilter.h
include/effects/SkPerlinNoiseShader.h
include/effects/SkPictureImageFilter.h
include/effects/SkPixelXorXfermode.h
include/effects/SkRectShaderImageFilter.h
include/effects/SkTableMaskFilter.h
include/effects/SkTestImageFilters.h
include/effects/SkTileImageFilter.h
include/effects/SkTransparentShader.h
include/effects/SkXfermodeImageFilter.h
samplecode/ClockFaceView.cpp
samplecode/SampleAll.cpp
src/core/SkBitmapProcShader.cpp
src/core/SkBitmapProcShader.h
src/core/SkBlitter.cpp
src/core/SkComposeShader.cpp
src/core/SkDraw.cpp
src/core/SkEmptyShader.h
src/core/SkFilterShader.cpp
src/core/SkFilterShader.h
src/core/SkFlattenable.cpp
src/core/SkImageFilter.cpp
src/core/SkLocalMatrixShader.cpp
src/core/SkLocalMatrixShader.h
src/core/SkPathEffect.cpp
src/core/SkPictureShader.cpp
src/core/SkReadBuffer.h
src/core/SkShader.cpp
src/core/SkXfermode.cpp
src/core/SkXfermode_proccoeff.h
src/effects/Sk1DPathEffect.cpp
src/effects/Sk2DPathEffect.cpp
src/effects/SkAlphaThresholdFilter.cpp
src/effects/SkArithmeticMode.cpp
src/effects/SkAvoidXfermode.cpp
src/effects/SkBitmapSource.cpp
src/effects/SkBlurDrawLooper.cpp
src/effects/SkBlurImageFilter.cpp
src/effects/SkBlurMaskFilter.cpp
src/effects/SkColorFilterImageFilter.cpp
src/effects/SkColorFilters.cpp
src/effects/SkColorMatrixFilter.cpp
src/effects/SkComposeImageFilter.cpp
src/effects/SkCornerPathEffect.cpp
src/effects/SkDashPathEffect.cpp
src/effects/SkDiscretePathEffect.cpp
src/effects/SkDisplacementMapEffect.cpp
src/effects/SkDropShadowImageFilter.cpp
src/effects/SkEmbossMaskFilter.cpp
src/effects/SkLayerDrawLooper.cpp
src/effects/SkLayerRasterizer.cpp
src/effects/SkLerpXfermode.cpp
src/effects/SkLightingImageFilter.cpp
src/effects/SkLumaColorFilter.cpp
src/effects/SkMagnifierImageFilter.cpp
src/effects/SkMatrixConvolutionImageFilter.cpp
src/effects/SkMatrixImageFilter.cpp
src/effects/SkMergeImageFilter.cpp
src/effects/SkMorphologyImageFilter.cpp
src/effects/SkOffsetImageFilter.cpp
src/effects/SkPerlinNoiseShader.cpp
src/effects/SkPictureImageFilter.cpp
src/effects/SkPixelXorXfermode.cpp
src/effects/SkRectShaderImageFilter.cpp
src/effects/SkTableColorFilter.cpp
src/effects/SkTableMaskFilter.cpp
src/effects/SkTestImageFilters.cpp
src/effects/SkTileImageFilter.cpp
src/effects/SkTransparentShader.cpp
src/effects/SkXfermodeImageFilter.cpp
src/effects/gradients/SkGradientShader.cpp
src/effects/gradients/SkGradientShaderPriv.h
src/effects/gradients/SkLinearGradient.cpp
src/effects/gradients/SkLinearGradient.h
src/effects/gradients/SkRadialGradient.cpp
src/effects/gradients/SkRadialGradient.h
src/effects/gradients/SkSweepGradient.cpp
src/effects/gradients/SkSweepGradient.h
src/effects/gradients/SkTwoPointConicalGradient.cpp
src/effects/gradients/SkTwoPointConicalGradient.h
src/effects/gradients/SkTwoPointRadialGradient.cpp
src/effects/gradients/SkTwoPointRadialGradient.h
src/opts/SkXfermode_opts_SSE2.cpp
src/opts/SkXfermode_opts_SSE2.h
src/opts/SkXfermode_opts_arm_neon.cpp
src/opts/SkXfermode_opts_arm_neon.h
src/ports/SkGlobalInitialization_chromium.cpp
src/ports/SkGlobalInitialization_default.cpp
tests/GLProgramsTest.cpp
tests/ImageFilterTest.cpp
tests/LayerRasterizerTest.cpp