make GR_TEST_UTILS=0 work
authorHal Canary <halcanary@google.com>
Tue, 31 Jan 2017 18:50:44 +0000 (13:50 -0500)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Thu, 2 Feb 2017 12:49:17 +0000 (12:49 +0000)
Change-Id: Icce35140ca08b65217b32e6b1ffc6ad2f38ab37f
Reviewed-on: https://skia-review.googlesource.com/7840
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>

73 files changed:
experimental/SkPerlinNoiseShader2/SkPerlinNoiseShader2.cpp
include/gpu/GrProcessorUnitTest.h
include/gpu/GrTestUtils.h
src/core/SkColorMatrixFilterRowMajor255.cpp
src/core/SkColorShader.cpp
src/core/SkModeColorFilter.cpp
src/effects/GrAlphaThresholdFragmentProcessor.cpp
src/effects/GrCircleBlurFragmentProcessor.cpp
src/effects/SkArithmeticImageFilter.cpp
src/effects/SkBlurMaskFilter.cpp
src/effects/SkDisplacementMapEffect.cpp
src/effects/SkLightingImageFilter.cpp
src/effects/SkMagnifierImageFilter.cpp
src/effects/SkMatrixConvolutionImageFilter.cpp
src/effects/SkMorphologyImageFilter.cpp
src/effects/SkPerlinNoiseShader.cpp
src/effects/SkTableColorFilter.cpp
src/effects/gradients/SkGradientShader.cpp
src/effects/gradients/SkGradientShaderPriv.h
src/effects/gradients/SkLinearGradient.cpp
src/effects/gradients/SkRadialGradient.cpp
src/effects/gradients/SkSweepGradient.cpp
src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp
src/gpu/GrDefaultGeoProcFactory.cpp
src/gpu/GrDrawOpTest.cpp
src/gpu/GrDrawOpTest.h
src/gpu/GrProcessor.cpp
src/gpu/GrProcessorUnitTest.cpp
src/gpu/GrTestUtils.cpp
src/gpu/SkGr.cpp
src/gpu/effects/GrBezierEffect.cpp
src/gpu/effects/GrBicubicEffect.cpp
src/gpu/effects/GrBitmapTextGeoProc.cpp
src/gpu/effects/GrConfigConversionEffect.cpp
src/gpu/effects/GrConstColorProcessor.cpp
src/gpu/effects/GrConvexPolyEffect.cpp
src/gpu/effects/GrCoverageSetOpXP.cpp
src/gpu/effects/GrCustomXfermode.cpp
src/gpu/effects/GrDisableColorXP.cpp
src/gpu/effects/GrDistanceFieldGeoProc.cpp
src/gpu/effects/GrDitherEffect.cpp
src/gpu/effects/GrGaussianConvolutionFragmentProcessor.cpp
src/gpu/effects/GrMatrixConvolutionEffect.cpp
src/gpu/effects/GrOvalEffect.cpp
src/gpu/effects/GrPorterDuffXferProcessor.cpp
src/gpu/effects/GrRRectEffect.cpp
src/gpu/effects/GrSRGBEffect.cpp
src/gpu/effects/GrShadowGeoProc.cpp
src/gpu/effects/GrSimpleTextureEffect.cpp
src/gpu/effects/GrTextureDomain.cpp
src/gpu/effects/GrXfermodeFragmentProcessor.cpp
src/gpu/ops/GrAAConvexPathRenderer.cpp
src/gpu/ops/GrAADistanceFieldPathRenderer.cpp
src/gpu/ops/GrAAFillRectOp.cpp
src/gpu/ops/GrAAHairLinePathRenderer.cpp
src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp
src/gpu/ops/GrAAStrokeRectOp.cpp
src/gpu/ops/GrAnalyticRectOp.cpp
src/gpu/ops/GrDashOp.cpp
src/gpu/ops/GrDefaultPathRenderer.cpp
src/gpu/ops/GrDrawAtlasOp.cpp
src/gpu/ops/GrDrawVerticesOp.cpp
src/gpu/ops/GrNonAAFillRectOp.cpp
src/gpu/ops/GrNonAAFillRectPerspectiveOp.cpp
src/gpu/ops/GrNonAAStrokeRectOp.cpp
src/gpu/ops/GrOvalOpFactory.cpp
src/gpu/ops/GrPLSPathRenderer.cpp
src/gpu/ops/GrShadowRRectOp.cpp
src/gpu/ops/GrTessellatingPathRenderer.cpp
src/gpu/text/GrAtlasTextContext.cpp
src/gpu/text/GrAtlasTextContext.h
tests/GLProgramsTest.cpp
tests/ProcessorTest.cpp

index f5082a0..401d3c3 100644 (file)
@@ -709,6 +709,7 @@ private:
 /////////////////////////////////////////////////////////////////////
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrPerlinNoise2Effect);
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> GrPerlinNoise2Effect::TestCreate(GrProcessorTestData* d) {
     int      numOctaves = d->fRandom->nextRangeU(2, 10);
     bool     stitchTiles = d->fRandom->nextBool();
@@ -729,6 +730,7 @@ sk_sp<GrFragmentProcessor> GrPerlinNoise2Effect::TestCreate(GrProcessorTestData*
     GrTest::TestAsFPArgs asFPArgs(d);
     return shader->asFragmentProcessor(asFPArgs.args());
 }
+#endif
 
 void GrGLPerlinNoise2::emitCode(EmitArgs& args) {
     const GrPerlinNoise2Effect& pne = args.fFp.cast<GrPerlinNoise2Effect>();
@@ -1118,6 +1120,7 @@ private:
 /////////////////////////////////////////////////////////////////////
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrImprovedPerlinNoiseEffect);
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> GrImprovedPerlinNoiseEffect::TestCreate(GrProcessorTestData* d) {
     SkScalar baseFrequencyX = d->fRandom->nextRangeScalar(0.01f,
                                                           0.99f);
@@ -1134,6 +1137,7 @@ sk_sp<GrFragmentProcessor> GrImprovedPerlinNoiseEffect::TestCreate(GrProcessorTe
     GrTest::TestAsFPArgs asFPArgs(d);
     return shader->asFragmentProcessor(asFPArgs.args());
 }
+#endif
 
 void GrGLImprovedPerlinNoise::emitCode(EmitArgs& args) {
     GrGLSLFragmentBuilder* fsBuilder = args.fFragBuilder;
index a56db81..748a522 100644 (file)
@@ -8,10 +8,13 @@
 #ifndef GrProcessorUnitTest_DEFINED
 #define GrProcessorUnitTest_DEFINED
 
+#include "SkTypes.h"
+
+#if GR_TEST_UTILS
+
 #include "../private/GrTextureProxy.h"
 #include "../private/SkTArray.h"
 #include "GrTestUtils.h"
-#include "SkTypes.h"
 
 class SkMatrix;
 class GrCaps;
@@ -183,5 +186,19 @@ private:
     const GrXPFactory* TestGet(GrProcessorTestData*)
 #define GR_DEFINE_XP_FACTORY_TEST(X)
 
-#endif // !SK_ALLOW_STATIC_GLOBAL_INITIALIZERS
-#endif
+#endif  // !SK_ALLOW_STATIC_GLOBAL_INITIALIZERS
+#else   // GR_TEST_UTILS
+    #define GR_DECLARE_GEOMETRY_PROCESSOR_TEST
+    #define GR_DECLARE_FRAGMENT_PROCESSOR_TEST
+    #define GR_DECLARE_XP_FACTORY_TEST
+    #define GR_DEFINE_FRAGMENT_PROCESSOR_TEST(...)
+    #define GR_DEFINE_GEOMETRY_PROCESSOR_TEST(...)
+    #define GR_DEFINE_XP_FACTORY_TEST(...)
+    #define GR_DECLARE_FRAGMENT_PROCESSOR_TEST
+    #define GR_DEFINE_FRAGMENT_PROCESSOR_TEST(...)
+    #define GR_DECLARE_GEOMETRY_PROCESSOR_TEST
+    #define GR_DEFINE_GEOMETRY_PROCESSOR_TEST(...)
+    #define GR_DECLARE_XP_FACTORY_TEST
+    #define GR_DEFINE_XP_FACTORY_TEST(...)
+#endif  // GR_TEST_UTILS
+#endif  // GrProcessorUnitTest_DEFINED
index 373847d..5bb1cc1 100644 (file)
@@ -10,7 +10,7 @@
 
 #include "SkTypes.h"
 
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
 
 #include "GrColor.h"
 #include "GrColorSpaceXform.h"
index 167fd21..0c6318b 100644 (file)
@@ -418,6 +418,7 @@ private:
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(ColorMatrixEffect);
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> ColorMatrixEffect::TestCreate(GrProcessorTestData* d) {
     SkScalar colorMatrix[20];
     for (size_t i = 0; i < SK_ARRAY_COUNT(colorMatrix); ++i) {
@@ -425,6 +426,7 @@ sk_sp<GrFragmentProcessor> ColorMatrixEffect::TestCreate(GrProcessorTestData* d)
     }
     return ColorMatrixEffect::Make(colorMatrix);
 }
+#endif
 
 sk_sp<GrFragmentProcessor> SkColorMatrixFilterRowMajor255::asFragmentProcessor(
                                                                   GrContext*, SkColorSpace*) const {
index 9d93240..ed2a26b 100644 (file)
@@ -211,6 +211,7 @@ SkShader::GradientType SkColor4Shader::asAGradient(GradientInfo* info) const {
 
 #include "SkGr.h"
 #include "effects/GrConstColorProcessor.h"
+#include "GrColorSpaceXform.h"
 sk_sp<GrFragmentProcessor> SkColor4Shader::asFragmentProcessor(const AsFPArgs& args) const {
     sk_sp<GrColorSpaceXform> colorSpaceXform = GrColorSpaceXform::Make(fColorSpace.get(),
                                                                        args.fDstColorSpace);
index 58127d3..05dfbff 100644 (file)
@@ -16,6 +16,7 @@
 #include "SkReadBuffer.h"
 #include "SkWriteBuffer.h"
 #include "SkUtils.h"
+#include "SkRandom.h"
 #include "SkString.h"
 #include "SkValidationUtils.h"
 #include "SkPM4f.h"
index 8f9e45d..a18fb9c 100644 (file)
@@ -170,6 +170,7 @@ void GrGLAlphaThresholdFragmentProcessor::onSetData(const GrGLSLProgramDataManag
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrAlphaThresholdFragmentProcessor);
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> GrAlphaThresholdFragmentProcessor::TestCreate(GrProcessorTestData* d) {
     GrTexture* bmpTex = d->fTextures[GrProcessorUnitTest::kSkiaPMTextureIdx];
     GrTexture* maskTex = d->fTextures[GrProcessorUnitTest::kAlphaTextureIdx];
@@ -187,6 +188,7 @@ sk_sp<GrFragmentProcessor> GrAlphaThresholdFragmentProcessor::TestCreate(GrProce
                                                    innerThresh, outerThresh,
                                                    bounds);
 }
+#endif
 
 ///////////////////////////////////////////////////////////////////////////////
 
index 91d17d6..c54a71c 100644 (file)
@@ -347,11 +347,13 @@ sk_sp<GrFragmentProcessor> GrCircleBlurFragmentProcessor::Make(GrTextureProvider
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrCircleBlurFragmentProcessor);
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> GrCircleBlurFragmentProcessor::TestCreate(GrProcessorTestData* d) {
     SkScalar wh = d->fRandom->nextRangeScalar(100.f, 1000.f);
     SkScalar sigma = d->fRandom->nextRangeF(1.f,10.f);
     SkRect circle = SkRect::MakeWH(wh, wh);
     return GrCircleBlurFragmentProcessor::Make(d->fContext->textureProvider(), circle, sigma);
 }
+#endif
 
 #endif
index c3847ff..4056069 100644 (file)
@@ -313,6 +313,7 @@ private:
 };
 }
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> ArithmeticFP::TestCreate(GrProcessorTestData* d) {
     float k1 = d->fRandom->nextF();
     float k2 = d->fRandom->nextF();
@@ -323,6 +324,7 @@ sk_sp<GrFragmentProcessor> ArithmeticFP::TestCreate(GrProcessorTestData* d) {
     sk_sp<GrFragmentProcessor> dst(GrProcessorUnitTest::MakeChildFP(d));
     return ArithmeticFP::Make(k1, k2, k3, k4, enforcePMColor, std::move(dst));
 }
+#endif
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(ArithmeticFP);
 
index 1da9816..f41648d 100644 (file)
@@ -1005,6 +1005,7 @@ void GrRectBlurEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrRectBlurEffect);
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> GrRectBlurEffect::TestCreate(GrProcessorTestData* d) {
     float sigma = d->fRandom->nextRangeF(3,8);
     float width = d->fRandom->nextRangeF(200,300);
@@ -1012,6 +1013,7 @@ sk_sp<GrFragmentProcessor> GrRectBlurEffect::TestCreate(GrProcessorTestData* d)
     return GrRectBlurEffect::Make(d->fContext->textureProvider(), SkRect::MakeWH(width, height),
                                   sigma);
 }
+#endif
 
 bool SkBlurMaskFilterImpl::directFilterMaskGPU(GrTextureProvider* texProvider,
                                                GrRenderTargetContext* renderTargetContext,
@@ -1227,6 +1229,7 @@ bool GrRRectBlurEffect::onIsEqual(const GrFragmentProcessor& other) const {
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrRRectBlurEffect);
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> GrRRectBlurEffect::TestCreate(GrProcessorTestData* d) {
     SkScalar w = d->fRandom->nextRangeScalar(100.f, 1000.f);
     SkScalar h = d->fRandom->nextRangeScalar(100.f, 1000.f);
@@ -1236,6 +1239,7 @@ sk_sp<GrFragmentProcessor> GrRRectBlurEffect::TestCreate(GrProcessorTestData* d)
     rrect.setRectXY(SkRect::MakeWH(w, h), r, r);
     return GrRRectBlurEffect::Make(d->fContext, sigma, sigma, rrect, rrect);
 }
+#endif
 
 //////////////////////////////////////////////////////////////////////////////
 
index 9693191..67fb761 100644 (file)
@@ -537,6 +537,7 @@ void GrDisplacementMapEffect::onComputeInvariantOutput(GrInvariantOutput* inout)
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrDisplacementMapEffect);
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> GrDisplacementMapEffect::TestCreate(GrProcessorTestData* d) {
     int texIdxDispl = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
                                                GrProcessorUnitTest::kAlphaTextureIdx;
@@ -560,6 +561,7 @@ sk_sp<GrFragmentProcessor> GrDisplacementMapEffect::TestCreate(GrProcessorTestDa
                                          d->fTextures[texIdxColor], colorSpaceXform,
                                          colorDimensions);
 }
+#endif
 
 ///////////////////////////////////////////////////////////////////////////////
 
index 0a4ce2f..fc7b29b 100644 (file)
@@ -1752,6 +1752,7 @@ GrGLSLFragmentProcessor* GrDiffuseLightingEffect::onCreateGLSLInstance() const {
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrDiffuseLightingEffect);
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> GrDiffuseLightingEffect::TestCreate(GrProcessorTestData* d) {
     int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
                                           GrProcessorUnitTest::kAlphaTextureIdx;
@@ -1771,6 +1772,7 @@ sk_sp<GrFragmentProcessor> GrDiffuseLightingEffect::TestCreate(GrProcessorTestDa
     return GrDiffuseLightingEffect::Make(tex, light.get(), surfaceScale, matrix, kd, mode,
                                          &srcBounds);
 }
+#endif
 
 
 ///////////////////////////////////////////////////////////////////////////////
@@ -1970,6 +1972,7 @@ GrGLSLFragmentProcessor* GrSpecularLightingEffect::onCreateGLSLInstance() const
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrSpecularLightingEffect);
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> GrSpecularLightingEffect::TestCreate(GrProcessorTestData* d) {
     int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
                                           GrProcessorUnitTest::kAlphaTextureIdx;
@@ -1991,6 +1994,7 @@ sk_sp<GrFragmentProcessor> GrSpecularLightingEffect::TestCreate(GrProcessorTestD
                                           light.get(), surfaceScale, matrix, ks, shininess, mode,
                                           &srcBounds);
 }
+#endif
 
 ///////////////////////////////////////////////////////////////////////////////
 
index 49f4fdd..93a6710 100644 (file)
@@ -210,6 +210,7 @@ GrGLSLFragmentProcessor* GrMagnifierEffect::onCreateGLSLInstance() const {
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrMagnifierEffect);
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> GrMagnifierEffect::TestCreate(GrProcessorTestData* d) {
     GrTexture* texture = d->fTextures[0];
     const int kMaxWidth = 200;
@@ -235,6 +236,7 @@ sk_sp<GrFragmentProcessor> GrMagnifierEffect::TestCreate(GrProcessorTestData* d)
     SkASSERT(effect);
     return effect;
 }
+#endif
 
 ///////////////////////////////////////////////////////////////////////////////
 
index 6af8508..8d6dbfc 100644 (file)
@@ -16,6 +16,7 @@
 
 #if SK_SUPPORT_GPU
 #include "GrContext.h"
+#include "GrTextureProxy.h"
 #include "effects/GrMatrixConvolutionEffect.h"
 #endif
 
index 75e019b..2c813e2 100644 (file)
@@ -373,6 +373,7 @@ void GrMorphologyEffect::onComputeInvariantOutput(GrInvariantOutput* inout) cons
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrMorphologyEffect);
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> GrMorphologyEffect::TestCreate(GrProcessorTestData* d) {
     int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
                                           GrProcessorUnitTest::kAlphaTextureIdx;
@@ -384,6 +385,7 @@ sk_sp<GrFragmentProcessor> GrMorphologyEffect::TestCreate(GrProcessorTestData* d
 
     return GrMorphologyEffect::Make(d->fTextures[texIdx], dir, radius, type);
 }
+#endif
 
 
 static void apply_morphology_rect(GrTextureProvider* provider,
index 450fcaa..92f2946 100644 (file)
@@ -573,6 +573,7 @@ private:
 /////////////////////////////////////////////////////////////////////
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrPerlinNoiseEffect);
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> GrPerlinNoiseEffect::TestCreate(GrProcessorTestData* d) {
     int      numOctaves = d->fRandom->nextRangeU(2, 10);
     bool     stitchTiles = d->fRandom->nextBool();
@@ -593,6 +594,7 @@ sk_sp<GrFragmentProcessor> GrPerlinNoiseEffect::TestCreate(GrProcessorTestData*
     GrTest::TestAsFPArgs asFPArgs(d);
     return shader->asFragmentProcessor(asFPArgs.args());
 }
+#endif
 
 void GrGLPerlinNoise::emitCode(EmitArgs& args) {
     const GrPerlinNoiseEffect& pne = args.fFp.cast<GrPerlinNoiseEffect>();
index 9198460..7de1008 100644 (file)
@@ -569,6 +569,7 @@ void ColorTableEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(ColorTableEffect);
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> ColorTableEffect::TestCreate(GrProcessorTestData* d) {
     int flags = 0;
     uint8_t luts[256][4];
@@ -595,6 +596,7 @@ sk_sp<GrFragmentProcessor> ColorTableEffect::TestCreate(GrProcessorTestData* d)
     SkASSERT(fp);
     return fp;
 }
+#endif
 
 sk_sp<GrFragmentProcessor> SkTable_ColorFilter::asFragmentProcessor(GrContext* context,
                                                                     SkColorSpace*) const {
index 9a3438e..7b91a60 100644 (file)
@@ -1740,6 +1740,7 @@ void GrGradientEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const
     }
 }
 
+#if GR_TEST_UTILS
 GrGradientEffect::RandomGradientParams::RandomGradientParams(SkRandom* random) {
     fColorCount = random->nextRangeU(1, kMaxRandomGradientColors);
     fUseColors4f = random->nextBool();
@@ -1777,5 +1778,6 @@ GrGradientEffect::RandomGradientParams::RandomGradientParams(SkRandom* random) {
     }
     fTileMode = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileModeCount));
 }
+#endif
 
 #endif
index 6f46698..75b6595 100644 (file)
@@ -402,6 +402,7 @@ public:
 protected:
     GrGradientEffect(const CreateArgs&, bool isOpaque);
 
+    #if GR_TEST_UTILS
     /** Helper struct that stores (and populates) parameters to construct a random gradient.
         If fUseColors4f is true, then the SkColor4f factory should be called, with fColors4f and
         fColorSpace. Otherwise, the SkColor factory should be called, with fColors. fColorCount
@@ -422,6 +423,7 @@ protected:
         int fColorCount;
         SkScalar* fStops;
     };
+    #endif
 
     bool onIsEqual(const GrFragmentProcessor&) const override;
 
index b3f70d1..5a74bfd 100644 (file)
@@ -477,6 +477,7 @@ void GrLinearGradient::onGetGLSLProcessorKey(const GrShaderCaps& caps,
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrLinearGradient);
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> GrLinearGradient::TestCreate(GrProcessorTestData* d) {
     SkPoint points[] = {{d->fRandom->nextUScalar1(), d->fRandom->nextUScalar1()},
                         {d->fRandom->nextUScalar1(), d->fRandom->nextUScalar1()}};
@@ -492,6 +493,7 @@ sk_sp<GrFragmentProcessor> GrLinearGradient::TestCreate(GrProcessorTestData* d)
     GrAlwaysAssert(fp);
     return fp;
 }
+#endif
 
 /////////////////////////////////////////////////////////////////////
 
index 4eb3e6d..a7dca76 100644 (file)
@@ -303,6 +303,7 @@ void GrRadialGradient::onGetGLSLProcessorKey(const GrShaderCaps& caps,
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrRadialGradient);
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> GrRadialGradient::TestCreate(GrProcessorTestData* d) {
     SkPoint center = {d->fRandom->nextUScalar1(), d->fRandom->nextUScalar1()};
     SkScalar radius = d->fRandom->nextUScalar1();
@@ -318,6 +319,7 @@ sk_sp<GrFragmentProcessor> GrRadialGradient::TestCreate(GrProcessorTestData* d)
     GrAlwaysAssert(fp);
     return fp;
 }
+#endif
 
 /////////////////////////////////////////////////////////////////////
 
index 7e93a21..27d5dbe 100644 (file)
@@ -186,6 +186,7 @@ void GrSweepGradient::onGetGLSLProcessorKey(const GrShaderCaps& caps,
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrSweepGradient);
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> GrSweepGradient::TestCreate(GrProcessorTestData* d) {
     SkPoint center = {d->fRandom->nextUScalar1(), d->fRandom->nextUScalar1()};
 
@@ -200,6 +201,7 @@ sk_sp<GrFragmentProcessor> GrSweepGradient::TestCreate(GrProcessorTestData* d) {
     GrAlwaysAssert(fp);
     return fp;
 }
+#endif
 
 /////////////////////////////////////////////////////////////////////
 
index 75b1cf7..a301d64 100644 (file)
@@ -182,6 +182,7 @@ GR_DEFINE_FRAGMENT_PROCESSOR_TEST(Edge2PtConicalEffect);
 /*
  * All Two point conical gradient test create functions may occasionally create edge case shaders
  */
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> Edge2PtConicalEffect::TestCreate(GrProcessorTestData* d) {
     SkPoint center1 = {d->fRandom->nextUScalar1(), d->fRandom->nextUScalar1()};
     SkScalar radius1 = d->fRandom->nextUScalar1();
@@ -212,6 +213,7 @@ sk_sp<GrFragmentProcessor> Edge2PtConicalEffect::TestCreate(GrProcessorTestData*
     GrAlwaysAssert(fp);
     return fp;
 }
+#endif
 
 Edge2PtConicalEffect::GLSLEdge2PtConicalProcessor::GLSLEdge2PtConicalProcessor(const GrProcessor&)
     : fVSVaryingName(nullptr)
@@ -464,6 +466,7 @@ GR_DEFINE_FRAGMENT_PROCESSOR_TEST(FocalOutside2PtConicalEffect);
 /*
  * All Two point conical gradient test create functions may occasionally create edge case shaders
  */
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> FocalOutside2PtConicalEffect::TestCreate(GrProcessorTestData* d) {
     SkPoint center1 = {d->fRandom->nextUScalar1(), d->fRandom->nextUScalar1()};
     SkScalar radius1 = 0.f;
@@ -492,6 +495,7 @@ sk_sp<GrFragmentProcessor> FocalOutside2PtConicalEffect::TestCreate(GrProcessorT
     GrAlwaysAssert(fp);
     return fp;
 }
+#endif
 
 FocalOutside2PtConicalEffect::GLSLFocalOutside2PtConicalProcessor
                             ::GLSLFocalOutside2PtConicalProcessor(const GrProcessor& processor)
@@ -666,6 +670,7 @@ GR_DEFINE_FRAGMENT_PROCESSOR_TEST(FocalInside2PtConicalEffect);
 /*
  * All Two point conical gradient test create functions may occasionally create edge case shaders
  */
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> FocalInside2PtConicalEffect::TestCreate(GrProcessorTestData* d) {
     SkPoint center1 = {d->fRandom->nextUScalar1(), d->fRandom->nextUScalar1()};
     SkScalar radius1 = 0.f;
@@ -695,6 +700,7 @@ sk_sp<GrFragmentProcessor> FocalInside2PtConicalEffect::TestCreate(GrProcessorTe
     GrAlwaysAssert(fp);
     return fp;
 }
+#endif
 
 FocalInside2PtConicalEffect::GLSLFocalInside2PtConicalProcessor
                            ::GLSLFocalInside2PtConicalProcessor(const GrProcessor&)
@@ -912,6 +918,7 @@ GR_DEFINE_FRAGMENT_PROCESSOR_TEST(CircleInside2PtConicalEffect);
 /*
  * All Two point conical gradient test create functions may occasionally create edge case shaders
  */
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> CircleInside2PtConicalEffect::TestCreate(GrProcessorTestData* d) {
     SkPoint center1 = {d->fRandom->nextUScalar1(), d->fRandom->nextUScalar1()};
     SkScalar radius1 = d->fRandom->nextUScalar1() + 0.0001f; // make sure radius1 != 0
@@ -940,6 +947,7 @@ sk_sp<GrFragmentProcessor> CircleInside2PtConicalEffect::TestCreate(GrProcessorT
     GrAlwaysAssert(fp);
     return fp;
 }
+#endif
 
 CircleInside2PtConicalEffect::GLSLCircleInside2PtConicalProcessor
                             ::GLSLCircleInside2PtConicalProcessor(const GrProcessor& processor)
@@ -1144,6 +1152,7 @@ GR_DEFINE_FRAGMENT_PROCESSOR_TEST(CircleOutside2PtConicalEffect);
 /*
  * All Two point conical gradient test create functions may occasionally create edge case shaders
  */
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> CircleOutside2PtConicalEffect::TestCreate(GrProcessorTestData* d) {
     SkPoint center1 = {d->fRandom->nextUScalar1(), d->fRandom->nextUScalar1()};
     SkScalar radius1 = d->fRandom->nextUScalar1() + 0.0001f; // make sure radius1 != 0
@@ -1173,6 +1182,7 @@ sk_sp<GrFragmentProcessor> CircleOutside2PtConicalEffect::TestCreate(GrProcessor
     GrAlwaysAssert(fp);
     return fp;
 }
+#endif
 
 CircleOutside2PtConicalEffect::GLSLCircleOutside2PtConicalProcessor
                              ::GLSLCircleOutside2PtConicalProcessor(const GrProcessor& processor)
index ab57c0b..f371e24 100644 (file)
@@ -237,6 +237,7 @@ private:
 
 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(DefaultGeoProc);
 
+#if GR_TEST_UTILS
 sk_sp<GrGeometryProcessor> DefaultGeoProc::TestCreate(GrProcessorTestData* d) {
     uint32_t flags = 0;
     if (d->fRandom->nextBool()) {
@@ -260,6 +261,7 @@ sk_sp<GrGeometryProcessor> DefaultGeoProc::TestCreate(GrProcessorTestData* d) {
                                 d->fRandom->nextBool(),
                                 GrRandomCoverage(d->fRandom));
 }
+#endif
 
 sk_sp<GrGeometryProcessor> GrDefaultGeoProcFactory::Make(const Color& color,
                                                          const Coverage& coverage,
index 3cf1a90..5d0aa56 100644 (file)
@@ -10,7 +10,7 @@
 #include "SkRandom.h"
 #include "SkTypes.h"
 
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
 
 #define DRAW_OP_TEST_EXTERN(Op) \
     extern std::unique_ptr<GrDrawOp> Op##__Test(SkRandom*, GrContext* context);
index 46abf18..8c98597 100644 (file)
@@ -11,7 +11,7 @@
 #include "GrTestUtils.h"
 #include "SkRefCnt.h"
 
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
 
 class GrDrawOp;
 class GrContext;
index 56d3e7f..897a755 100644 (file)
@@ -17,7 +17,7 @@
 #include "SkSpinlock.h"
 
 #if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS
-
+#if GR_TEST_UTILS
 class GrFragmentProcessor;
 class GrGeometryProcessor;
 
@@ -80,6 +80,7 @@ void GrXPFactoryTestFactory::VerifyFactoryCount() {
 }
 
 #endif
+#endif
 
 
 // We use a global pool protected by a mutex(spinlock). Chrome may use the same GrContext on
index 3f43389..71b112d 100644 (file)
@@ -8,6 +8,8 @@
 #include "GrProcessorUnitTest.h"
 #include "GrFragmentProcessor.h"
 
+#if GR_TEST_UTILS
+
 sk_sp<GrFragmentProcessor> GrProcessorUnitTest::MakeChildFP(GrProcessorTestData* data) {
 #if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS
     sk_sp<GrFragmentProcessor> fp;
@@ -21,3 +23,4 @@ sk_sp<GrFragmentProcessor> GrProcessorUnitTest::MakeChildFP(GrProcessorTestData*
     return nullptr;
 #endif
 }
+#endif
index c9cccb8..35af494 100644 (file)
@@ -14,7 +14,7 @@
 #include "SkPath.h"
 #include "SkRRect.h"
 
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
 
 static const SkMatrix& test_matrix(SkRandom* random,
                                    bool includeNonPerspective,
index aef3c0d..ad43eef 100644 (file)
@@ -14,6 +14,7 @@
 #include "GrGpuResourcePriv.h"
 #include "GrRenderTargetContext.h"
 #include "GrTexturePriv.h"
+#include "GrTextureProxy.h"
 #include "GrTypes.h"
 #include "GrXferProcessor.h"
 
index 834b11d..4877072 100644 (file)
@@ -258,6 +258,7 @@ GrConicEffect::GrConicEffect(GrColor color, const SkMatrix& viewMatrix, uint8_t
 
 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrConicEffect);
 
+#if GR_TEST_UTILS
 sk_sp<GrGeometryProcessor> GrConicEffect::TestCreate(GrProcessorTestData* d) {
     sk_sp<GrGeometryProcessor> gp;
     do {
@@ -270,6 +271,7 @@ sk_sp<GrGeometryProcessor> GrConicEffect::TestCreate(GrProcessorTestData* d) {
     } while (nullptr == gp);
     return gp;
 }
+#endif
 
 //////////////////////////////////////////////////////////////////////////////
 // Quad
@@ -459,6 +461,7 @@ GrQuadEffect::GrQuadEffect(GrColor color, const SkMatrix& viewMatrix, uint8_t co
 
 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrQuadEffect);
 
+#if GR_TEST_UTILS
 sk_sp<GrGeometryProcessor> GrQuadEffect::TestCreate(GrProcessorTestData* d) {
     sk_sp<GrGeometryProcessor> gp;
     do {
@@ -470,6 +473,7 @@ sk_sp<GrGeometryProcessor> GrQuadEffect::TestCreate(GrProcessorTestData* d) {
     } while (nullptr == gp);
     return gp;
 }
+#endif
 
 //////////////////////////////////////////////////////////////////////////////
 // Cubic
@@ -679,6 +683,7 @@ GrCubicEffect::GrCubicEffect(GrColor color, const SkMatrix& viewMatrix,
 
 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrCubicEffect);
 
+#if GR_TEST_UTILS
 sk_sp<GrGeometryProcessor> GrCubicEffect::TestCreate(GrProcessorTestData* d) {
     sk_sp<GrGeometryProcessor> gp;
     do {
@@ -690,3 +695,4 @@ sk_sp<GrGeometryProcessor> GrCubicEffect::TestCreate(GrProcessorTestData* d) {
     } while (nullptr == gp);
     return gp;
 }
+#endif
index cb58995..2499c20 100644 (file)
@@ -8,6 +8,7 @@
 #include "GrBicubicEffect.h"
 #include "GrInvariantOutput.h"
 #include "GrProxyMove.h"
+#include "GrTextureProxy.h"
 #include "glsl/GrGLSLColorSpaceXformHelper.h"
 #include "glsl/GrGLSLFragmentShaderBuilder.h"
 #include "glsl/GrGLSLProgramDataManager.h"
@@ -202,6 +203,7 @@ void GrBicubicEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const {
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrBicubicEffect);
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> GrBicubicEffect::TestCreate(GrProcessorTestData* d) {
     int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx
                                         : GrProcessorUnitTest::kAlphaTextureIdx;
@@ -211,6 +213,7 @@ sk_sp<GrFragmentProcessor> GrBicubicEffect::TestCreate(GrProcessorTestData* d) {
     return GrBicubicEffect::Make(d->context(), d->textureProxy(texIdx), std::move(colorSpaceXform),
                                  SkMatrix::I(), kClampClamp);
 }
+#endif
 
 //////////////////////////////////////////////////////////////////////////////
 
index 3c4566e..60df6b9 100644 (file)
@@ -154,6 +154,7 @@ GrGLSLPrimitiveProcessor* GrBitmapTextGeoProc::createGLSLInstance(const GrShader
 
 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrBitmapTextGeoProc);
 
+#if GR_TEST_UTILS
 sk_sp<GrGeometryProcessor> GrBitmapTextGeoProc::TestCreate(GrProcessorTestData* d) {
     int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx
                                         : GrProcessorUnitTest::kAlphaTextureIdx;
@@ -186,3 +187,4 @@ sk_sp<GrGeometryProcessor> GrBitmapTextGeoProc::TestCreate(GrProcessorTestData*
                                      format, GrTest::TestMatrix(d->fRandom),
                                      d->fRandom->nextBool());
 }
+#endif
index d9b408a..d9a6fef 100644 (file)
@@ -149,6 +149,7 @@ GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrConfigConversionEffect);
 #pragma optimize("t", off)
 #endif
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> GrConfigConversionEffect::TestCreate(GrProcessorTestData* d) {
     PMConversion pmConv = static_cast<PMConversion>(d->fRandom->nextULessThan(kPMConversionCnt));
     GrSwizzle swizzle;
@@ -160,6 +161,7 @@ sk_sp<GrFragmentProcessor> GrConfigConversionEffect::TestCreate(GrProcessorTestD
                             d->textureProxy(GrProcessorUnitTest::kSkiaPMTextureIdx),
                             swizzle, pmConv, GrTest::TestMatrix(d->fRandom)));
 }
+#endif
 
 #if !defined(__clang__) && _MSC_FULL_VER >= 190024213
 // Restore optimization settings.
index 3875ffc..1d20512 100644 (file)
@@ -116,6 +116,7 @@ bool GrConstColorProcessor::onIsEqual(const GrFragmentProcessor& other) const {
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrConstColorProcessor);
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> GrConstColorProcessor::TestCreate(GrProcessorTestData* d) {
     GrColor4f color;
     int colorPicker = d->fRandom->nextULessThan(3);
@@ -139,3 +140,4 @@ sk_sp<GrFragmentProcessor> GrConstColorProcessor::TestCreate(GrProcessorTestData
     InputMode mode = static_cast<InputMode>(d->fRandom->nextULessThan(kInputModeCnt));
     return GrConstColorProcessor::Make(color, mode);
 }
+#endif
index 4100a0f..db8c2d9 100644 (file)
@@ -63,6 +63,7 @@ private:
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(AARectEffect);
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> AARectEffect::TestCreate(GrProcessorTestData* d) {
     SkRect rect = SkRect::MakeLTRB(d->fRandom->nextSScalar1(),
                                    d->fRandom->nextSScalar1(),
@@ -77,6 +78,7 @@ sk_sp<GrFragmentProcessor> AARectEffect::TestCreate(GrProcessorTestData* d) {
     } while (nullptr == fp);
     return fp;
 }
+#endif
 
 //////////////////////////////////////////////////////////////////////////////
 
@@ -362,6 +364,7 @@ bool GrConvexPolyEffect::onIsEqual(const GrFragmentProcessor& other) const {
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrConvexPolyEffect);
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> GrConvexPolyEffect::TestCreate(GrProcessorTestData* d) {
     int count = d->fRandom->nextULessThan(kMaxEdges) + 1;
     SkScalar edges[kMaxEdges * 3];
@@ -377,3 +380,4 @@ sk_sp<GrFragmentProcessor> GrConvexPolyEffect::TestCreate(GrProcessorTestData* d
     } while (nullptr == fp);
     return fp;
 }
+#endif
index 05e9fad..b8902de 100644 (file)
@@ -347,8 +347,10 @@ void GrCoverageSetOpXPFactory::getInvariantBlendedColor(const GrProcOptInfo& col
 
 GR_DEFINE_XP_FACTORY_TEST(GrCoverageSetOpXPFactory);
 
+#if GR_TEST_UTILS
 const GrXPFactory* GrCoverageSetOpXPFactory::TestGet(GrProcessorTestData* d) {
     SkRegion::Op regionOp = SkRegion::Op(d->fRandom->nextULessThan(SkRegion::kLastOp + 1));
     bool invertCoverage = !d->fRenderTargetContext->hasMixedSamples() && d->fRandom->nextBool();
     return GrCoverageSetOpXPFactory::Get(regionOp, invertCoverage);
 }
+#endif
index f8af7db..4c33b9b 100644 (file)
@@ -382,12 +382,14 @@ void CustomXPFactory::getInvariantBlendedColor(const GrProcOptInfo& colorPOI,
 }
 
 GR_DEFINE_XP_FACTORY_TEST(CustomXPFactory);
+#if GR_TEST_UTILS
 const GrXPFactory* CustomXPFactory::TestGet(GrProcessorTestData* d) {
     int mode = d->fRandom->nextRangeU((int)SkBlendMode::kLastCoeffMode + 1,
                                       (int)SkBlendMode::kLastSeparableMode);
 
     return GrCustomXfermode::Get((SkBlendMode)mode);
 }
+#endif
 
 ///////////////////////////////////////////////////////////////////////////////
 
index 69c34ec..7323331 100644 (file)
@@ -98,6 +98,8 @@ GrXferProcessor* GrDisableColorXPFactory::onCreateXferProcessor(const GrCaps& ca
 
 GR_DEFINE_XP_FACTORY_TEST(GrDisableColorXPFactory);
 
+#if GR_TEST_UTILS
 const GrXPFactory* GrDisableColorXPFactory::TestGet(GrProcessorTestData*) {
     return GrDisableColorXPFactory::Get();
 }
+#endif
index ee28760..0f9625e 100644 (file)
@@ -265,6 +265,7 @@ GrDistanceFieldA8TextGeoProc::createGLSLInstance(const GrShaderCaps&) const {
 
 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrDistanceFieldA8TextGeoProc);
 
+#if GR_TEST_UTILS
 sk_sp<GrGeometryProcessor> GrDistanceFieldA8TextGeoProc::TestCreate(GrProcessorTestData* d) {
     int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
                                           GrProcessorUnitTest::kAlphaTextureIdx;
@@ -295,6 +296,7 @@ sk_sp<GrGeometryProcessor> GrDistanceFieldA8TextGeoProc::TestCreate(GrProcessorT
                                               flags,
                                               d->fRandom->nextBool());
 }
+#endif
 
 ///////////////////////////////////////////////////////////////////////////////
 
@@ -503,6 +505,7 @@ GrDistanceFieldPathGeoProc::createGLSLInstance(const GrShaderCaps&) const {
 
 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrDistanceFieldPathGeoProc);
 
+#if GR_TEST_UTILS
 sk_sp<GrGeometryProcessor> GrDistanceFieldPathGeoProc::TestCreate(GrProcessorTestData* d) {
     int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx
                                         : GrProcessorUnitTest::kAlphaTextureIdx;
@@ -531,6 +534,7 @@ sk_sp<GrGeometryProcessor> GrDistanceFieldPathGeoProc::TestCreate(GrProcessorTes
                                             flags,
                                             d->fRandom->nextBool());
 }
+#endif
 
 ///////////////////////////////////////////////////////////////////////////////
 
@@ -801,6 +805,7 @@ GrGLSLPrimitiveProcessor* GrDistanceFieldLCDTextGeoProc::createGLSLInstance(cons
 
 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrDistanceFieldLCDTextGeoProc);
 
+#if GR_TEST_UTILS
 sk_sp<GrGeometryProcessor> GrDistanceFieldLCDTextGeoProc::TestCreate(GrProcessorTestData* d) {
     int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
                                           GrProcessorUnitTest::kAlphaTextureIdx;
@@ -829,3 +834,4 @@ sk_sp<GrGeometryProcessor> GrDistanceFieldLCDTextGeoProc::TestCreate(GrProcessor
                                                flags,
                                                d->fRandom->nextBool());
 }
+#endif
index 24e3ba6..34a1565 100644 (file)
@@ -50,9 +50,11 @@ void DitherEffect::onComputeInvariantOutput(GrInvariantOutput* inout) const {
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(DitherEffect);
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> DitherEffect::TestCreate(GrProcessorTestData*) {
     return DitherEffect::Make();
 }
+#endif
 
 //////////////////////////////////////////////////////////////////////////////
 
index 66aba13..2d485e6 100644 (file)
@@ -7,6 +7,7 @@
 
 #include "GrGaussianConvolutionFragmentProcessor.h"
 #include "GrProxyMove.h"
+#include "GrTextureProxy.h"
 #include "../private/GrGLSL.h"
 #include "glsl/GrGLSLFragmentProcessor.h"
 #include "glsl/GrGLSLFragmentShaderBuilder.h"
@@ -229,6 +230,7 @@ bool GrGaussianConvolutionFragmentProcessor::onIsEqual(const GrFragmentProcessor
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrGaussianConvolutionFragmentProcessor);
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> GrGaussianConvolutionFragmentProcessor::TestCreate(
         GrProcessorTestData* d) {
     int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx
@@ -255,3 +257,4 @@ sk_sp<GrFragmentProcessor> GrGaussianConvolutionFragmentProcessor::TestCreate(
     return GrGaussianConvolutionFragmentProcessor::Make(
             d->context(), d->textureProxy(texIdx), dir, radius, sigma, useBounds, bounds);
 }
+#endif
index 86fd565..1a40514 100644 (file)
@@ -5,6 +5,7 @@
  * found in the LICENSE file.
  */
 #include "GrMatrixConvolutionEffect.h"
+#include "GrTextureProxy.h"
 #include "glsl/GrGLSLFragmentProcessor.h"
 #include "glsl/GrGLSLFragmentShaderBuilder.h"
 #include "glsl/GrGLSLProgramDataManager.h"
@@ -290,6 +291,7 @@ sk_sp<GrFragmentProcessor> GrMatrixConvolutionEffect::MakeGaussian(GrContext* co
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrMatrixConvolutionEffect);
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> GrMatrixConvolutionEffect::TestCreate(GrProcessorTestData* d) {
     int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx :
                                           GrProcessorUnitTest::kAlphaTextureIdx;
@@ -322,3 +324,4 @@ sk_sp<GrFragmentProcessor> GrMatrixConvolutionEffect::TestCreate(GrProcessorTest
                                            tileMode,
                                            convolveAlpha);
 }
+#endif
index 3b0a887..b64ac56 100644 (file)
@@ -77,6 +77,7 @@ bool CircleEffect::onIsEqual(const GrFragmentProcessor& other) const {
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(CircleEffect);
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> CircleEffect::TestCreate(GrProcessorTestData* d) {
     SkPoint center;
     center.fX = d->fRandom->nextRangeScalar(0.f, 1000.f);
@@ -88,6 +89,7 @@ sk_sp<GrFragmentProcessor> CircleEffect::TestCreate(GrProcessorTestData* d) {
     } while (kHairlineAA_GrProcessorEdgeType == et);
     return CircleEffect::Make(et, center, radius);
 }
+#endif
 
 //////////////////////////////////////////////////////////////////////////////
 
@@ -246,6 +248,7 @@ bool EllipseEffect::onIsEqual(const GrFragmentProcessor& other) const {
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(EllipseEffect);
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> EllipseEffect::TestCreate(GrProcessorTestData* d) {
     SkPoint center;
     center.fX = d->fRandom->nextRangeScalar(0.f, 1000.f);
@@ -258,6 +261,7 @@ sk_sp<GrFragmentProcessor> EllipseEffect::TestCreate(GrProcessorTestData* d) {
     } while (kHairlineAA_GrProcessorEdgeType == et);
     return EllipseEffect::Make(et, center, rx, ry);
 }
+#endif
 
 //////////////////////////////////////////////////////////////////////////////
 
index 59710eb..8289561 100644 (file)
@@ -830,10 +830,12 @@ bool GrPorterDuffXPFactory::willReadDstColor(const GrCaps& caps, ColorType color
 
 GR_DEFINE_XP_FACTORY_TEST(GrPorterDuffXPFactory);
 
+#if GR_TEST_UTILS
 const GrXPFactory* GrPorterDuffXPFactory::TestGet(GrProcessorTestData* d) {
     SkBlendMode mode = SkBlendMode(d->fRandom->nextULessThan((int)SkBlendMode::kLastCoeffMode));
     return GrPorterDuffXPFactory::Get(mode);
 }
+#endif
 
 void GrPorterDuffXPFactory::TestGetXPOutputTypes(const GrXferProcessor* xp,
                                                  int* outPrimary,
@@ -847,7 +849,6 @@ void GrPorterDuffXPFactory::TestGetXPOutputTypes(const GrXferProcessor* xp,
     *outSecondary = blendFormula.fSecondaryOutputType;
 }
 
-
 ////////////////////////////////////////////////////////////////////////////////////////////////
 // SrcOver Global functions
 ////////////////////////////////////////////////////////////////////////////////////////////////
index 4397fcf..dabf11a 100644 (file)
@@ -112,6 +112,7 @@ bool CircularRRectEffect::onIsEqual(const GrFragmentProcessor& other) const {
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(CircularRRectEffect);
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> CircularRRectEffect::TestCreate(GrProcessorTestData* d) {
     SkScalar w = d->fRandom->nextRangeScalar(20.f, 1000.f);
     SkScalar h = d->fRandom->nextRangeScalar(20.f, 1000.f);
@@ -126,6 +127,7 @@ sk_sp<GrFragmentProcessor> CircularRRectEffect::TestCreate(GrProcessorTestData*
     } while (nullptr == fp);
     return fp;
 }
+#endif
 
 //////////////////////////////////////////////////////////////////////////////
 
@@ -445,6 +447,7 @@ bool EllipticalRRectEffect::onIsEqual(const GrFragmentProcessor& other) const {
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(EllipticalRRectEffect);
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> EllipticalRRectEffect::TestCreate(GrProcessorTestData* d) {
     SkScalar w = d->fRandom->nextRangeScalar(20.f, 1000.f);
     SkScalar h = d->fRandom->nextRangeScalar(20.f, 1000.f);
@@ -480,6 +483,7 @@ sk_sp<GrFragmentProcessor> EllipticalRRectEffect::TestCreate(GrProcessorTestData
     } while (nullptr == fp);
     return fp;
 }
+#endif
 
 //////////////////////////////////////////////////////////////////////////////
 
index 9279586..ad90e70 100644 (file)
@@ -110,10 +110,12 @@ GrColor4f GrSRGBEffect::constantOutputForConstantInput(GrColor4f input) const {
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrSRGBEffect);
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> GrSRGBEffect::TestCreate(GrProcessorTestData* d) {
     Mode testMode = static_cast<Mode>(d->fRandom->nextRangeU(0, 1));
     return sk_sp<GrFragmentProcessor>(new GrSRGBEffect(testMode));
 }
+#endif
 
 ///////////////////////////////////////////////////////////////////////////////
 
index cb4c834..e11a672 100755 (executable)
@@ -99,6 +99,8 @@ GrGLSLPrimitiveProcessor* GrRRectShadowGeoProc::createGLSLInstance(const GrShade
 
 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(GrRRectShadowGeoProc);
 
+#if GR_TEST_UTILS
 sk_sp<GrGeometryProcessor> GrRRectShadowGeoProc::TestCreate(GrProcessorTestData* d) {
     return GrRRectShadowGeoProc::Make(GrTest::TestMatrix(d->fRandom));
 }
+#endif
index 3dc6ea3..8b63fec 100644 (file)
@@ -96,6 +96,7 @@ GrGLSLFragmentProcessor* GrSimpleTextureEffect::onCreateGLSLInstance() const  {
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrSimpleTextureEffect);
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> GrSimpleTextureEffect::TestCreate(GrProcessorTestData* d) {
     int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx
                                         : GrProcessorUnitTest::kAlphaTextureIdx;
@@ -116,3 +117,4 @@ sk_sp<GrFragmentProcessor> GrSimpleTextureEffect::TestCreate(GrProcessorTestData
     return GrSimpleTextureEffect::Make(d->context(), d->textureProxy(texIdx),
                                        std::move(colorSpaceXform), matrix);
 }
+#endif
index f27b776..58707f5 100644 (file)
@@ -375,6 +375,7 @@ void GrTextureDomainEffect::onComputeInvariantOutput(GrInvariantOutput* inout) c
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrTextureDomainEffect);
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> GrTextureDomainEffect::TestCreate(GrProcessorTestData* d) {
     int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx
                                         : GrProcessorUnitTest::kAlphaTextureIdx;
@@ -398,6 +399,7 @@ sk_sp<GrFragmentProcessor> GrTextureDomainEffect::TestCreate(GrProcessorTestData
                                        bilerp ? GrSamplerParams::kBilerp_FilterMode
                                               : GrSamplerParams::kNone_FilterMode);
 }
+#endif
 
 ///////////////////////////////////////////////////////////////////////////////
 
@@ -515,6 +517,7 @@ void GrDeviceSpaceTextureDecalFragmentProcessor::onComputeInvariantOutput(
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(GrDeviceSpaceTextureDecalFragmentProcessor);
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> GrDeviceSpaceTextureDecalFragmentProcessor::TestCreate(
         GrProcessorTestData* d) {
     int texIdx = d->fRandom->nextBool() ? GrProcessorUnitTest::kSkiaPMTextureIdx
@@ -531,3 +534,4 @@ sk_sp<GrFragmentProcessor> GrDeviceSpaceTextureDecalFragmentProcessor::TestCreat
     return GrDeviceSpaceTextureDecalFragmentProcessor::Make(d->context(),
                                                             std::move(proxy), subset, pt);
 }
+#endif
index af32ade..0ecb4bd 100644 (file)
@@ -90,6 +90,7 @@ private:
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(ComposeTwoFragmentProcessor);
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> ComposeTwoFragmentProcessor::TestCreate(GrProcessorTestData* d) {
     // Create two random frag procs.
     sk_sp<GrFragmentProcessor> fpA(GrProcessorUnitTest::MakeChildFP(d));
@@ -100,6 +101,7 @@ sk_sp<GrFragmentProcessor> ComposeTwoFragmentProcessor::TestCreate(GrProcessorTe
     return sk_sp<GrFragmentProcessor>(
         new ComposeTwoFragmentProcessor(std::move(fpA), std::move(fpB), mode));
 }
+#endif
 
 GrGLSLFragmentProcessor* ComposeTwoFragmentProcessor::onCreateGLSLInstance() const{
     return new GLComposeTwoFragmentProcessor;
@@ -295,6 +297,7 @@ private:
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(ComposeOneFragmentProcessor);
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> ComposeOneFragmentProcessor::TestCreate(GrProcessorTestData* d) {
     // Create one random frag procs.
     // For now, we'll prevent either children from being a shader with children to prevent the
@@ -307,6 +310,7 @@ sk_sp<GrFragmentProcessor> ComposeOneFragmentProcessor::TestCreate(GrProcessorTe
         ComposeOneFragmentProcessor::kSrc_Child;
     return sk_sp<GrFragmentProcessor>(new ComposeOneFragmentProcessor(std::move(dst), mode, child));
 }
+#endif
 
 GrGLSLFragmentProcessor* ComposeOneFragmentProcessor::onCreateGLSLInstance() const {
     return new GLComposeOneFragmentProcessor;
index f39902f..767b7a0 100644 (file)
@@ -654,6 +654,7 @@ private:
 
 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(QuadEdgeEffect);
 
+#if GR_TEST_UTILS
 sk_sp<GrGeometryProcessor> QuadEdgeEffect::TestCreate(GrProcessorTestData* d) {
     // Doesn't work without derivative instructions.
     return d->fContext->caps()->shaderCaps()->shaderDerivativeSupport()
@@ -662,6 +663,7 @@ sk_sp<GrGeometryProcessor> QuadEdgeEffect::TestCreate(GrProcessorTestData* d) {
                                           d->fRandom->nextBool())
                    : nullptr;
 }
+#endif
 
 ///////////////////////////////////////////////////////////////////////////////
 
@@ -985,7 +987,7 @@ bool GrAAConvexPathRenderer::onDrawPath(const DrawPathArgs& args) {
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
 
 DRAW_OP_TEST_DEFINE(AAConvexPathOp) {
     GrColor color = GrRandomColor(random);
index 891eab3..f817f86 100644 (file)
@@ -551,7 +551,7 @@ bool GrAADistanceFieldPathRenderer::onDrawPath(const DrawPathArgs& args) {
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
 
 struct PathTestStruct {
     typedef GrAADistanceFieldPathRenderer::ShapeCache ShapeCache;
index a0fc9f0..13aaae4 100644 (file)
@@ -383,7 +383,7 @@ std::unique_ptr<GrDrawOp> MakeWithLocalRect(GrColor color,
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
 
 #include "GrDrawOpTest.h"
 
index 958eb57..f17b218 100644 (file)
@@ -962,7 +962,7 @@ bool GrAAHairLinePathRenderer::onDrawPath(const DrawPathArgs& args) {
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
 
 DRAW_OP_TEST_DEFINE(AAHairlineOp) {
     GrColor color = GrRandomColor(random);
index fd09d91..fdb5d7f 100644 (file)
@@ -350,7 +350,7 @@ bool GrAALinearizingConvexPathRenderer::onDrawPath(const DrawPathArgs& args) {
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
 
 DRAW_OP_TEST_DEFINE(AAFlatteningConvexPathOp) {
     GrColor color = GrRandomColor(random);
index b05e722..c30be77 100644 (file)
@@ -11,6 +11,7 @@
 #include "GrOpFlushState.h"
 #include "GrResourceKey.h"
 #include "GrResourceProvider.h"
+#include "SkStrokeRec.h"
 
 GR_DECLARE_STATIC_UNIQUE_KEY(gMiterIndexBufferKey);
 GR_DECLARE_STATIC_UNIQUE_KEY(gBevelIndexBufferKey);
@@ -578,7 +579,7 @@ std::unique_ptr<GrDrawOp> Make(GrColor color,
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
 
 #include "GrDrawOpTest.h"
 
index 52934ff..df62e05 100644 (file)
@@ -223,9 +223,11 @@ private:
 
 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(RectGeometryProcessor);
 
+#if GR_TEST_UTILS
 sk_sp<GrGeometryProcessor> RectGeometryProcessor::TestCreate(GrProcessorTestData* d) {
     return sk_sp<GrGeometryProcessor>(new RectGeometryProcessor(GrTest::TestMatrix(d->fRandom)));
 }
+#endif
 
 ///////////////////////////////////////////////////////////////////////////////
 
@@ -385,7 +387,7 @@ std::unique_ptr<GrDrawOp> GrAnalyticRectOp::Make(GrColor color,
             new AnalyticRectOp(color, viewMatrix, rect, croppedRect, bounds));
 }
 
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
 
 DRAW_OP_TEST_DEFINE(AnalyticRectOp) {
     SkMatrix viewMatrix = GrTest::TestMatrix(random);
index d4be853..7d7dbf1 100644 (file)
@@ -936,12 +936,14 @@ DashingCircleEffect::DashingCircleEffect(GrColor color,
 
 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(DashingCircleEffect);
 
+#if GR_TEST_UTILS
 sk_sp<GrGeometryProcessor> DashingCircleEffect::TestCreate(GrProcessorTestData* d) {
     AAMode aaMode = static_cast<AAMode>(d->fRandom->nextULessThan(GrDashOp::kAAModeCnt));
     return DashingCircleEffect::Make(GrRandomColor(d->fRandom),
                                     aaMode, GrTest::TestMatrix(d->fRandom),
                                     d->fRandom->nextBool());
 }
+#endif
 
 //////////////////////////////////////////////////////////////////////////////
 
@@ -1156,12 +1158,14 @@ DashingLineEffect::DashingLineEffect(GrColor color,
 
 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(DashingLineEffect);
 
+#if GR_TEST_UTILS
 sk_sp<GrGeometryProcessor> DashingLineEffect::TestCreate(GrProcessorTestData* d) {
     AAMode aaMode = static_cast<AAMode>(d->fRandom->nextULessThan(GrDashOp::kAAModeCnt));
     return DashingLineEffect::Make(GrRandomColor(d->fRandom),
                                    aaMode, GrTest::TestMatrix(d->fRandom),
                                    d->fRandom->nextBool());
 }
+#endif
 
 //////////////////////////////////////////////////////////////////////////////
 
@@ -1187,7 +1191,7 @@ static sk_sp<GrGeometryProcessor> make_dash_gp(GrColor color,
 
 /////////////////////////////////////////////////////////////////////////////////////////////////
 
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
 
 DRAW_OP_TEST_DEFINE(DashOp) {
     GrColor color = GrRandomColor(random);
index e76ded3..5ac71d8 100644 (file)
@@ -607,7 +607,7 @@ void GrDefaultPathRenderer::onStencilPath(const StencilPathArgs& args) {
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
 
 DRAW_OP_TEST_DEFINE(DefaultPathOp) {
     GrColor color = GrRandomColor(random);
index 4d78a7d..7ef7e06 100644 (file)
@@ -179,7 +179,7 @@ bool GrDrawAtlasOp::onCombineIfPossible(GrOp* t, const GrCaps& caps) {
     return true;
 }
 
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
 
 static SkRSXform random_xform(SkRandom* random) {
     static const SkScalar kMinExtent = -100.f;
index 3448249..2b63804 100644 (file)
@@ -221,7 +221,7 @@ bool GrDrawVerticesOp::onCombineIfPossible(GrOp* t, const GrCaps& caps) {
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
 
 #include "GrDrawOpTest.h"
 
index 7ef6cad..5688c9b 100644 (file)
@@ -188,7 +188,7 @@ std::unique_ptr<GrDrawOp> Make(GrColor color,
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
 
 #include "GrDrawOpTest.h"
 
index cec1cfc..cf657f0 100644 (file)
@@ -232,7 +232,7 @@ std::unique_ptr<GrDrawOp> MakeWithPerspective(GrColor color,
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
 
 #include "GrDrawOpTest.h"
 
index 417d76e..53b359e 100644 (file)
@@ -12,6 +12,7 @@
 #include "GrDrawOpTest.h"
 #include "GrMeshDrawOp.h"
 #include "GrOpFlushState.h"
+#include "SkStrokeRec.h"
 #include "SkRandom.h"
 
 /*  create a triangle strip that strokes the specified rect. There are 8
@@ -193,7 +194,7 @@ std::unique_ptr<GrDrawOp> Make(GrColor color,
 }
 }
 
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
 
 DRAW_OP_TEST_DEFINE(NonAAStrokeRectOp) {
     SkMatrix viewMatrix = GrTest::TestMatrix(random);
index f693169..2f50bb4 100644 (file)
@@ -246,11 +246,13 @@ private:
 
 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(CircleGeometryProcessor);
 
+#if GR_TEST_UTILS
 sk_sp<GrGeometryProcessor> CircleGeometryProcessor::TestCreate(GrProcessorTestData* d) {
     return sk_sp<GrGeometryProcessor>(new CircleGeometryProcessor(
             d->fRandom->nextBool(), d->fRandom->nextBool(), d->fRandom->nextBool(),
             d->fRandom->nextBool(), GrTest::TestMatrix(d->fRandom)));
 }
+#endif
 
 ///////////////////////////////////////////////////////////////////////////////
 
@@ -382,10 +384,12 @@ private:
 
 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(EllipseGeometryProcessor);
 
+#if GR_TEST_UTILS
 sk_sp<GrGeometryProcessor> EllipseGeometryProcessor::TestCreate(GrProcessorTestData* d) {
     return sk_sp<GrGeometryProcessor>(
             new EllipseGeometryProcessor(d->fRandom->nextBool(), GrTest::TestMatrix(d->fRandom)));
 }
+#endif
 
 ///////////////////////////////////////////////////////////////////////////////
 
@@ -548,10 +552,12 @@ private:
 
 GR_DEFINE_GEOMETRY_PROCESSOR_TEST(DIEllipseGeometryProcessor);
 
+#if GR_TEST_UTILS
 sk_sp<GrGeometryProcessor> DIEllipseGeometryProcessor::TestCreate(GrProcessorTestData* d) {
     return sk_sp<GrGeometryProcessor>(new DIEllipseGeometryProcessor(
             GrTest::TestMatrix(d->fRandom), (DIEllipseStyle)(d->fRandom->nextRangeU(0, 2))));
 }
+#endif
 
 ///////////////////////////////////////////////////////////////////////////////
 
@@ -2402,7 +2408,7 @@ std::unique_ptr<GrDrawOp> GrOvalOpFactory::MakeArcOp(GrColor color, const SkMatr
 
 ///////////////////////////////////////////////////////////////////////////////
 
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
 
 DRAW_OP_TEST_DEFINE(CircleOp) {
     do {
index 384733f..80a4cda 100644 (file)
@@ -934,7 +934,7 @@ bool GrPLSPathRenderer::onDrawPath(const DrawPathArgs& args) {
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
 
 DRAW_OP_TEST_DEFINE(PLSPathOp) {
     GrColor color = GrRandomColor(random);
index 1882aad..e0eadd8 100755 (executable)
@@ -923,7 +923,7 @@ std::unique_ptr<GrDrawOp> Make(GrColor color,
 }
 ///////////////////////////////////////////////////////////////////////////////
 
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
 
 DRAW_OP_TEST_DEFINE(ShadowCircleOp) {
     do {
index 509ac9f..dd0d3a0 100644 (file)
@@ -367,7 +367,7 @@ bool GrTessellatingPathRenderer::onDrawPath(const DrawPathArgs& args) {
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
 
 DRAW_OP_TEST_DEFINE(TesselatingPathOp) {
     GrColor color = GrRandomColor(random);
index 07a653c..e1dc7e2 100644 (file)
@@ -337,7 +337,7 @@ void GrAtlasTextContext::drawPosText(GrContext* context, GrRenderTargetContext*
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
 
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
 
 DRAW_OP_TEST_DEFINE(TextBlobOp) {
     static uint32_t gContextID = SK_InvalidGenID;
index 11e22d3..20a7368 100644 (file)
@@ -14,7 +14,7 @@
 #include "GrTextUtils.h"
 #include "SkTextBlobRunIterator.h"
 
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
 #include "GrDrawOpTest.h"
 #endif
 
@@ -86,7 +86,7 @@ private:
 
     sk_sp<const GrDistanceFieldAdjustTable> fDistanceAdjustTable;
 
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
     static const uint32_t kTextBlobOpScalerContextFlags =
             SkPaint::kFakeGammaAndBoostContrast_ScalerContextFlags;
     DRAW_OP_TEST_FRIEND(TextBlobOp);
index e6d738d..19f190e 100644 (file)
@@ -93,9 +93,11 @@ private:
 
 GR_DEFINE_FRAGMENT_PROCESSOR_TEST(BigKeyProcessor);
 
+#if GR_TEST_UTILS
 sk_sp<GrFragmentProcessor> BigKeyProcessor::TestCreate(GrProcessorTestData*) {
     return BigKeyProcessor::Make();
 }
+#endif
 
 //////////////////////////////////////////////////////////////////////////////
 
@@ -164,6 +166,7 @@ static sk_sp<GrRenderTargetContext> random_render_target_context(GrContext* cont
     return renderTargetContext;
 }
 
+#if GR_TEST_UTILS
 static void set_random_xpf(GrPaint* paint, GrProcessorTestData* d) {
     paint->setXPFactory(GrXPFactoryTestFactory::Get(d));
 }
@@ -281,7 +284,11 @@ static const GrUserStencilSettings* get_random_stencil(SkRandom* random) {
         return &kDoesNotWriteStencil;
     }
 }
+#endif
 
+#if !GR_TEST_UTILS
+bool GrDrawingManager::ProgramUnitTest(GrContext*, int) { return true; }
+#else
 bool GrDrawingManager::ProgramUnitTest(GrContext* context, int maxStages) {
     GrDrawingManager* drawingManager = context->contextPriv().drawingManager();
 
@@ -378,6 +385,7 @@ bool GrDrawingManager::ProgramUnitTest(GrContext* context, int maxStages) {
 
     return true;
 }
+#endif
 
 static int get_glprograms_max_stages(GrContext* context) {
     GrGLGpu* gpu = static_cast<GrGLGpu*>(context->getGpu());
index ff31e49..a23b40a 100644 (file)
@@ -244,6 +244,7 @@ static GrColor texel_color(int i, int j) {
 
 static GrColor4f texel_color4f(int i, int j) { return GrColor4f::FromGrColor(texel_color(i, j)); }
 
+#if GR_TEST_UTILS
 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ProcessorOptimizationValidationTest, reporter, ctxInfo) {
     // This tests code under development but not used in skia lib. Leaving this disabled until
     // some platform-specific issues are addressed.
@@ -370,6 +371,6 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ProcessorOptimizationValidationTest, reporter
         }
     }
 }
-#endif
-
-#endif
+#endif  // GR_TEST_UTILS
+#endif  // SK_ALLOW_STATIC_GLOBAL_INITIALIZERS
+#endif  // SK_SUPPORT_GPU