make GR_TEST_UTILS=0 work
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>
diff --git a/src/gpu/GrDefaultGeoProcFactory.cpp b/src/gpu/GrDefaultGeoProcFactory.cpp
index ab57c0b..f371e24 100644
--- a/src/gpu/GrDefaultGeoProcFactory.cpp
+++ b/src/gpu/GrDefaultGeoProcFactory.cpp
@@ -237,6 +237,7 @@
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 @@
d->fRandom->nextBool(),
GrRandomCoverage(d->fRandom));
}
+#endif
sk_sp<GrGeometryProcessor> GrDefaultGeoProcFactory::Make(const Color& color,
const Coverage& coverage,
diff --git a/src/gpu/GrDrawOpTest.cpp b/src/gpu/GrDrawOpTest.cpp
index 3cf1a90..5d0aa56 100644
--- a/src/gpu/GrDrawOpTest.cpp
+++ b/src/gpu/GrDrawOpTest.cpp
@@ -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);
diff --git a/src/gpu/GrDrawOpTest.h b/src/gpu/GrDrawOpTest.h
index 46abf18..8c98597 100644
--- a/src/gpu/GrDrawOpTest.h
+++ b/src/gpu/GrDrawOpTest.h
@@ -11,7 +11,7 @@
#include "GrTestUtils.h"
#include "SkRefCnt.h"
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
class GrDrawOp;
class GrContext;
diff --git a/src/gpu/GrProcessor.cpp b/src/gpu/GrProcessor.cpp
index 56d3e7f..897a755 100644
--- a/src/gpu/GrProcessor.cpp
+++ b/src/gpu/GrProcessor.cpp
@@ -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 @@
}
#endif
+#endif
// We use a global pool protected by a mutex(spinlock). Chrome may use the same GrContext on
diff --git a/src/gpu/GrProcessorUnitTest.cpp b/src/gpu/GrProcessorUnitTest.cpp
index 3f43389..71b112d 100644
--- a/src/gpu/GrProcessorUnitTest.cpp
+++ b/src/gpu/GrProcessorUnitTest.cpp
@@ -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 @@
return nullptr;
#endif
}
+#endif
diff --git a/src/gpu/GrTestUtils.cpp b/src/gpu/GrTestUtils.cpp
index c9cccb8..35af494 100644
--- a/src/gpu/GrTestUtils.cpp
+++ b/src/gpu/GrTestUtils.cpp
@@ -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,
diff --git a/src/gpu/SkGr.cpp b/src/gpu/SkGr.cpp
index aef3c0d..ad43eef 100644
--- a/src/gpu/SkGr.cpp
+++ b/src/gpu/SkGr.cpp
@@ -14,6 +14,7 @@
#include "GrGpuResourcePriv.h"
#include "GrRenderTargetContext.h"
#include "GrTexturePriv.h"
+#include "GrTextureProxy.h"
#include "GrTypes.h"
#include "GrXferProcessor.h"
diff --git a/src/gpu/effects/GrBezierEffect.cpp b/src/gpu/effects/GrBezierEffect.cpp
index 834b11d..4877072 100644
--- a/src/gpu/effects/GrBezierEffect.cpp
+++ b/src/gpu/effects/GrBezierEffect.cpp
@@ -258,6 +258,7 @@
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 @@
} while (nullptr == gp);
return gp;
}
+#endif
//////////////////////////////////////////////////////////////////////////////
// Quad
@@ -459,6 +461,7 @@
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 @@
} while (nullptr == gp);
return gp;
}
+#endif
//////////////////////////////////////////////////////////////////////////////
// Cubic
@@ -679,6 +683,7 @@
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 @@
} while (nullptr == gp);
return gp;
}
+#endif
diff --git a/src/gpu/effects/GrBicubicEffect.cpp b/src/gpu/effects/GrBicubicEffect.cpp
index cb58995..2499c20 100644
--- a/src/gpu/effects/GrBicubicEffect.cpp
+++ b/src/gpu/effects/GrBicubicEffect.cpp
@@ -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 @@
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 @@
return GrBicubicEffect::Make(d->context(), d->textureProxy(texIdx), std::move(colorSpaceXform),
SkMatrix::I(), kClampClamp);
}
+#endif
//////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/effects/GrBitmapTextGeoProc.cpp b/src/gpu/effects/GrBitmapTextGeoProc.cpp
index 3c4566e..60df6b9 100644
--- a/src/gpu/effects/GrBitmapTextGeoProc.cpp
+++ b/src/gpu/effects/GrBitmapTextGeoProc.cpp
@@ -154,6 +154,7 @@
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 @@
format, GrTest::TestMatrix(d->fRandom),
d->fRandom->nextBool());
}
+#endif
diff --git a/src/gpu/effects/GrConfigConversionEffect.cpp b/src/gpu/effects/GrConfigConversionEffect.cpp
index d9b408a..d9a6fef 100644
--- a/src/gpu/effects/GrConfigConversionEffect.cpp
+++ b/src/gpu/effects/GrConfigConversionEffect.cpp
@@ -149,6 +149,7 @@
#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 @@
d->textureProxy(GrProcessorUnitTest::kSkiaPMTextureIdx),
swizzle, pmConv, GrTest::TestMatrix(d->fRandom)));
}
+#endif
#if !defined(__clang__) && _MSC_FULL_VER >= 190024213
// Restore optimization settings.
diff --git a/src/gpu/effects/GrConstColorProcessor.cpp b/src/gpu/effects/GrConstColorProcessor.cpp
index 3875ffc..1d20512 100644
--- a/src/gpu/effects/GrConstColorProcessor.cpp
+++ b/src/gpu/effects/GrConstColorProcessor.cpp
@@ -116,6 +116,7 @@
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 @@
InputMode mode = static_cast<InputMode>(d->fRandom->nextULessThan(kInputModeCnt));
return GrConstColorProcessor::Make(color, mode);
}
+#endif
diff --git a/src/gpu/effects/GrConvexPolyEffect.cpp b/src/gpu/effects/GrConvexPolyEffect.cpp
index 4100a0f..db8c2d9 100644
--- a/src/gpu/effects/GrConvexPolyEffect.cpp
+++ b/src/gpu/effects/GrConvexPolyEffect.cpp
@@ -63,6 +63,7 @@
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 @@
} while (nullptr == fp);
return fp;
}
+#endif
//////////////////////////////////////////////////////////////////////////////
@@ -362,6 +364,7 @@
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 @@
} while (nullptr == fp);
return fp;
}
+#endif
diff --git a/src/gpu/effects/GrCoverageSetOpXP.cpp b/src/gpu/effects/GrCoverageSetOpXP.cpp
index 05e9fad..b8902de 100644
--- a/src/gpu/effects/GrCoverageSetOpXP.cpp
+++ b/src/gpu/effects/GrCoverageSetOpXP.cpp
@@ -347,8 +347,10 @@
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
diff --git a/src/gpu/effects/GrCustomXfermode.cpp b/src/gpu/effects/GrCustomXfermode.cpp
index f8af7db..4c33b9b 100644
--- a/src/gpu/effects/GrCustomXfermode.cpp
+++ b/src/gpu/effects/GrCustomXfermode.cpp
@@ -382,12 +382,14 @@
}
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
///////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/effects/GrDisableColorXP.cpp b/src/gpu/effects/GrDisableColorXP.cpp
index 69c34ec..7323331 100644
--- a/src/gpu/effects/GrDisableColorXP.cpp
+++ b/src/gpu/effects/GrDisableColorXP.cpp
@@ -98,6 +98,8 @@
GR_DEFINE_XP_FACTORY_TEST(GrDisableColorXPFactory);
+#if GR_TEST_UTILS
const GrXPFactory* GrDisableColorXPFactory::TestGet(GrProcessorTestData*) {
return GrDisableColorXPFactory::Get();
}
+#endif
diff --git a/src/gpu/effects/GrDistanceFieldGeoProc.cpp b/src/gpu/effects/GrDistanceFieldGeoProc.cpp
index ee28760..0f9625e 100644
--- a/src/gpu/effects/GrDistanceFieldGeoProc.cpp
+++ b/src/gpu/effects/GrDistanceFieldGeoProc.cpp
@@ -265,6 +265,7 @@
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 @@
flags,
d->fRandom->nextBool());
}
+#endif
///////////////////////////////////////////////////////////////////////////////
@@ -503,6 +505,7 @@
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 @@
flags,
d->fRandom->nextBool());
}
+#endif
///////////////////////////////////////////////////////////////////////////////
@@ -801,6 +805,7 @@
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 @@
flags,
d->fRandom->nextBool());
}
+#endif
diff --git a/src/gpu/effects/GrDitherEffect.cpp b/src/gpu/effects/GrDitherEffect.cpp
index 24e3ba6..34a1565 100644
--- a/src/gpu/effects/GrDitherEffect.cpp
+++ b/src/gpu/effects/GrDitherEffect.cpp
@@ -50,9 +50,11 @@
GR_DEFINE_FRAGMENT_PROCESSOR_TEST(DitherEffect);
+#if GR_TEST_UTILS
sk_sp<GrFragmentProcessor> DitherEffect::TestCreate(GrProcessorTestData*) {
return DitherEffect::Make();
}
+#endif
//////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.cpp b/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.cpp
index 66aba13..2d485e6 100644
--- a/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.cpp
+++ b/src/gpu/effects/GrGaussianConvolutionFragmentProcessor.cpp
@@ -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 @@
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 @@
return GrGaussianConvolutionFragmentProcessor::Make(
d->context(), d->textureProxy(texIdx), dir, radius, sigma, useBounds, bounds);
}
+#endif
diff --git a/src/gpu/effects/GrMatrixConvolutionEffect.cpp b/src/gpu/effects/GrMatrixConvolutionEffect.cpp
index 86fd565..1a40514 100644
--- a/src/gpu/effects/GrMatrixConvolutionEffect.cpp
+++ b/src/gpu/effects/GrMatrixConvolutionEffect.cpp
@@ -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 @@
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 @@
tileMode,
convolveAlpha);
}
+#endif
diff --git a/src/gpu/effects/GrOvalEffect.cpp b/src/gpu/effects/GrOvalEffect.cpp
index 3b0a887..b64ac56 100644
--- a/src/gpu/effects/GrOvalEffect.cpp
+++ b/src/gpu/effects/GrOvalEffect.cpp
@@ -77,6 +77,7 @@
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 @@
} while (kHairlineAA_GrProcessorEdgeType == et);
return CircleEffect::Make(et, center, radius);
}
+#endif
//////////////////////////////////////////////////////////////////////////////
@@ -246,6 +248,7 @@
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 @@
} while (kHairlineAA_GrProcessorEdgeType == et);
return EllipseEffect::Make(et, center, rx, ry);
}
+#endif
//////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/effects/GrPorterDuffXferProcessor.cpp b/src/gpu/effects/GrPorterDuffXferProcessor.cpp
index 59710eb..8289561 100644
--- a/src/gpu/effects/GrPorterDuffXferProcessor.cpp
+++ b/src/gpu/effects/GrPorterDuffXferProcessor.cpp
@@ -830,10 +830,12 @@
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 @@
*outSecondary = blendFormula.fSecondaryOutputType;
}
-
////////////////////////////////////////////////////////////////////////////////////////////////
// SrcOver Global functions
////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/effects/GrRRectEffect.cpp b/src/gpu/effects/GrRRectEffect.cpp
index 4397fcf..dabf11a 100644
--- a/src/gpu/effects/GrRRectEffect.cpp
+++ b/src/gpu/effects/GrRRectEffect.cpp
@@ -112,6 +112,7 @@
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 @@
} while (nullptr == fp);
return fp;
}
+#endif
//////////////////////////////////////////////////////////////////////////////
@@ -445,6 +447,7 @@
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 @@
} while (nullptr == fp);
return fp;
}
+#endif
//////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/effects/GrSRGBEffect.cpp b/src/gpu/effects/GrSRGBEffect.cpp
index 9279586..ad90e70 100644
--- a/src/gpu/effects/GrSRGBEffect.cpp
+++ b/src/gpu/effects/GrSRGBEffect.cpp
@@ -110,10 +110,12 @@
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
///////////////////////////////////////////////////////////////////////////////
diff --git a/src/gpu/effects/GrShadowGeoProc.cpp b/src/gpu/effects/GrShadowGeoProc.cpp
index cb4c834..e11a672 100755
--- a/src/gpu/effects/GrShadowGeoProc.cpp
+++ b/src/gpu/effects/GrShadowGeoProc.cpp
@@ -99,6 +99,8 @@
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
diff --git a/src/gpu/effects/GrSimpleTextureEffect.cpp b/src/gpu/effects/GrSimpleTextureEffect.cpp
index 3dc6ea3..8b63fec 100644
--- a/src/gpu/effects/GrSimpleTextureEffect.cpp
+++ b/src/gpu/effects/GrSimpleTextureEffect.cpp
@@ -96,6 +96,7 @@
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 @@
return GrSimpleTextureEffect::Make(d->context(), d->textureProxy(texIdx),
std::move(colorSpaceXform), matrix);
}
+#endif
diff --git a/src/gpu/effects/GrTextureDomain.cpp b/src/gpu/effects/GrTextureDomain.cpp
index f27b776..58707f5 100644
--- a/src/gpu/effects/GrTextureDomain.cpp
+++ b/src/gpu/effects/GrTextureDomain.cpp
@@ -375,6 +375,7 @@
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 @@
bilerp ? GrSamplerParams::kBilerp_FilterMode
: GrSamplerParams::kNone_FilterMode);
}
+#endif
///////////////////////////////////////////////////////////////////////////////
@@ -515,6 +517,7 @@
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 @@
return GrDeviceSpaceTextureDecalFragmentProcessor::Make(d->context(),
std::move(proxy), subset, pt);
}
+#endif
diff --git a/src/gpu/effects/GrXfermodeFragmentProcessor.cpp b/src/gpu/effects/GrXfermodeFragmentProcessor.cpp
index af32ade..0ecb4bd 100644
--- a/src/gpu/effects/GrXfermodeFragmentProcessor.cpp
+++ b/src/gpu/effects/GrXfermodeFragmentProcessor.cpp
@@ -90,6 +90,7 @@
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 @@
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 @@
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 @@
ComposeOneFragmentProcessor::kSrc_Child;
return sk_sp<GrFragmentProcessor>(new ComposeOneFragmentProcessor(std::move(dst), mode, child));
}
+#endif
GrGLSLFragmentProcessor* ComposeOneFragmentProcessor::onCreateGLSLInstance() const {
return new GLComposeOneFragmentProcessor;
diff --git a/src/gpu/ops/GrAAConvexPathRenderer.cpp b/src/gpu/ops/GrAAConvexPathRenderer.cpp
index f39902f..767b7a0 100644
--- a/src/gpu/ops/GrAAConvexPathRenderer.cpp
+++ b/src/gpu/ops/GrAAConvexPathRenderer.cpp
@@ -654,6 +654,7 @@
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 @@
d->fRandom->nextBool())
: nullptr;
}
+#endif
///////////////////////////////////////////////////////////////////////////////
@@ -985,7 +987,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
DRAW_OP_TEST_DEFINE(AAConvexPathOp) {
GrColor color = GrRandomColor(random);
diff --git a/src/gpu/ops/GrAADistanceFieldPathRenderer.cpp b/src/gpu/ops/GrAADistanceFieldPathRenderer.cpp
index 891eab3..f817f86 100644
--- a/src/gpu/ops/GrAADistanceFieldPathRenderer.cpp
+++ b/src/gpu/ops/GrAADistanceFieldPathRenderer.cpp
@@ -551,7 +551,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
struct PathTestStruct {
typedef GrAADistanceFieldPathRenderer::ShapeCache ShapeCache;
diff --git a/src/gpu/ops/GrAAFillRectOp.cpp b/src/gpu/ops/GrAAFillRectOp.cpp
index a0fc9f0..13aaae4 100644
--- a/src/gpu/ops/GrAAFillRectOp.cpp
+++ b/src/gpu/ops/GrAAFillRectOp.cpp
@@ -383,7 +383,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
#include "GrDrawOpTest.h"
diff --git a/src/gpu/ops/GrAAHairLinePathRenderer.cpp b/src/gpu/ops/GrAAHairLinePathRenderer.cpp
index 958eb57..f17b218 100644
--- a/src/gpu/ops/GrAAHairLinePathRenderer.cpp
+++ b/src/gpu/ops/GrAAHairLinePathRenderer.cpp
@@ -962,7 +962,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
DRAW_OP_TEST_DEFINE(AAHairlineOp) {
GrColor color = GrRandomColor(random);
diff --git a/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp b/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp
index fd09d91..fdb5d7f 100644
--- a/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp
+++ b/src/gpu/ops/GrAALinearizingConvexPathRenderer.cpp
@@ -350,7 +350,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
DRAW_OP_TEST_DEFINE(AAFlatteningConvexPathOp) {
GrColor color = GrRandomColor(random);
diff --git a/src/gpu/ops/GrAAStrokeRectOp.cpp b/src/gpu/ops/GrAAStrokeRectOp.cpp
index b05e722..c30be77 100644
--- a/src/gpu/ops/GrAAStrokeRectOp.cpp
+++ b/src/gpu/ops/GrAAStrokeRectOp.cpp
@@ -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 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
#include "GrDrawOpTest.h"
diff --git a/src/gpu/ops/GrAnalyticRectOp.cpp b/src/gpu/ops/GrAnalyticRectOp.cpp
index 52934ff..df62e05 100644
--- a/src/gpu/ops/GrAnalyticRectOp.cpp
+++ b/src/gpu/ops/GrAnalyticRectOp.cpp
@@ -223,9 +223,11 @@
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 @@
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);
diff --git a/src/gpu/ops/GrDashOp.cpp b/src/gpu/ops/GrDashOp.cpp
index d4be853..7d7dbf1 100644
--- a/src/gpu/ops/GrDashOp.cpp
+++ b/src/gpu/ops/GrDashOp.cpp
@@ -936,12 +936,14 @@
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 @@
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 @@
/////////////////////////////////////////////////////////////////////////////////////////////////
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
DRAW_OP_TEST_DEFINE(DashOp) {
GrColor color = GrRandomColor(random);
diff --git a/src/gpu/ops/GrDefaultPathRenderer.cpp b/src/gpu/ops/GrDefaultPathRenderer.cpp
index e76ded3..5ac71d8 100644
--- a/src/gpu/ops/GrDefaultPathRenderer.cpp
+++ b/src/gpu/ops/GrDefaultPathRenderer.cpp
@@ -607,7 +607,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
DRAW_OP_TEST_DEFINE(DefaultPathOp) {
GrColor color = GrRandomColor(random);
diff --git a/src/gpu/ops/GrDrawAtlasOp.cpp b/src/gpu/ops/GrDrawAtlasOp.cpp
index 4d78a7d..7ef7e06 100644
--- a/src/gpu/ops/GrDrawAtlasOp.cpp
+++ b/src/gpu/ops/GrDrawAtlasOp.cpp
@@ -179,7 +179,7 @@
return true;
}
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
static SkRSXform random_xform(SkRandom* random) {
static const SkScalar kMinExtent = -100.f;
diff --git a/src/gpu/ops/GrDrawVerticesOp.cpp b/src/gpu/ops/GrDrawVerticesOp.cpp
index 3448249..2b63804 100644
--- a/src/gpu/ops/GrDrawVerticesOp.cpp
+++ b/src/gpu/ops/GrDrawVerticesOp.cpp
@@ -221,7 +221,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
#include "GrDrawOpTest.h"
diff --git a/src/gpu/ops/GrNonAAFillRectOp.cpp b/src/gpu/ops/GrNonAAFillRectOp.cpp
index 7ef6cad..5688c9b 100644
--- a/src/gpu/ops/GrNonAAFillRectOp.cpp
+++ b/src/gpu/ops/GrNonAAFillRectOp.cpp
@@ -188,7 +188,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
#include "GrDrawOpTest.h"
diff --git a/src/gpu/ops/GrNonAAFillRectPerspectiveOp.cpp b/src/gpu/ops/GrNonAAFillRectPerspectiveOp.cpp
index cec1cfc..cf657f0 100644
--- a/src/gpu/ops/GrNonAAFillRectPerspectiveOp.cpp
+++ b/src/gpu/ops/GrNonAAFillRectPerspectiveOp.cpp
@@ -232,7 +232,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
#include "GrDrawOpTest.h"
diff --git a/src/gpu/ops/GrNonAAStrokeRectOp.cpp b/src/gpu/ops/GrNonAAStrokeRectOp.cpp
index 417d76e..53b359e 100644
--- a/src/gpu/ops/GrNonAAStrokeRectOp.cpp
+++ b/src/gpu/ops/GrNonAAStrokeRectOp.cpp
@@ -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 @@
}
}
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
DRAW_OP_TEST_DEFINE(NonAAStrokeRectOp) {
SkMatrix viewMatrix = GrTest::TestMatrix(random);
diff --git a/src/gpu/ops/GrOvalOpFactory.cpp b/src/gpu/ops/GrOvalOpFactory.cpp
index f693169..2f50bb4 100644
--- a/src/gpu/ops/GrOvalOpFactory.cpp
+++ b/src/gpu/ops/GrOvalOpFactory.cpp
@@ -246,11 +246,13 @@
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 @@
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 @@
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 @@
///////////////////////////////////////////////////////////////////////////////
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
DRAW_OP_TEST_DEFINE(CircleOp) {
do {
diff --git a/src/gpu/ops/GrPLSPathRenderer.cpp b/src/gpu/ops/GrPLSPathRenderer.cpp
index 384733f..80a4cda 100644
--- a/src/gpu/ops/GrPLSPathRenderer.cpp
+++ b/src/gpu/ops/GrPLSPathRenderer.cpp
@@ -934,7 +934,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
DRAW_OP_TEST_DEFINE(PLSPathOp) {
GrColor color = GrRandomColor(random);
diff --git a/src/gpu/ops/GrShadowRRectOp.cpp b/src/gpu/ops/GrShadowRRectOp.cpp
index 1882aad..e0eadd8 100755
--- a/src/gpu/ops/GrShadowRRectOp.cpp
+++ b/src/gpu/ops/GrShadowRRectOp.cpp
@@ -923,7 +923,7 @@
}
///////////////////////////////////////////////////////////////////////////////
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
DRAW_OP_TEST_DEFINE(ShadowCircleOp) {
do {
diff --git a/src/gpu/ops/GrTessellatingPathRenderer.cpp b/src/gpu/ops/GrTessellatingPathRenderer.cpp
index 509ac9f..dd0d3a0 100644
--- a/src/gpu/ops/GrTessellatingPathRenderer.cpp
+++ b/src/gpu/ops/GrTessellatingPathRenderer.cpp
@@ -367,7 +367,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
DRAW_OP_TEST_DEFINE(TesselatingPathOp) {
GrColor color = GrRandomColor(random);
diff --git a/src/gpu/text/GrAtlasTextContext.cpp b/src/gpu/text/GrAtlasTextContext.cpp
index 07a653c..e1dc7e2 100644
--- a/src/gpu/text/GrAtlasTextContext.cpp
+++ b/src/gpu/text/GrAtlasTextContext.cpp
@@ -337,7 +337,7 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
DRAW_OP_TEST_DEFINE(TextBlobOp) {
static uint32_t gContextID = SK_InvalidGenID;
diff --git a/src/gpu/text/GrAtlasTextContext.h b/src/gpu/text/GrAtlasTextContext.h
index 11e22d3..20a7368 100644
--- a/src/gpu/text/GrAtlasTextContext.h
+++ b/src/gpu/text/GrAtlasTextContext.h
@@ -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 @@
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);