From a0c2bc24381fea063008f9c8823756eb020603b3 Mon Sep 17 00:00:00 2001 From: "scroggo@google.com" Date: Fri, 21 Sep 2012 17:54:46 +0000 Subject: [PATCH] Make flattenables no longer depend on global static initializers. Instead, force all builds to call InitializeFlattenables. Remove the make_debugger script, which was created to force rebuilding without global static initializers so that all flattenables would be linked. It is no longer necessary since all flattenables will be linked thanks to InitializeFlattenables, which now can (and must) be called when global static initializers are turned on. BUG=https://code.google.com/p/skia/issues/detail?id=903 BUG=https://code.google.com/p/skia/issues/detail?id=902 Review URL: https://codereview.appspot.com/6548044 git-svn-id: http://skia.googlecode.com/svn/trunk@5642 2bbb7eff-a529-9590-31e7-b0007b416f81 --- debugger/make_debugger.sh | 12 ----------- include/core/SkFlattenable.h | 20 ------------------- src/core/SkAnnotation.cpp | 2 -- src/core/SkBitmapProcShader.cpp | 2 -- src/core/SkColorTable.cpp | 2 -- src/core/SkComposeShader.cpp | 3 --- src/core/SkData.cpp | 4 ---- src/core/SkFlattenable.cpp | 6 +++--- src/core/SkGraphics.cpp | 2 -- src/core/SkMallocPixelRef.cpp | 2 -- src/core/SkPathEffect.cpp | 6 ------ src/core/SkShader.cpp | 4 ---- src/effects/Sk1DPathEffect.cpp | 5 ----- src/effects/Sk2DPathEffect.cpp | 8 -------- src/effects/SkAvoidXfermode.cpp | 2 -- src/effects/SkBitmapSource.cpp | 2 -- src/effects/SkBlendImageFilter.cpp | 2 -- src/effects/SkBlurDrawLooper.cpp | 5 ----- src/effects/SkBlurImageFilter.cpp | 2 -- src/effects/SkColorFilterImageFilter.cpp | 3 --- src/effects/SkColorMatrixFilter.cpp | 2 -- src/effects/SkCornerPathEffect.cpp | 3 --- src/effects/SkDashPathEffect.cpp | 4 ---- src/effects/SkDiscretePathEffect.cpp | 5 ----- src/effects/SkEmbossMaskFilter.cpp | 2 -- src/effects/SkLayerDrawLooper.cpp | 4 ---- src/effects/SkLayerRasterizer.cpp | 3 --- src/effects/SkMagnifierImageFilter.cpp | 2 -- .../SkMatrixConvolutionImageFilter.cpp | 2 -- src/effects/SkMorphologyImageFilter.cpp | 3 --- src/effects/SkPixelXorXfermode.cpp | 2 -- src/effects/SkRectShape.cpp | 3 --- src/effects/SkSingleInputImageFilter.cpp | 2 -- src/effects/SkStippleMaskFilter.cpp | 2 -- src/effects/SkTestImageFilters.cpp | 5 ----- src/effects/SkTransparentShader.cpp | 2 -- src/image/SkDataPixelRef.cpp | 2 -- src/images/SkFlipPixelRef.cpp | 2 -- src/images/SkImageRef_GlobalPool.cpp | 2 -- src/ports/SkGlobalInitialization_default.cpp | 4 ---- src/ports/SkImageRef_ashmem.cpp | 2 -- src/utils/SkUnitMappers.cpp | 3 --- tests/GLProgramsTest.cpp | 5 ----- 43 files changed, 3 insertions(+), 157 deletions(-) delete mode 100755 debugger/make_debugger.sh diff --git a/debugger/make_debugger.sh b/debugger/make_debugger.sh deleted file mode 100755 index 86a7ff988..000000000 --- a/debugger/make_debugger.sh +++ /dev/null @@ -1,12 +0,0 @@ -# Used to recompile required skia libraries with static initializers turned -# off. This fixes a bug in which the linux compiler was incorrectly stripping -# required global static methods in an optimization effort. - -SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -CWD=$SCRIPT_DIR/../ - -DEFINES="skia_static_initializers=0" -export GYP_DEFINES="$DEFINES" - -make clean -C $CWD -make -C $CWD debugger -j diff --git a/include/core/SkFlattenable.h b/include/core/SkFlattenable.h index 6df9f9b06..0b21abcc7 100644 --- a/include/core/SkFlattenable.h +++ b/include/core/SkFlattenable.h @@ -15,22 +15,6 @@ class SkFlattenableReadBuffer; class SkFlattenableWriteBuffer; -#if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS - -#define SK_DEFINE_FLATTENABLE_REGISTRAR(flattenable) \ - static SkFlattenable::Registrar g##flattenable##Reg(#flattenable, \ - flattenable::CreateProc); -#define SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(flattenable) \ - static SkFlattenable::Registrar g##flattenable##Reg(#flattenable, \ - flattenable::CreateProc); - -#define SK_DECLARE_FLATTENABLE_REGISTRAR_GROUP() -#define SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(flattenable) -#define SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END - -#else - -#define SK_DEFINE_FLATTENABLE_REGISTRAR(flattenable) #define SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(flattenable) \ SkFlattenable::Registrar(#flattenable, flattenable::CreateProc); @@ -42,8 +26,6 @@ class SkFlattenableWriteBuffer; #define SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END \ } -#endif - #define SK_DECLARE_UNFLATTENABLE_OBJECT() \ virtual Factory getFactory() SK_OVERRIDE { return NULL; }; \ @@ -93,9 +75,7 @@ protected: virtual void flatten(SkFlattenableWriteBuffer&) const; private: -#if !SK_ALLOW_STATIC_GLOBAL_INITIALIZERS static void InitializeFlattenables(); -#endif friend class SkGraphics; friend class SkFlattenableWriteBuffer; diff --git a/src/core/SkAnnotation.cpp b/src/core/SkAnnotation.cpp index 62f865d15..81767611b 100644 --- a/src/core/SkAnnotation.cpp +++ b/src/core/SkAnnotation.cpp @@ -38,8 +38,6 @@ void SkAnnotation::flatten(SkFlattenableWriteBuffer& buffer) const { buffer.writeFlattenable(fDataSet); } -SK_DEFINE_FLATTENABLE_REGISTRAR(SkAnnotation) - const char* SkAnnotationKeys::URL_Key() { return "SkAnnotationKey_URL"; }; diff --git a/src/core/SkBitmapProcShader.cpp b/src/core/SkBitmapProcShader.cpp index dc669ccf4..43a6b0a7b 100644 --- a/src/core/SkBitmapProcShader.cpp +++ b/src/core/SkBitmapProcShader.cpp @@ -299,8 +299,6 @@ SkShader* SkShader::CreateBitmapShader(const SkBitmap& src, return shader; } -SK_DEFINE_FLATTENABLE_REGISTRAR(SkBitmapProcShader) - /////////////////////////////////////////////////////////////////////////////// static const char* gTileModeName[] = { diff --git a/src/core/SkColorTable.cpp b/src/core/SkColorTable.cpp index 2a27906a9..1375c5838 100644 --- a/src/core/SkColorTable.cpp +++ b/src/core/SkColorTable.cpp @@ -155,5 +155,3 @@ void SkColorTable::flatten(SkFlattenableWriteBuffer& buffer) const { buffer.writeUInt(fFlags); buffer.writeColorArray(fColors, fCount); } - -SK_DEFINE_FLATTENABLE_REGISTRAR(SkColorTable) diff --git a/src/core/SkComposeShader.cpp b/src/core/SkComposeShader.cpp index af3f3a5f2..e925ab562 100644 --- a/src/core/SkComposeShader.cpp +++ b/src/core/SkComposeShader.cpp @@ -165,6 +165,3 @@ void SkComposeShader::shadeSpan(int x, int y, SkPMColor result[], int count) { } while (count > 0); } } - -SK_DEFINE_FLATTENABLE_REGISTRAR(SkComposeShader) - diff --git a/src/core/SkData.cpp b/src/core/SkData.cpp index 4274f2b8e..3e0c71a0e 100644 --- a/src/core/SkData.cpp +++ b/src/core/SkData.cpp @@ -141,8 +141,6 @@ SkData::SkData(SkFlattenableReadBuffer& buffer) { buffer.readByteArray(const_cast(fPtr)); } -SK_DEFINE_FLATTENABLE_REGISTRAR(SkData) - /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// @@ -302,5 +300,3 @@ SkDataSet* SkDataSet::NewEmpty() { gEmptySet->ref(); return gEmptySet; } - -SK_DEFINE_FLATTENABLE_REGISTRAR(SkDataSet) diff --git a/src/core/SkFlattenable.cpp b/src/core/SkFlattenable.cpp index 52377c7d6..b4efe9100 100644 --- a/src/core/SkFlattenable.cpp +++ b/src/core/SkFlattenable.cpp @@ -90,7 +90,7 @@ void SkFlattenable::Register(const char name[], Factory factory) { gCount += 1; } -#if !SK_ALLOW_STATIC_GLOBAL_INITIALIZERS && defined(SK_DEBUG) +#ifdef SK_DEBUG static void report_no_entries(const char* functionName) { if (!gCount) { SkDebugf("%s has no registered name/factory pairs." @@ -101,7 +101,7 @@ static void report_no_entries(const char* functionName) { #endif SkFlattenable::Factory SkFlattenable::NameToFactory(const char name[]) { -#if !SK_ALLOW_STATIC_GLOBAL_INITIALIZERS && defined(SK_DEBUG) +#ifdef SK_DEBUG report_no_entries(__FUNCTION__); #endif const Pair* pairs = gPairs; @@ -114,7 +114,7 @@ SkFlattenable::Factory SkFlattenable::NameToFactory(const char name[]) { } const char* SkFlattenable::FactoryToName(Factory fact) { -#if !SK_ALLOW_STATIC_GLOBAL_INITIALIZERS && defined(SK_DEBUG) +#ifdef SK_DEBUG report_no_entries(__FUNCTION__); #endif const Pair* pairs = gPairs; diff --git a/src/core/SkGraphics.cpp b/src/core/SkGraphics.cpp index 64f92646c..53d031825 100644 --- a/src/core/SkGraphics.cpp +++ b/src/core/SkGraphics.cpp @@ -52,9 +52,7 @@ void SkGraphics::GetVersion(int32_t* major, int32_t* minor, int32_t* patch) { #endif void SkGraphics::Init() { -#if !SK_ALLOW_STATIC_GLOBAL_INITIALIZERS SkFlattenable::InitializeFlattenables(); -#endif #ifdef BUILD_EMBOSS_TABLE SkEmbossMask_BuildTable(); #endif diff --git a/src/core/SkMallocPixelRef.cpp b/src/core/SkMallocPixelRef.cpp index 71e672b84..d70098396 100644 --- a/src/core/SkMallocPixelRef.cpp +++ b/src/core/SkMallocPixelRef.cpp @@ -64,5 +64,3 @@ SkMallocPixelRef::SkMallocPixelRef(SkFlattenableReadBuffer& buffer) this->setPreLocked(fStorage, fCTable); } - -SK_DEFINE_FLATTENABLE_REGISTRAR(SkMallocPixelRef) diff --git a/src/core/SkPathEffect.cpp b/src/core/SkPathEffect.cpp index 84b590d4f..d706e8dab 100644 --- a/src/core/SkPathEffect.cpp +++ b/src/core/SkPathEffect.cpp @@ -171,9 +171,3 @@ bool SkSumPathEffect::filterPath(SkPath* dst, const SkPath& src, // use bit-or so that we always call both, even if the first one succeeds return fPE0->filterPath(dst, src, rec) | fPE1->filterPath(dst, src, rec); } - -/////////////////////////////////////////////////////////////////////////////// - -SK_DEFINE_FLATTENABLE_REGISTRAR(SkComposePathEffect) -SK_DEFINE_FLATTENABLE_REGISTRAR(SkSumPathEffect) - diff --git a/src/core/SkShader.cpp b/src/core/SkShader.cpp index 40fe838f9..97cca5f81 100644 --- a/src/core/SkShader.cpp +++ b/src/core/SkShader.cpp @@ -332,8 +332,6 @@ SkShader::GradientType SkColorShader::asAGradient(GradientInfo* info) const { return kColor_GradientType; } -SK_DEFINE_FLATTENABLE_REGISTRAR(SkColorShader) - /////////////////////////////////////////////////////////////////////////////// #include "SkEmptyShader.h" @@ -355,5 +353,3 @@ void SkEmptyShader::shadeSpan16(int x, int y, uint16_t span[], int count) { void SkEmptyShader::shadeSpanAlpha(int x, int y, uint8_t alpha[], int count) { SkDEBUGFAIL("should never get called, since setContext() returned false"); } - -SK_DEFINE_FLATTENABLE_REGISTRAR(SkEmptyShader) diff --git a/src/effects/Sk1DPathEffect.cpp b/src/effects/Sk1DPathEffect.cpp index 6536826d6..98345d0f0 100644 --- a/src/effects/Sk1DPathEffect.cpp +++ b/src/effects/Sk1DPathEffect.cpp @@ -197,8 +197,3 @@ SkScalar SkPath1DPathEffect::next(SkPath* dst, SkScalar distance, } return fAdvance; } - -/////////////////////////////////////////////////////////////////////////////// - -SK_DEFINE_FLATTENABLE_REGISTRAR(SkPath1DPathEffect) - diff --git a/src/effects/Sk2DPathEffect.cpp b/src/effects/Sk2DPathEffect.cpp index 1f1dce480..e4d782173 100644 --- a/src/effects/Sk2DPathEffect.cpp +++ b/src/effects/Sk2DPathEffect.cpp @@ -76,8 +76,6 @@ Sk2DPathEffect::Sk2DPathEffect(SkFlattenableReadBuffer& buffer) { fMatrixIsInvertible = fMatrix.invert(&fInverse); } -SK_DEFINE_FLATTENABLE_REGISTRAR(Sk2DPathEffect) - /////////////////////////////////////////////////////////////////////////////// bool SkLine2DPathEffect::filterPath(SkPath *dst, const SkPath &src, SkStrokeRec *rec) { @@ -110,8 +108,6 @@ void SkLine2DPathEffect::flatten(SkFlattenableWriteBuffer &buffer) const { buffer.writeScalar(fWidth); } -SK_DEFINE_FLATTENABLE_REGISTRAR(SkLine2DPathEffect) - /////////////////////////////////////////////////////////////////////////////// SkPath2DPathEffect::SkPath2DPathEffect(const SkMatrix& m, const SkPath& p) @@ -131,7 +127,3 @@ void SkPath2DPathEffect::flatten(SkFlattenableWriteBuffer& buffer) const { void SkPath2DPathEffect::next(const SkPoint& loc, int u, int v, SkPath* dst) { dst->addPath(fPath, loc.fX, loc.fY); } - -/////////////////////////////////////////////////////////////////////////////// - -SK_DEFINE_FLATTENABLE_REGISTRAR(SkPath2DPathEffect) diff --git a/src/effects/SkAvoidXfermode.cpp b/src/effects/SkAvoidXfermode.cpp index f828cca86..89ae1f9c8 100644 --- a/src/effects/SkAvoidXfermode.cpp +++ b/src/effects/SkAvoidXfermode.cpp @@ -230,5 +230,3 @@ void SkAvoidXfermode::xferA8(SkAlpha dst[], const SkPMColor src[], int count, co { // override in subclass } - -SK_DEFINE_FLATTENABLE_REGISTRAR(SkAvoidXfermode) diff --git a/src/effects/SkBitmapSource.cpp b/src/effects/SkBitmapSource.cpp index 3092b93c9..8aa0433bc 100644 --- a/src/effects/SkBitmapSource.cpp +++ b/src/effects/SkBitmapSource.cpp @@ -25,5 +25,3 @@ bool SkBitmapSource::onFilterImage(Proxy*, const SkBitmap&, const SkMatrix&, *result = fBitmap; return true; } - -SK_DEFINE_FLATTENABLE_REGISTRAR(SkBitmapSource) diff --git a/src/effects/SkBlendImageFilter.cpp b/src/effects/SkBlendImageFilter.cpp index 94896a87e..2328d95ae 100644 --- a/src/effects/SkBlendImageFilter.cpp +++ b/src/effects/SkBlendImageFilter.cpp @@ -289,5 +289,3 @@ GrGLProgramStage::StageKey GrGLBlendEffect::GenKey(const GrCustomStage& s, const return static_cast(s).mode(); } #endif - -SK_DEFINE_FLATTENABLE_REGISTRAR(SkBlendImageFilter) diff --git a/src/effects/SkBlurDrawLooper.cpp b/src/effects/SkBlurDrawLooper.cpp index 8ba2cfc42..e6e2ffdd8 100644 --- a/src/effects/SkBlurDrawLooper.cpp +++ b/src/effects/SkBlurDrawLooper.cpp @@ -115,8 +115,3 @@ bool SkBlurDrawLooper::next(SkCanvas* canvas, SkPaint* paint) { return false; } } - -/////////////////////////////////////////////////////////////////////////////// - -SK_DEFINE_FLATTENABLE_REGISTRAR(SkBlurDrawLooper) - diff --git a/src/effects/SkBlurImageFilter.cpp b/src/effects/SkBlurImageFilter.cpp index c82262688..2a6146078 100644 --- a/src/effects/SkBlurImageFilter.cpp +++ b/src/effects/SkBlurImageFilter.cpp @@ -197,5 +197,3 @@ GrTexture* SkBlurImageFilter::onFilterImageGPU(GrTexture* src, const SkRect& rec return NULL; #endif } - -SK_DEFINE_FLATTENABLE_REGISTRAR(SkBlurImageFilter) diff --git a/src/effects/SkColorFilterImageFilter.cpp b/src/effects/SkColorFilterImageFilter.cpp index 03e2be46d..f9c8cef5c 100755 --- a/src/effects/SkColorFilterImageFilter.cpp +++ b/src/effects/SkColorFilterImageFilter.cpp @@ -52,6 +52,3 @@ bool SkColorFilterImageFilter::onFilterImage(Proxy* proxy, const SkBitmap& sourc *result = device.get()->accessBitmap(false); return true; } - -SK_DEFINE_FLATTENABLE_REGISTRAR(SkColorFilterImageFilter) - diff --git a/src/effects/SkColorMatrixFilter.cpp b/src/effects/SkColorMatrixFilter.cpp index 64283ab05..2102e9b81 100644 --- a/src/effects/SkColorMatrixFilter.cpp +++ b/src/effects/SkColorMatrixFilter.cpp @@ -317,5 +317,3 @@ bool SkColorMatrixFilter::asColorMatrix(SkScalar matrix[20]) { } return true; } - -SK_DEFINE_FLATTENABLE_REGISTRAR(SkColorMatrixFilter) diff --git a/src/effects/SkCornerPathEffect.cpp b/src/effects/SkCornerPathEffect.cpp index bc5165ac8..1ce62ecc0 100644 --- a/src/effects/SkCornerPathEffect.cpp +++ b/src/effects/SkCornerPathEffect.cpp @@ -137,6 +137,3 @@ void SkCornerPathEffect::flatten(SkFlattenableWriteBuffer& buffer) const { SkCornerPathEffect::SkCornerPathEffect(SkFlattenableReadBuffer& buffer) { fRadius = buffer.readScalar(); } - -SK_DEFINE_FLATTENABLE_REGISTRAR(SkCornerPathEffect) - diff --git a/src/effects/SkDashPathEffect.cpp b/src/effects/SkDashPathEffect.cpp index 3299c6358..3add0d7dd 100644 --- a/src/effects/SkDashPathEffect.cpp +++ b/src/effects/SkDashPathEffect.cpp @@ -256,7 +256,3 @@ SkDashPathEffect::SkDashPathEffect(SkFlattenableReadBuffer& buffer) : INHERITED( fIntervals = (SkScalar*)sk_malloc_throw(sizeof(SkScalar) * fCount); buffer.readScalarArray(fIntervals); } - -/////////////////////////////////////////////////////////////////////////////// - -SK_DEFINE_FLATTENABLE_REGISTRAR(SkDashPathEffect) diff --git a/src/effects/SkDiscretePathEffect.cpp b/src/effects/SkDiscretePathEffect.cpp index d331cdbfb..8a7c30796 100644 --- a/src/effects/SkDiscretePathEffect.cpp +++ b/src/effects/SkDiscretePathEffect.cpp @@ -80,8 +80,3 @@ SkDiscretePathEffect::SkDiscretePathEffect(SkFlattenableReadBuffer& buffer) { fSegLength = buffer.readScalar(); fPerterb = buffer.readScalar(); } - -/////////////////////////////////////////////////////////////////////////////// - -SK_DEFINE_FLATTENABLE_REGISTRAR(SkDiscretePathEffect) - diff --git a/src/effects/SkEmbossMaskFilter.cpp b/src/effects/SkEmbossMaskFilter.cpp index 5ced463b2..6480f50e8 100644 --- a/src/effects/SkEmbossMaskFilter.cpp +++ b/src/effects/SkEmbossMaskFilter.cpp @@ -131,5 +131,3 @@ void SkEmbossMaskFilter::flatten(SkFlattenableWriteBuffer& buffer) const { buffer.writeByteArray(&tmpLight, sizeof(tmpLight)); buffer.writeScalar(fBlurRadius); } - -SK_DEFINE_FLATTENABLE_REGISTRAR(SkEmbossMaskFilter) diff --git a/src/effects/SkLayerDrawLooper.cpp b/src/effects/SkLayerDrawLooper.cpp index e4aef186e..c27908f25 100644 --- a/src/effects/SkLayerDrawLooper.cpp +++ b/src/effects/SkLayerDrawLooper.cpp @@ -245,7 +245,3 @@ SkLayerDrawLooper::SkLayerDrawLooper(SkFlattenableReadBuffer& buffer) } #endif } - -/////////////////////////////////////////////////////////////////////////////// - -SK_DEFINE_FLATTENABLE_REGISTRAR(SkLayerDrawLooper) diff --git a/src/effects/SkLayerRasterizer.cpp b/src/effects/SkLayerRasterizer.cpp index a004b30b0..7365e1213 100644 --- a/src/effects/SkLayerRasterizer.cpp +++ b/src/effects/SkLayerRasterizer.cpp @@ -169,6 +169,3 @@ void SkLayerRasterizer::flatten(SkFlattenableWriteBuffer& buffer) const { buffer.writePoint(rec->fOffset); } } - -SK_DEFINE_FLATTENABLE_REGISTRAR(SkLayerRasterizer) - diff --git a/src/effects/SkMagnifierImageFilter.cpp b/src/effects/SkMagnifierImageFilter.cpp index 4eed17732..cf6430824 100644 --- a/src/effects/SkMagnifierImageFilter.cpp +++ b/src/effects/SkMagnifierImageFilter.cpp @@ -339,5 +339,3 @@ bool SkMagnifierImageFilter::onFilterImage(Proxy*, const SkBitmap& src, } return true; } - -SK_DEFINE_FLATTENABLE_REGISTRAR(SkMagnifierImageFilter) diff --git a/src/effects/SkMatrixConvolutionImageFilter.cpp b/src/effects/SkMatrixConvolutionImageFilter.cpp index e5acf563f..852412bb9 100644 --- a/src/effects/SkMatrixConvolutionImageFilter.cpp +++ b/src/effects/SkMatrixConvolutionImageFilter.cpp @@ -175,5 +175,3 @@ bool SkMatrixConvolutionImageFilter::onFilterImage(Proxy* proxy, filterBorderPixels(src, result, bottom); return true; } - -SK_DEFINE_FLATTENABLE_REGISTRAR(SkMatrixConvolutionImageFilter) diff --git a/src/effects/SkMorphologyImageFilter.cpp b/src/effects/SkMorphologyImageFilter.cpp index 4123ca8e2..5bf9a9978 100644 --- a/src/effects/SkMorphologyImageFilter.cpp +++ b/src/effects/SkMorphologyImageFilter.cpp @@ -489,6 +489,3 @@ GrTexture* SkErodeImageFilter::onFilterImageGPU(GrTexture* src, const SkRect& re } #endif - -SK_DEFINE_FLATTENABLE_REGISTRAR(SkDilateImageFilter) -SK_DEFINE_FLATTENABLE_REGISTRAR(SkErodeImageFilter) diff --git a/src/effects/SkPixelXorXfermode.cpp b/src/effects/SkPixelXorXfermode.cpp index 236aec549..cf454da4c 100644 --- a/src/effects/SkPixelXorXfermode.cpp +++ b/src/effects/SkPixelXorXfermode.cpp @@ -28,5 +28,3 @@ SkPixelXorXfermode::SkPixelXorXfermode(SkFlattenableReadBuffer& rb) : INHERITED(rb) { fOpColor = rb.readColor(); } - -SK_DEFINE_FLATTENABLE_REGISTRAR(SkPixelXorXfermode) diff --git a/src/effects/SkRectShape.cpp b/src/effects/SkRectShape.cpp index 06631061c..52c3b372c 100644 --- a/src/effects/SkRectShape.cpp +++ b/src/effects/SkRectShape.cpp @@ -85,6 +85,3 @@ void SkPaintShape::flatten(SkFlattenableWriteBuffer& buffer) const { SkPaintShape::SkPaintShape(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) { buffer.readPaint(&fPaint); } - -SK_DEFINE_FLATTENABLE_REGISTRAR(SkRectShape) - diff --git a/src/effects/SkSingleInputImageFilter.cpp b/src/effects/SkSingleInputImageFilter.cpp index 291d81cf1..a1c4292fa 100644 --- a/src/effects/SkSingleInputImageFilter.cpp +++ b/src/effects/SkSingleInputImageFilter.cpp @@ -81,5 +81,3 @@ GrTexture* SkSingleInputImageFilter::getInputResultAsTexture(GrTexture* src, return resultTex; } #endif - -SK_DEFINE_FLATTENABLE_REGISTRAR(SkSingleInputImageFilter) diff --git a/src/effects/SkStippleMaskFilter.cpp b/src/effects/SkStippleMaskFilter.cpp index de5da841c..434528ed9 100644 --- a/src/effects/SkStippleMaskFilter.cpp +++ b/src/effects/SkStippleMaskFilter.cpp @@ -44,5 +44,3 @@ bool SkStippleMaskFilter::filterMask(SkMask* dst, return true; } - -SK_DEFINE_FLATTENABLE_REGISTRAR(SkStippleMaskFilter) diff --git a/src/effects/SkTestImageFilters.cpp b/src/effects/SkTestImageFilters.cpp index aeb5d798e..d28fda96e 100755 --- a/src/effects/SkTestImageFilters.cpp +++ b/src/effects/SkTestImageFilters.cpp @@ -343,8 +343,3 @@ void SkDownSampleImageFilter::flatten(SkFlattenableWriteBuffer& buffer) const { SkDownSampleImageFilter::SkDownSampleImageFilter(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) { fScale = buffer.readScalar(); } - -SK_DEFINE_FLATTENABLE_REGISTRAR(SkOffsetImageFilter) -SK_DEFINE_FLATTENABLE_REGISTRAR(SkComposeImageFilter) -SK_DEFINE_FLATTENABLE_REGISTRAR(SkMergeImageFilter) -SK_DEFINE_FLATTENABLE_REGISTRAR(SkDownSampleImageFilter) diff --git a/src/effects/SkTransparentShader.cpp b/src/effects/SkTransparentShader.cpp index 419a33052..28b075f4e 100644 --- a/src/effects/SkTransparentShader.cpp +++ b/src/effects/SkTransparentShader.cpp @@ -125,5 +125,3 @@ void SkTransparentShader::shadeSpan16(int x, int y, uint16_t span[], int count) memcpy(span, src, count << 1); } } - -SK_DEFINE_FLATTENABLE_REGISTRAR(SkTransparentShader) diff --git a/src/image/SkDataPixelRef.cpp b/src/image/SkDataPixelRef.cpp index 222519d8a..980b4f145 100644 --- a/src/image/SkDataPixelRef.cpp +++ b/src/image/SkDataPixelRef.cpp @@ -37,5 +37,3 @@ SkDataPixelRef::SkDataPixelRef(SkFlattenableReadBuffer& buffer) fData = (SkData*)buffer.readFlattenable(); this->setPreLocked(const_cast(fData->data()), NULL); } - -SK_DEFINE_FLATTENABLE_REGISTRAR(SkDataPixelRef) diff --git a/src/images/SkFlipPixelRef.cpp b/src/images/SkFlipPixelRef.cpp index f3f54e85c..2e73ece5a 100644 --- a/src/images/SkFlipPixelRef.cpp +++ b/src/images/SkFlipPixelRef.cpp @@ -75,8 +75,6 @@ SkFlipPixelRef::SkFlipPixelRef(SkFlattenableReadBuffer& buffer) buffer.readByteArray(fPage0); } -SK_DEFINE_FLATTENABLE_REGISTRAR(SkFlipPixelRef) - /////////////////////////////////////////////////////////////////////////////// static void copyRect(const SkBitmap& dst, const SkIRect& rect, diff --git a/src/images/SkImageRef_GlobalPool.cpp b/src/images/SkImageRef_GlobalPool.cpp index a5a71a3d9..e62816aa3 100644 --- a/src/images/SkImageRef_GlobalPool.cpp +++ b/src/images/SkImageRef_GlobalPool.cpp @@ -71,8 +71,6 @@ SkImageRef_GlobalPool::SkImageRef_GlobalPool(SkFlattenableReadBuffer& buffer) this->mutex()->release(); } -SK_DEFINE_FLATTENABLE_REGISTRAR(SkImageRef_GlobalPool) - /////////////////////////////////////////////////////////////////////////////// // global imagerefpool wrappers diff --git a/src/ports/SkGlobalInitialization_default.cpp b/src/ports/SkGlobalInitialization_default.cpp index 7448f8d03..fc454b47f 100644 --- a/src/ports/SkGlobalInitialization_default.cpp +++ b/src/ports/SkGlobalInitialization_default.cpp @@ -7,8 +7,6 @@ #include "SkTypes.h" -#if !SK_ALLOW_STATIC_GLOBAL_INITIALIZERS - #include "SkBitmapProcShader.h" #include "SkFlipPixelRef.h" #include "SkImageRef_ashmem.h" @@ -99,5 +97,3 @@ void SkFlattenable::InitializeFlattenables() { SkTableColorFilter::InitializeFlattenables(); SkXfermode::InitializeFlattenables(); } - -#endif diff --git a/src/ports/SkImageRef_ashmem.cpp b/src/ports/SkImageRef_ashmem.cpp index 01b950e57..cdd56c811 100644 --- a/src/ports/SkImageRef_ashmem.cpp +++ b/src/ports/SkImageRef_ashmem.cpp @@ -231,5 +231,3 @@ SkImageRef_ashmem::SkImageRef_ashmem(SkFlattenableReadBuffer& buffer) } this->useDefaultMutex(); // we don't need/want the shared imageref mutex } - -SK_DEFINE_FLATTENABLE_REGISTRAR(SkImageRef_ashmem) diff --git a/src/utils/SkUnitMappers.cpp b/src/utils/SkUnitMappers.cpp index 735a4340a..ceff9ca00 100644 --- a/src/utils/SkUnitMappers.cpp +++ b/src/utils/SkUnitMappers.cpp @@ -59,6 +59,3 @@ uint16_t SkCosineMapper::mapUnit16(uint16_t input) SkCosineMapper::SkCosineMapper(SkFlattenableReadBuffer& rb) : SkUnitMapper(rb) {} - -SK_DEFINE_FLATTENABLE_REGISTRAR(SkDiscreteMapper) -SK_DEFINE_FLATTENABLE_REGISTRAR(SkCosineMapper) diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp index c1d829c0c..deaf0342b 100644 --- a/tests/GLProgramsTest.cpp +++ b/tests/GLProgramsTest.cpp @@ -27,11 +27,6 @@ int random_int(GrRandom* r, int count) { return (int)(r->nextF() * count); } -// min is inclusive, max is exclusive -int random_int(GrRandom* r, int min, int max) { - return (int)(r->nextF() * (max-min)) + min; -} - bool random_bool(GrRandom* r) { return r->nextF() > .5f; }