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>
This commit is contained in:
Greg Daniel 2020-09-25 11:12:56 -04:00 committed by Skia Commit-Bot
parent d7ab450278
commit a28ea67c2a
14 changed files with 22 additions and 20 deletions

View File

@ -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

View File

@ -233,7 +233,7 @@ private:
std::unique_ptr<GrAuditTrail> fAuditTrail;
#ifdef GR_TEST_UTILS
#if GR_TEST_UTILS
int fSuppressWarningMessages = 0;
#endif

View File

@ -77,7 +77,7 @@ public:
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();
}

View File

@ -525,10 +525,12 @@ public:
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() {}

View File

@ -114,7 +114,7 @@ bool GrOctoBounds::clip(const SkIRect& clipRect) {
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);

View File

@ -101,7 +101,7 @@ public:
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;

View File

@ -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 @@ bool CPPCodeGenerator::generateCode() {
} // namespace SkSL
#endif // defined(SKSL_STANDALONE) || defined(GR_TEST_UTILS)
#endif // defined(SKSL_STANDALONE) || GR_TEST_UTILS

View File

@ -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 @@ private:
} // namespace SkSL
#endif // defined(SKSL_STANDALONE) || defined(GR_TEST_UTILS)
#endif // defined(SKSL_STANDALONE) || GR_TEST_UTILS
#endif // SKSL_CPPCODEGENERATOR

View File

@ -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 @@ const UniformCTypeMapper* UniformCTypeMapper::Get(const Context& context, const
} // namespace SkSL
#endif // defined(SKSL_STANDALONE) || defined(GR_TEST_UTILS)
#endif // defined(SKSL_STANDALONE) || GR_TEST_UTILS

View File

@ -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 @@ private:
} // namespace SkSL
#endif // defined(SKSL_STANDALONE) || defined(GR_TEST_UTILS)
#endif // defined(SKSL_STANDALONE) || GR_TEST_UTILS
#endif // SkSLUniformCTypes_DEFINED

View File

@ -1823,7 +1823,7 @@ bool Compiler::toMetal(Program& program, String* out) {
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 @@ bool Compiler::toH(Program& program, String name, OutputStream& out) {
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

View File

@ -140,7 +140,7 @@ public:
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);

View File

@ -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 @@ bool HCodeGenerator::generateCode() {
} // namespace SkSL
#endif // defined(SKSL_STANDALONE) || defined(GR_TEST_UTILS)
#endif // defined(SKSL_STANDALONE) || GR_TEST_UTILS

View File

@ -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 @@ private:
} // namespace SkSL
#endif // defined(SKSL_STANDALONE) || defined(GR_TEST_UTILS)
#endif // defined(SKSL_STANDALONE) || GR_TEST_UTILS
#endif // SKSL_HCODEGENERATOR