Fix checks of GR_TEST_UTILS.
We had lots of checks just checking defined but we always define
GR_TEST_UTILS
Change-Id: I588c50ddd91f71618a96ab6c9eda2050b423f611
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/319682
Commit-Queue: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/include/gpu/GrConfig.h b/include/gpu/GrConfig.h
index 858d33a..9fe6629 100644
--- a/include/gpu/GrConfig.h
+++ b/include/gpu/GrConfig.h
@@ -24,7 +24,7 @@
#endif
#if !defined(GR_GPU_STATS)
- #if defined(SK_DEBUG) || defined(SK_DUMP_STATS) || defined(GR_TEST_UTILS)
+ #if defined(SK_DEBUG) || defined(SK_DUMP_STATS) || GR_TEST_UTILS
#define GR_GPU_STATS 1
#else
#define GR_GPU_STATS 0
diff --git a/include/gpu/GrRecordingContext.h b/include/gpu/GrRecordingContext.h
index b33851f..e010c37 100644
--- a/include/gpu/GrRecordingContext.h
+++ b/include/gpu/GrRecordingContext.h
@@ -233,7 +233,7 @@
std::unique_ptr<GrAuditTrail> fAuditTrail;
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
int fSuppressWarningMessages = 0;
#endif
diff --git a/src/gpu/GrClipStack.h b/src/gpu/GrClipStack.h
index 52d2ffc..955de1c 100644
--- a/src/gpu/GrClipStack.h
+++ b/src/gpu/GrClipStack.h
@@ -77,7 +77,7 @@
GrClip::PreClipResult preApply(const SkRect& drawBounds, GrAA aa) const override;
SkIRect getConservativeBounds() const override;
-#ifdef GR_TEST_UTILS
+#if GR_TEST_UTILS
GrUniqueKey testingOnly_getLastSWMaskKey() const {
return fMasks.empty() ? GrUniqueKey() : fMasks.back().key();
}
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h
index a5f5e8c..d31d062 100644
--- a/src/gpu/GrGpu.h
+++ b/src/gpu/GrGpu.h
@@ -525,10 +525,12 @@
void incTextureCreates() {}
void incTextureUploads() {}
void incTransfersToTexture() {}
+ void incTransfersFromSurface() {}
void incStencilAttachmentCreates() {}
void incNumDraws() {}
void incNumFailedDraws() {}
void incNumSubmitToGpus() {}
+ void incNumScratchTexturesReused() {}
void incNumInlineCompilationFailures() {}
void incNumInlineProgramCacheResult(ProgramCacheResult stat) {}
void incNumPreCompilationFailures() {}
diff --git a/src/gpu/ccpr/GrOctoBounds.cpp b/src/gpu/ccpr/GrOctoBounds.cpp
index 61e67c4..d3666af 100644
--- a/src/gpu/ccpr/GrOctoBounds.cpp
+++ b/src/gpu/ccpr/GrOctoBounds.cpp
@@ -114,7 +114,7 @@
return true;
}
-#if defined(SK_DEBUG) || defined(GR_TEST_UTILS)
+#if defined(SK_DEBUG) || GR_TEST_UTILS
void GrOctoBounds::validateBoundsAreTight() const {
this->validateBoundsAreTight([](bool cond, const char* file, int line, const char* code) {
SkASSERTF(cond, "%s(%d): assertion failure: \"assert(%s)\"", file, line, code);
diff --git a/src/gpu/ccpr/GrOctoBounds.h b/src/gpu/ccpr/GrOctoBounds.h
index d2272ae..5ef2c11 100644
--- a/src/gpu/ccpr/GrOctoBounds.h
+++ b/src/gpu/ccpr/GrOctoBounds.h
@@ -101,7 +101,7 @@
constexpr static float Get_x(float x45, float y45) { return (x45 + y45) * .5f; }
constexpr static float Get_y(float x45, float y45) { return (y45 - x45) * .5f; }
-#if defined(SK_DEBUG) || defined(GR_TEST_UTILS)
+#if defined(SK_DEBUG) || GR_TEST_UTILS
void validateBoundsAreTight() const;
void validateBoundsAreTight(const std::function<void(
bool cond, const char* file, int line, const char* code)>& validateFn) const;
diff --git a/src/sksl/SkSLCPPCodeGenerator.cpp b/src/sksl/SkSLCPPCodeGenerator.cpp
index 41404c6..9c8efb2 100644
--- a/src/sksl/SkSLCPPCodeGenerator.cpp
+++ b/src/sksl/SkSLCPPCodeGenerator.cpp
@@ -15,7 +15,7 @@
#include <algorithm>
-#if defined(SKSL_STANDALONE) || defined(GR_TEST_UTILS)
+#if defined(SKSL_STANDALONE) || GR_TEST_UTILS
namespace SkSL {
@@ -1445,4 +1445,4 @@
} // namespace SkSL
-#endif // defined(SKSL_STANDALONE) || defined(GR_TEST_UTILS)
+#endif // defined(SKSL_STANDALONE) || GR_TEST_UTILS
diff --git a/src/sksl/SkSLCPPCodeGenerator.h b/src/sksl/SkSLCPPCodeGenerator.h
index 5ebc0bc..1983c0c 100644
--- a/src/sksl/SkSLCPPCodeGenerator.h
+++ b/src/sksl/SkSLCPPCodeGenerator.h
@@ -13,7 +13,7 @@
#include <set>
-#if defined(SKSL_STANDALONE) || defined(GR_TEST_UTILS)
+#if defined(SKSL_STANDALONE) || GR_TEST_UTILS
namespace SkSL {
@@ -159,6 +159,6 @@
} // namespace SkSL
-#endif // defined(SKSL_STANDALONE) || defined(GR_TEST_UTILS)
+#endif // defined(SKSL_STANDALONE) || GR_TEST_UTILS
#endif // SKSL_CPPCODEGENERATOR
diff --git a/src/sksl/SkSLCPPUniformCTypes.cpp b/src/sksl/SkSLCPPUniformCTypes.cpp
index 28f4383..cfa862d 100644
--- a/src/sksl/SkSLCPPUniformCTypes.cpp
+++ b/src/sksl/SkSLCPPUniformCTypes.cpp
@@ -13,7 +13,7 @@
#include <mutex>
#include <vector>
-#if defined(SKSL_STANDALONE) || defined(GR_TEST_UTILS)
+#if defined(SKSL_STANDALONE) || GR_TEST_UTILS
namespace SkSL {
@@ -288,4 +288,4 @@
} // namespace SkSL
-#endif // defined(SKSL_STANDALONE) || defined(GR_TEST_UTILS)
+#endif // defined(SKSL_STANDALONE) || GR_TEST_UTILS
diff --git a/src/sksl/SkSLCPPUniformCTypes.h b/src/sksl/SkSLCPPUniformCTypes.h
index 79ea4ac..f3455e9 100644
--- a/src/sksl/SkSLCPPUniformCTypes.h
+++ b/src/sksl/SkSLCPPUniformCTypes.h
@@ -13,7 +13,7 @@
#include "src/sksl/ir/SkSLType.h"
#include "src/sksl/ir/SkSLVariable.h"
-#if defined(SKSL_STANDALONE) || defined(GR_TEST_UTILS)
+#if defined(SKSL_STANDALONE) || GR_TEST_UTILS
namespace SkSL {
@@ -131,6 +131,6 @@
} // namespace SkSL
-#endif // defined(SKSL_STANDALONE) || defined(GR_TEST_UTILS)
+#endif // defined(SKSL_STANDALONE) || GR_TEST_UTILS
#endif // SkSLUniformCTypes_DEFINED
diff --git a/src/sksl/SkSLCompiler.cpp b/src/sksl/SkSLCompiler.cpp
index 1baf2f7..172b4d1 100644
--- a/src/sksl/SkSLCompiler.cpp
+++ b/src/sksl/SkSLCompiler.cpp
@@ -1823,7 +1823,7 @@
return result;
}
-#if defined(SKSL_STANDALONE) || defined(GR_TEST_UTILS)
+#if defined(SKSL_STANDALONE) || GR_TEST_UTILS
bool Compiler::toCPP(Program& program, String name, OutputStream& out) {
fSource = program.fSource.get();
CPPCodeGenerator cg(fContext.get(), &program, this, name, &out);
@@ -1839,7 +1839,7 @@
fSource = nullptr;
return result;
}
-#endif // defined(SKSL_STANDALONE) || defined(GR_TEST_UTILS)
+#endif // defined(SKSL_STANDALONE) || GR_TEST_UTILS
#endif // defined(SKSL_STANDALONE) || SK_SUPPORT_GPU
diff --git a/src/sksl/SkSLCompiler.h b/src/sksl/SkSLCompiler.h
index d3915f4..527484f 100644
--- a/src/sksl/SkSLCompiler.h
+++ b/src/sksl/SkSLCompiler.h
@@ -140,7 +140,7 @@
bool toMetal(Program& program, String* out);
-#if defined(SKSL_STANDALONE) || defined(GR_TEST_UTILS)
+#if defined(SKSL_STANDALONE) || GR_TEST_UTILS
bool toCPP(Program& program, String name, OutputStream& out);
bool toH(Program& program, String name, OutputStream& out);
diff --git a/src/sksl/SkSLHCodeGenerator.cpp b/src/sksl/SkSLHCodeGenerator.cpp
index e5bdd94..c7c5200 100644
--- a/src/sksl/SkSLHCodeGenerator.cpp
+++ b/src/sksl/SkSLHCodeGenerator.cpp
@@ -19,7 +19,7 @@
#include <set>
-#if defined(SKSL_STANDALONE) || defined(GR_TEST_UTILS)
+#if defined(SKSL_STANDALONE) || GR_TEST_UTILS
namespace SkSL {
@@ -393,4 +393,4 @@
} // namespace SkSL
-#endif // defined(SKSL_STANDALONE) || defined(GR_TEST_UTILS)
+#endif // defined(SKSL_STANDALONE) || GR_TEST_UTILS
diff --git a/src/sksl/SkSLHCodeGenerator.h b/src/sksl/SkSLHCodeGenerator.h
index fa4a3f3..d524e9b 100644
--- a/src/sksl/SkSLHCodeGenerator.h
+++ b/src/sksl/SkSLHCodeGenerator.h
@@ -15,7 +15,7 @@
#include <cctype>
-#if defined(SKSL_STANDALONE) || defined(GR_TEST_UTILS)
+#if defined(SKSL_STANDALONE) || GR_TEST_UTILS
constexpr const char* kFragmentProcessorHeader =
R"(
@@ -85,6 +85,6 @@
} // namespace SkSL
-#endif // defined(SKSL_STANDALONE) || defined(GR_TEST_UTILS)
+#endif // defined(SKSL_STANDALONE) || GR_TEST_UTILS
#endif // SKSL_HCODEGENERATOR