Remove SK_SUPPORT_GPU checks in tool-only code
Most of this is (obviously) not necessary to do, but once
I started, I figured I'd just get it all. Tools (nanobench,
DM, skiaserve), all GMs, benches, and unit tests, plus support
code (command line parsing and config stuff).
This is almost entirely mechanical.
Bug: skia:
Change-Id: I209500f8df8c5bd43f8298ff26440d1c4d7425fb
Reviewed-on: https://skia-review.googlesource.com/131153
Reviewed-by: Mike Klein <mtklein@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/bench/CubicKLMBench.cpp b/bench/CubicKLMBench.cpp
index 191e180..8e13a2d 100644
--- a/bench/CubicKLMBench.cpp
+++ b/bench/CubicKLMBench.cpp
@@ -7,8 +7,6 @@
#include "Benchmark.h"
-#if SK_SUPPORT_GPU
-
#include "GrPathUtils.h"
#include "SkGeometry.h"
@@ -63,5 +61,3 @@
1064.62f, 135.688f, 1042.63f, 585.187f); )
DEF_BENCH( return new CubicKLMBench(635.625f, 614.687f, 171.625f, 236.188f,
1064.62f, 135.688f, 516.625f, 570.187f); )
-
-#endif
diff --git a/bench/GrCCGeometryBench.cpp b/bench/GrCCGeometryBench.cpp
index 0628644..5406cea 100644
--- a/bench/GrCCGeometryBench.cpp
+++ b/bench/GrCCGeometryBench.cpp
@@ -7,8 +7,6 @@
#include "Benchmark.h"
-#if SK_SUPPORT_GPU
-
#include "ccpr/GrCCGeometry.h"
#include "SkGeometry.h"
@@ -93,5 +91,3 @@
DEF_BENCH( return new GrCCGeometryBench(560.049988f, 364.049988f, 217.750000f, 314.049988f,
21.750000f, 364.950012f, 83.049988f, 624.950012f,
"0_roots"); )
-
-#endif
diff --git a/bench/GrMemoryPoolBench.cpp b/bench/GrMemoryPoolBench.cpp
index 55ba3e6..b4b05cc 100644
--- a/bench/GrMemoryPoolBench.cpp
+++ b/bench/GrMemoryPoolBench.cpp
@@ -7,9 +7,6 @@
#include "SkTypes.h"
-// This tests a Gr class
-#if SK_SUPPORT_GPU
-
#include "Benchmark.h"
#include "GrMemoryPool.h"
#include "SkRandom.h"
@@ -176,5 +173,3 @@
DEF_BENCH( return new GrMemoryPoolBenchStack(); )
DEF_BENCH( return new GrMemoryPoolBenchRandom(); )
DEF_BENCH( return new GrMemoryPoolBenchQueue(); )
-
-#endif
diff --git a/bench/GrMipMapBench.cpp b/bench/GrMipMapBench.cpp
index e151fe5..e756c13 100644
--- a/bench/GrMipMapBench.cpp
+++ b/bench/GrMipMapBench.cpp
@@ -11,8 +11,6 @@
#include "SkPaint.h"
#include "SkSurface.h"
-#if SK_SUPPORT_GPU
-
class GrMipMapBench: public Benchmark {
sk_sp<SkSurface> fSurface;
SkString fName;
@@ -75,5 +73,3 @@
DEF_BENCH( return new GrMipMapBench(512, 511); )
DEF_BENCH( return new GrMipMapBench(511, 512); )
DEF_BENCH( return new GrMipMapBench(512, 512); )
-
-#endif
diff --git a/bench/GrResourceCacheBench.cpp b/bench/GrResourceCacheBench.cpp
index cc185cf..527e0ff 100644
--- a/bench/GrResourceCacheBench.cpp
+++ b/bench/GrResourceCacheBench.cpp
@@ -7,8 +7,6 @@
#include "Benchmark.h"
-#if SK_SUPPORT_GPU
-
#include "GrContext.h"
#include "GrContextPriv.h"
#include "GrGpu.h"
@@ -184,5 +182,3 @@
DEF_BENCH( return new GrResourceCacheBenchFind(55); )
DEF_BENCH( return new GrResourceCacheBenchFind(56); )
#endif
-
-#endif
diff --git a/bench/ImageCacheBudgetBench.cpp b/bench/ImageCacheBudgetBench.cpp
index a6ee430..d8f6cbb 100644
--- a/bench/ImageCacheBudgetBench.cpp
+++ b/bench/ImageCacheBudgetBench.cpp
@@ -11,8 +11,6 @@
#include "SkImage.h"
#include "SkSurface.h"
-#if SK_SUPPORT_GPU
-
#include "GrContext.h"
#include "GrContextPriv.h"
@@ -259,5 +257,3 @@
DEF_BENCH( return new ImageCacheBudgetDynamicBench(ImageCacheBudgetDynamicBench::Mode::kPingPong); )
DEF_BENCH( return new ImageCacheBudgetDynamicBench(ImageCacheBudgetDynamicBench::Mode::kFlipFlop); )
-
-#endif
diff --git a/bench/MultitextureImageBench.cpp b/bench/MultitextureImageBench.cpp
index 2c87efb..edbb4de 100644
--- a/bench/MultitextureImageBench.cpp
+++ b/bench/MultitextureImageBench.cpp
@@ -6,7 +6,6 @@
*/
#include "Benchmark.h"
-#if SK_SUPPORT_GPU
#include "GrContextOptions.h"
#include "SkCanvas.h"
@@ -135,5 +134,3 @@
DEF_BENCH(return new MultitextureImages(512, 512, false, true));
DEF_BENCH(return new MultitextureImages(128, 32, true, true));
DEF_BENCH(return new MultitextureImages(128, 32, false, true));
-
-#endif
diff --git a/bench/RectanizerBench.cpp b/bench/RectanizerBench.cpp
index b282313..c5ec21d 100644
--- a/bench/RectanizerBench.cpp
+++ b/bench/RectanizerBench.cpp
@@ -10,8 +10,6 @@
#include "SkSize.h"
#include "SkTDArray.h"
-#if SK_SUPPORT_GPU
-
#include "GrRectanizer_pow2.h"
#include "GrRectanizer_skyline.h"
@@ -134,5 +132,3 @@
RectanizerBench::kRandPow2_RectType);)
DEF_BENCH(return new RectanizerBench(RectanizerBench::kSkyline_RectanizerType,
RectanizerBench::kSmallPow2_RectType);)
-
-#endif
diff --git a/bench/SKPBench.cpp b/bench/SKPBench.cpp
index 1391b40..2612021 100644
--- a/bench/SKPBench.cpp
+++ b/bench/SKPBench.cpp
@@ -10,10 +10,8 @@
#include "SkMultiPictureDraw.h"
#include "SkSurface.h"
-#if SK_SUPPORT_GPU
#include "GrContext.h"
#include "GrContextPriv.h"
-#endif
// These CPU tile sizes are not good per se, but they are similar to what Chrome uses.
DEFINE_int32(CPUbenchTileW, 256, "Tile width used for CPU SKP playback.");
@@ -120,12 +118,10 @@
if (0 == --loops) {
break;
}
-#if SK_SUPPORT_GPU
// Ensure the GrContext doesn't combine ops across draw loops.
if (GrContext* context = canvas->getGrContext()) {
context->flush();
}
-#endif
}
}
@@ -158,7 +154,6 @@
}
}
-#if SK_SUPPORT_GPU
#include "GrGpu.h"
static void draw_pic_for_stats(SkCanvas* canvas, GrContext* context, const SkPicture* picture,
SkTArray<SkString>* keys, SkTArray<double>* values,
@@ -176,10 +171,8 @@
(*keys)[i].appendf("_%s", tag);
}
}
-#endif
void SKPBench::getGpuStats(SkCanvas* canvas, SkTArray<SkString>* keys, SkTArray<double>* values) {
-#if SK_SUPPORT_GPU
// we do a special single draw and then dump the key / value pairs
GrContext* context = canvas->getGrContext();
if (!context) {
@@ -195,6 +188,4 @@
// draw second frame
draw_pic_for_stats(canvas, context, fPic.get(), keys, values, "second_frame");
-
-#endif
}
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index 8c89ec7..0376bdb 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -60,23 +60,19 @@
#endif
-#if SK_SUPPORT_GPU
- #include "GrCaps.h"
- #include "GrContextFactory.h"
- #include "GrContextPriv.h"
- #include "SkGr.h"
- #include "gl/GrGLDefines.h"
- #include "gl/GrGLGpu.h"
- #include "gl/GrGLUtil.h"
+#include "GrCaps.h"
+#include "GrContextFactory.h"
+#include "GrContextPriv.h"
+#include "SkGr.h"
+#include "gl/GrGLDefines.h"
+#include "gl/GrGLGpu.h"
+#include "gl/GrGLUtil.h"
- using sk_gpu_test::ContextInfo;
- using sk_gpu_test::GrContextFactory;
- using sk_gpu_test::TestContext;
+using sk_gpu_test::ContextInfo;
+using sk_gpu_test::GrContextFactory;
+using sk_gpu_test::TestContext;
- GrContextOptions grContextOpts;
-#endif
-
- struct GrContextOptions;
+GrContextOptions grContextOpts;
static const int kAutoTuneLoops = 0;
@@ -171,7 +167,6 @@
return true;
}
-#if SK_SUPPORT_GPU
struct GPUTarget : public Target {
explicit GPUTarget(const Config& c) : Target(c) {}
ContextInfo contextInfo;
@@ -243,8 +238,6 @@
}
};
-#endif
-
static double time(int loops, Benchmark* bench, Target* target) {
SkCanvas* canvas = target->getCanvas();
if (canvas) {
@@ -409,17 +402,10 @@
return loops;
}
-#if SK_SUPPORT_GPU
#define kBogusContextType GrContextFactory::kGL_ContextType
#define kBogusContextOverrides GrContextFactory::ContextOverrides::kNone
-#else
-#define kBogusContextType 0
-#define kBogusContextOverrides 0
-#endif
static void create_config(const SkCommandLineConfig* config, SkTArray<Config>* configs) {
-
-#if SK_SUPPORT_GPU
if (const auto* gpuConfig = config->asConfigGpu()) {
if (!FLAGS_gpu) {
SkDebugf("Skipping config '%s' as requested.\n", config->getTag().c_str());
@@ -468,7 +454,6 @@
configs->push_back(target);
return;
}
-#endif
#define CPU_CONFIG(name, backend, color, alpha, colorSpace) \
if (config->getTag().equals(#name)) { \
@@ -544,11 +529,9 @@
Target* target = nullptr;
switch (config.backend) {
-#if SK_SUPPORT_GPU
case Benchmark::kGPU_Backend:
target = new GPUTarget(config);
break;
-#endif
default:
target = new Target(config);
break;
@@ -1141,9 +1124,7 @@
SkAutoGraphics ag;
SkTaskGroup::Enabler enabled(FLAGS_threads);
-#if SK_SUPPORT_GPU
SetCtxOptionsFromCommonFlags(&grContextOpts);
-#endif
if (FLAGS_veryVerbose) {
FLAGS_verbose = true;
@@ -1295,7 +1276,6 @@
}
}
-#if SK_SUPPORT_GPU
SkTArray<SkString> keys;
SkTArray<double> values;
bool gpuStatsDump = FLAGS_gpuStatsDump && Benchmark::kGPU_Backend == configs[i].backend;
@@ -1303,7 +1283,6 @@
// TODO cache stats
bench->getGpuStats(canvas, &keys, &values);
}
-#endif
bench->perCanvasPostDraw(canvas);
@@ -1322,7 +1301,6 @@
target->fillOptions(log.get());
log->metric("min_ms", stats.min);
log->metrics("samples", samples);
-#if SK_SUPPORT_GPU
if (gpuStatsDump) {
// dump to json, only SKPBench currently returns valid keys / values
SkASSERT(keys.count() == values.count());
@@ -1330,7 +1308,6 @@
log->metric(keys[i].c_str(), values[i]);
}
}
-#endif
if (runs++ % FLAGS_flushEvery == 0) {
log->flush();
@@ -1382,11 +1359,9 @@
);
}
-#if SK_SUPPORT_GPU
if (FLAGS_gpuStats && Benchmark::kGPU_Backend == configs[i].backend) {
target->dumpStats();
}
-#endif
if (FLAGS_verbose) {
SkDebugf("Samples: ");
diff --git a/bench/nanobench.h b/bench/nanobench.h
index 45882cc..5b95d59 100644
--- a/bench/nanobench.h
+++ b/bench/nanobench.h
@@ -9,14 +9,11 @@
#define nanobench_DEFINED
#include "Benchmark.h"
+#include "GrContextFactory.h"
#include "SkImageInfo.h"
#include "SkSurface.h"
#include "SkTypes.h"
-#if SK_SUPPORT_GPU
-#include "GrContextFactory.h"
-#endif
-
class ResultsWriter;
class SkBitmap;
class SkCanvas;
@@ -28,15 +25,9 @@
SkAlphaType alpha;
sk_sp<SkColorSpace> colorSpace;
int samples;
-#if SK_SUPPORT_GPU
sk_gpu_test::GrContextFactory::ContextType ctxType;
sk_gpu_test::GrContextFactory::ContextOverrides ctxOverrides;
bool useDFText;
-#else
- int bogusInt;
- int bogusIntOption;
- bool bogusBool;
-#endif
};
struct Target {
diff --git a/dm/DM.cpp b/dm/DM.cpp
index 3551a8c..69c2504 100644
--- a/dm/DM.cpp
+++ b/dm/DM.cpp
@@ -857,17 +857,8 @@
ts.tag = config.getTag();
}
-static bool gpu_supported() {
-#if SK_SUPPORT_GPU
- return FLAGS_gpu;
-#else
- return false;
-#endif
-}
-
static Sink* create_sink(const GrContextOptions& grCtxOptions, const SkCommandLineConfig* config) {
-#if SK_SUPPORT_GPU
- if (gpu_supported()) {
+ if (FLAGS_gpu) {
if (const SkCommandLineConfigGpu* gpuConfig = config->asConfigGpu()) {
GrContextFactory::ContextType contextType = gpuConfig->getContextType();
GrContextFactory::ContextOverrides contextOverrides = gpuConfig->getContextOverrides();
@@ -892,7 +883,6 @@
}
}
}
-#endif
if (const SkCommandLineConfigSvg* svgConfig = config->asConfigSvg()) {
int pageIndex = svgConfig->getPageIndex();
return new SVGSink(pageIndex);
@@ -1273,7 +1263,7 @@
if (SkCommandLineFlags::ShouldSkip(FLAGS_match, test.name)) {
continue;
}
- if (test.needsGpu && gpu_supported()) {
+ if (test.needsGpu && FLAGS_gpu) {
(FLAGS_gpu_threading ? gParallelTests : gSerialTests).push(test);
} else if (!test.needsGpu && FLAGS_cpu) {
gParallelTests.push(test);
@@ -1366,9 +1356,7 @@
}
GrContextOptions grCtxOptions;
-#if SK_SUPPORT_GPU
SetCtxOptionsFromCommonFlags(&grCtxOptions);
-#endif
JsonWriter::DumpJson(); // It's handy for the bots to assume this is ~never missing.
SkAutoGraphics ag;
diff --git a/dm/DMGpuSupport.h b/dm/DMGpuSupport.h
deleted file mode 100644
index 1ed0095..0000000
--- a/dm/DMGpuSupport.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright 2014 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef DMGpuSupport_DEFINED
-#define DMGpuSupport_DEFINED
-
-// Provides Ganesh to DM,
-// or if it's not available, fakes it enough so most code doesn't have to know that.
-
-#include "SkSurface.h"
-
-// This should be safe to include even in no-gpu builds. Include by relative path so it
-// can be found in non-gpu builds.
-#include "../include/gpu/GrContextOptions.h"
-
-#if SK_SUPPORT_GPU
-
-// Ganesh is available. Yippee!
-
-# include "GrContext.h"
-# include "GrContextFactory.h"
-
-namespace DM {
-
-static const bool kGPUDisabled = false;
-
-} // namespace DM
-
-#else// !SK_SUPPORT_GPU
-
-// Ganesh is not available. Fake it.
-
-enum GrGLStandard {
- kNone_GrGLStandard,
- kGL_GrGLStandard,
- kGLES_GrGLStandard
-};
-static const int kGrGLStandardCnt = 3;
-
-class GrContext {
-public:
- void dumpCacheStats(SkString*) const {}
- void dumpGpuStats(SkString*) const {}
-};
-
-class SkCommandLineConfigGpu {
-public:
- enum class SurfType;
-};
-
-namespace sk_gpu_test {
-class GrContextFactory {
-public:
- GrContextFactory() {}
- explicit GrContextFactory(const GrContextOptions&) {}
-
- typedef int ContextType;
-
- static const ContextType kANGLE_ContextType = 0,
- kANGLE_GL_ContextType = 0,
- kCommandBuffer_ContextType = 0,
- kDebugGL_ContextType = 0,
- kNVPR_ContextType = 0,
- kNativeGL_ContextType = 0,
- kGL_ContextType = 0,
- kGLES_ContextType = 0,
- kNullGL_ContextType = 0,
- kVulkan_ContextType = 0,
- kMetal_ContextType = 0;
- static const int kContextTypeCnt = 1;
- enum class ContextOverrides {};
- void destroyContexts() {}
-
- void abandonContexts() {}
-
- void releaseResourcesAndAbandonContexts() {}
-};
-} // namespace sk_gpu_test
-
-namespace DM {
-
-static const bool kGPUDisabled = true;
-
-} // namespace DM
-
-#endif//SK_SUPPORT_GPU
-
-#endif//DMGpuSupport_DEFINED
diff --git a/dm/DMGpuTestProcs.cpp b/dm/DMGpuTestProcs.cpp
index ef55c0a..abae628 100644
--- a/dm/DMGpuTestProcs.cpp
+++ b/dm/DMGpuTestProcs.cpp
@@ -11,11 +11,8 @@
using sk_gpu_test::GLTestContext;
using sk_gpu_test::ContextInfo;
-// TODO: currently many GPU tests are declared outside SK_SUPPORT_GPU guards.
-// Thus we export the empty RunWithGPUTestContexts when SK_SUPPORT_GPU=0.
namespace skiatest {
-#if SK_SUPPORT_GPU
bool IsGLContextType(sk_gpu_test::GrContextFactory::ContextType type) {
return kOpenGL_GrBackend == GrContextFactory::ContextTypeBackend(type);
}
@@ -28,17 +25,9 @@
bool IsNullGLContextType(sk_gpu_test::GrContextFactory::ContextType type) {
return type == GrContextFactory::kNullGL_ContextType;
}
-#else
-bool IsGLContextType(int) { return false; }
-bool IsVulkanContextType(int) { return false; }
-bool IsRenderingGLContextType(int) { return false; }
-bool IsNullGLContextType(int) { return false; }
-#endif
void RunWithGPUTestContexts(GrContextTestFn* test, GrContextTypeFilterFn* contextTypeFilter,
Reporter* reporter, const GrContextOptions& options) {
-#if SK_SUPPORT_GPU
-
#if defined(SK_BUILD_FOR_UNIX) || defined(SK_BUILD_FOR_WIN) || defined(SK_BUILD_FOR_MAC)
static constexpr auto kNativeGLType = GrContextFactory::kGL_ContextType;
#else
@@ -78,6 +67,5 @@
ctxInfo.grContext()->flush();
}
}
-#endif
}
} // namespace skiatest
diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp
index e111ecc..5b93de3 100644
--- a/dm/DMSrcSink.cpp
+++ b/dm/DMSrcSink.cpp
@@ -75,11 +75,9 @@
#include "../third_party/skcms/skcms.h"
-#if SK_SUPPORT_GPU
#include "GrBackendSurface.h"
#include "GrContextPriv.h"
#include "GrGpu.h"
-#endif
DEFINE_bool(multiPage, false, "For document-type backends, render the source"
" into multiple pages");
@@ -1500,7 +1498,6 @@
SkImageInfo info =
SkImageInfo::Make(size.width(), size.height(), fColorType, fAlphaType, fColorSpace);
sk_sp<SkSurface> surface;
-#if SK_SUPPORT_GPU
GrContext* context = factory.getContextInfo(fContextType, fContextOverrides).grContext();
const int maxDimension = context->contextPriv().caps()->maxTextureSize();
if (maxDimension < SkTMax(size.width(), size.height())) {
@@ -1537,7 +1534,6 @@
}
break;
}
-#endif
if (!surface) {
return "Could not create a surface.";
@@ -1552,10 +1548,8 @@
}
canvas->flush();
if (FLAGS_gpuStats) {
-#if SK_SUPPORT_GPU
canvas->getGrContext()->contextPriv().dumpCacheStats(log);
canvas->getGrContext()->contextPriv().dumpGpuStats(log);
-#endif
}
if (info.colorType() == kRGB_565_SkColorType || info.colorType() == kARGB_4444_SkColorType ||
info.colorType() == kRGB_888x_SkColorType) {
@@ -1571,7 +1565,6 @@
} else if (FLAGS_releaseAndAbandonGpuContext) {
factory.releaseResourcesAndAbandonContexts();
}
-#if SK_SUPPORT_GPU
if (!context->contextPriv().abandoned()) {
surface.reset();
if (backendTexture.isValid()) {
@@ -1581,7 +1574,6 @@
context->contextPriv().getGpu()->deleteTestingOnlyBackendRenderTarget(backendRT);
}
}
-#endif
return "";
}
@@ -1599,11 +1591,7 @@
const GrContextOptions& grCtxOptions)
: INHERITED(ct, overrides, surfType, samples, diText, colorType, alphaType,
std::move(colorSpace), threaded, grCtxOptions)
-#if SK_SUPPORT_GPU
, fExecutor(SkExecutor::MakeFIFOThreadPool(FLAGS_gpuThreads)) {
-#else
- , fExecutor(nullptr) {
-#endif
SkASSERT(fExecutor);
}
@@ -1613,10 +1601,8 @@
// Also, force us to only use the software path renderer, so we really stress-test the threaded
// version of that code.
GrContextOptions contextOptions = this->baseContextOptions();
-#if SK_SUPPORT_GPU
contextOptions.fGpuPathRenderers = GpuPathRenderers::kNone;
contextOptions.fExecutor = fExecutor.get();
-#endif
Error err = this->onDraw(src, dst, wStream, log, contextOptions);
if (!err.isEmpty() || !dst) {
@@ -1626,9 +1612,7 @@
SkBitmap reference;
SkString refLog;
SkDynamicMemoryWStream refStream;
-#if SK_SUPPORT_GPU
contextOptions.fExecutor = nullptr;
-#endif
Error refErr = this->onDraw(src, &reference, &refStream, &refLog, contextOptions);
if (!refErr.isEmpty()) {
return refErr;
@@ -2008,8 +1992,6 @@
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
-#if SK_SUPPORT_GPU
-
ViaDDL::ViaDDL(int numDivisions, Sink* sink)
: Via(sink)
, fNumDivisions(numDivisions) {
@@ -2071,16 +2053,6 @@
});
}
-#else
-
-ViaDDL::ViaDDL(int numDivisions, Sink* sink) : Via(sink) { }
-
-Error ViaDDL::draw(const Src& src, SkBitmap* bitmap, SkWStream* stream, SkString* log) const {
- return "ViaDDL is GPU only";
-}
-
-#endif
-
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
Error ViaPicture::draw(const Src& src, SkBitmap* bitmap, SkWStream* stream, SkString* log) const {
diff --git a/dm/DMSrcSink.h b/dm/DMSrcSink.h
index 9820404..9c31c0a 100644
--- a/dm/DMSrcSink.h
+++ b/dm/DMSrcSink.h
@@ -8,7 +8,6 @@
#ifndef DMSrcSink_DEFINED
#define DMSrcSink_DEFINED
-#include "DMGpuSupport.h"
#include "SkBBHFactory.h"
#include "SkBBoxHierarchy.h"
#include "SkBitmap.h"
@@ -528,9 +527,7 @@
ViaDDL(int numDivisions, Sink* sink);
Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override;
private:
-#if SK_SUPPORT_GPU
const int fNumDivisions;
-#endif
};
class ViaSVG : public Via {
diff --git a/gm/beziereffects.cpp b/gm/beziereffects.cpp
index 51e8415..ab9a5fd 100644
--- a/gm/beziereffects.cpp
+++ b/gm/beziereffects.cpp
@@ -10,8 +10,6 @@
#include "gm.h"
#include "sk_tool_utils.h"
-#if SK_SUPPORT_GPU
-
#include "GrContext.h"
#include "GrOpFlushState.h"
#include "GrPathUtils.h"
@@ -638,5 +636,3 @@
DEF_GM(return new BezierConicEffects;)
DEF_GM(return new BezierQuadEffects;)
}
-
-#endif
diff --git a/gm/bigrrectaaeffect.cpp b/gm/bigrrectaaeffect.cpp
index 6f75344..dee19c5 100644
--- a/gm/bigrrectaaeffect.cpp
+++ b/gm/bigrrectaaeffect.cpp
@@ -7,7 +7,6 @@
#include "gm.h"
#include "sk_tool_utils.h"
-#if SK_SUPPORT_GPU
#include "GrCaps.h"
#include "GrContext.h"
#include "GrRenderTargetContextPriv.h"
@@ -129,4 +128,3 @@
DEF_GM( return new BigRRectAAEffectGM (SkRRect::MakeRectXY(SkRect::MakeIWH(kSize - 1, kSize - 10), kSize/2.f - 10.f, kSize/2.f - 15.f), "elliptical_corner"); )
}
-#endif
diff --git a/gm/bitmapshader.cpp b/gm/bitmapshader.cpp
index 3f3c51e..2671b5a 100644
--- a/gm/bitmapshader.cpp
+++ b/gm/bitmapshader.cpp
@@ -11,11 +11,9 @@
#include "SkShader.h"
#include "sk_tool_utils.h"
-#if SK_SUPPORT_GPU
#include "GrCaps.h"
#include "GrContext.h"
#include "GrContextPriv.h"
-#endif
namespace skiagm {
@@ -121,11 +119,9 @@
// (See https://skia-review.googlesource.com/c/skia/+/73200)
int bitmapW = 1;
int bitmapH = 60000;
-#if SK_SUPPORT_GPU
if (auto* ctx = canvas->getGrContext()) {
bitmapH = ctx->contextPriv().caps()->maxTextureSize() + 1;
}
-#endif
bitmap.setInfo(SkImageInfo::MakeA8(bitmapW, bitmapH), bitmapW);
uint8_t* pixels = new uint8_t[bitmapH];
for(int i = 0; i < bitmapH; ++i) {
diff --git a/gm/bitmaptiled.cpp b/gm/bitmaptiled.cpp
index a8ac05a..2046936 100644
--- a/gm/bitmaptiled.cpp
+++ b/gm/bitmaptiled.cpp
@@ -7,7 +7,6 @@
#include "gm.h"
-#if SK_SUPPORT_GPU
#include "GrContext.h"
// This test exercises Ganesh's drawing of tiled bitmaps. In particular, that the offsets and the
@@ -71,5 +70,3 @@
DEF_SIMPLE_GM_BG(bitmaptiled_fractional_vertical, canvas, 365, 1124, SK_ColorBLACK) {
draw_tile_bitmap_with_fractional_offset(canvas, true);
}
-
-#endif
diff --git a/gm/bleed.cpp b/gm/bleed.cpp
index 85d3328..6dc0ebb 100644
--- a/gm/bleed.cpp
+++ b/gm/bleed.cpp
@@ -15,11 +15,9 @@
#include "SkUtils.h"
#include "sk_tool_utils.h"
-#if SK_SUPPORT_GPU
#include "GrContext.h"
#include "GrContextOptions.h"
#include "SkGr.h"
-#endif
/** Holds either a bitmap or image to be rendered and a rect that indicates what part of the bitmap
or image should be tested by the GM. The area outside of the rect is present to check
@@ -402,11 +400,9 @@
}
}
-#if SK_SUPPORT_GPU
void modifyGrContextOptions(GrContextOptions* options) override {
options->fMaxTileSizeOverride = kMaxTileSize;
}
-#endif
private:
static constexpr int kBlockSize = 70;
diff --git a/gm/constcolorprocessor.cpp b/gm/constcolorprocessor.cpp
index 2e85714..26da988 100644
--- a/gm/constcolorprocessor.cpp
+++ b/gm/constcolorprocessor.cpp
@@ -10,8 +10,6 @@
#include "gm.h"
#include "sk_tool_utils.h"
-#if SK_SUPPORT_GPU
-
#include "GrContext.h"
#include "GrRenderTargetContextPriv.h"
#include "SkGr.h"
@@ -184,5 +182,3 @@
DEF_GM(return new ConstColorProcessor;)
}
-
-#endif
diff --git a/gm/convexpolyeffect.cpp b/gm/convexpolyeffect.cpp
index 8942602..fa48e7b 100644
--- a/gm/convexpolyeffect.cpp
+++ b/gm/convexpolyeffect.cpp
@@ -9,8 +9,6 @@
#include "gm.h"
-#if SK_SUPPORT_GPU
-
#include "GrContext.h"
#include "GrDefaultGeoProcFactory.h"
#include "GrOpFlushState.h"
@@ -278,5 +276,3 @@
DEF_GM(return new ConvexPolyEffect;)
}
-
-#endif
diff --git a/gm/crosscontextimage.cpp b/gm/crosscontextimage.cpp
index 19760c4..12ef679 100644
--- a/gm/crosscontextimage.cpp
+++ b/gm/crosscontextimage.cpp
@@ -8,7 +8,6 @@
#include "gm.h"
#include "Resources.h"
-#if SK_SUPPORT_GPU
#include "GrContext.h"
#include "SkImage.h"
@@ -46,5 +45,3 @@
canvas->drawImage(crossContextSubset, 512 + 30, 512 + 30);
canvas->drawImage(crossContextRasterSubset, 512 + 512 + 60, 512 + 30);
}
-
-#endif
diff --git a/gm/dftext.cpp b/gm/dftext.cpp
index 34c1f9a..b420567 100644
--- a/gm/dftext.cpp
+++ b/gm/dftext.cpp
@@ -39,7 +39,6 @@
SkScalar scales[] = { 2.0f*5.0f, 5.0f, 2.0f, 1.0f };
// set up offscreen rendering with distance field text
-#if SK_SUPPORT_GPU
GrContext* ctx = inputCanvas->getGrContext();
SkISize size = onISize();
SkImageInfo info = SkImageInfo::MakeN32(size.width(), size.height(), kPremul_SkAlphaType,
@@ -50,9 +49,6 @@
SkCanvas* canvas = surface ? surface->getCanvas() : inputCanvas;
// init our new canvas with the old canvas's matrix
canvas->setMatrix(inputCanvas->getTotalMatrix());
-#else
- SkCanvas* canvas = inputCanvas;
-#endif
// apply global scale to test glyph positioning
canvas->scale(1.05f, 1.05f);
canvas->clear(0xffffffff);
@@ -189,7 +185,6 @@
paint.setTextSize(SkIntToScalar(19));
canvas->drawString(fEmojiText, 670, 90, paint);
}
-#if SK_SUPPORT_GPU
// render offscreen buffer
if (surface) {
SkAutoCanvasRestore acr(inputCanvas, true);
@@ -197,7 +192,6 @@
inputCanvas->resetMatrix();
inputCanvas->drawImage(surface->makeImageSnapshot().get(), 0, 0, nullptr);
}
-#endif
}
private:
diff --git a/gm/dftext_blob_persp.cpp b/gm/dftext_blob_persp.cpp
index cfa681d..e9df4af 100644
--- a/gm/dftext_blob_persp.cpp
+++ b/gm/dftext_blob_persp.cpp
@@ -46,7 +46,6 @@
virtual void onDraw(SkCanvas* inputCanvas) override {
// set up offscreen rendering with distance field text
-#if SK_SUPPORT_GPU
GrContext* ctx = inputCanvas->getGrContext();
SkISize size = this->onISize();
if (!inputCanvas->getBaseLayerSize().isEmpty()) {
@@ -60,9 +59,6 @@
SkCanvas* canvas = surface ? surface->getCanvas() : inputCanvas;
// init our new canvas with the old canvas's matrix
canvas->setMatrix(inputCanvas->getTotalMatrix());
-#else
- SkCanvas* canvas = inputCanvas;
-#endif
SkScalar x = 0, y = 0;
SkScalar maxH = 0;
for (auto twm : {TranslateWithMatrix::kNo, TranslateWithMatrix::kYes}) {
@@ -88,7 +84,6 @@
maxH = 0;
}
}
-#if SK_SUPPORT_GPU
// render offscreen buffer
if (surface) {
SkAutoCanvasRestore acr(inputCanvas, true);
@@ -96,7 +91,6 @@
inputCanvas->resetMatrix();
inputCanvas->drawImage(surface->makeImageSnapshot().get(), 0, 0, nullptr);
}
-#endif
}
private:
diff --git a/gm/discard.cpp b/gm/discard.cpp
index 8db3a68..7a1e9d9 100644
--- a/gm/discard.cpp
+++ b/gm/discard.cpp
@@ -12,8 +12,6 @@
#include "SkRandom.h"
#include "SkSurface.h"
-#if SK_SUPPORT_GPU
-
namespace skiagm {
/*
@@ -87,5 +85,3 @@
DEF_GM(return new DiscardGM;)
} // end namespace
-
-#endif
diff --git a/gm/flippity.cpp b/gm/flippity.cpp
index fb0288b..853606e 100644
--- a/gm/flippity.cpp
+++ b/gm/flippity.cpp
@@ -10,8 +10,6 @@
#include "SkSurface.h"
-#if SK_SUPPORT_GPU
-
#include "GrContextPriv.h"
#include "ProxyUtils.h"
#include "SkImage_Gpu.h"
@@ -271,5 +269,3 @@
};
DEF_GM(return new FlippityGM;)
-
-#endif
diff --git a/gm/fontcache.cpp b/gm/fontcache.cpp
index 6c99700..c9c8cf7 100644
--- a/gm/fontcache.cpp
+++ b/gm/fontcache.cpp
@@ -10,8 +10,6 @@
#include "gm.h"
-#if SK_SUPPORT_GPU
-
#include "GrContext.h"
#include "GrContextPriv.h"
#include "GrContextOptions.h"
@@ -142,5 +140,3 @@
DEF_GM(return new FontCacheGM(GrContextOptions::Enable::kNo))
DEF_GM(return new FontCacheGM(GrContextOptions::Enable::kYes))
-
-#endif
diff --git a/gm/image.cpp b/gm/image.cpp
index 2c1b8d8..2592131 100644
--- a/gm/image.cpp
+++ b/gm/image.cpp
@@ -16,9 +16,7 @@
#include "SkStream.h"
#include "SkSurface.h"
-#if SK_SUPPORT_GPU
#include "GrContext.h"
-#endif
static void drawContents(SkSurface* surface, SkColor fillC) {
SkSize size = SkSize::Make(SkIntToScalar(surface->width()),
@@ -152,11 +150,8 @@
SkImageInfo info = SkImageInfo::MakeN32Premul(W, H);
sk_sp<SkSurface> surf0(SkSurface::MakeRasterDirect(info, fBuffer, RB));
sk_sp<SkSurface> surf1(SkSurface::MakeRaster(info));
- sk_sp<SkSurface> surf2; // gpu
-
-#if SK_SUPPORT_GPU
- surf2 = SkSurface::MakeRenderTarget(canvas->getGrContext(), SkBudgeted::kNo, info);
-#endif
+ sk_sp<SkSurface> surf2(SkSurface::MakeRenderTarget(canvas->getGrContext(),
+ SkBudgeted::kNo, info));
test_surface(canvas, surf0.get(), true);
canvas->translate(80, 0);
diff --git a/gm/image_pict.cpp b/gm/image_pict.cpp
index 11bb902..eee4583 100644
--- a/gm/image_pict.cpp
+++ b/gm/image_pict.cpp
@@ -14,13 +14,11 @@
#include "SkPictureRecorder.h"
#include "SkSurface.h"
-#if SK_SUPPORT_GPU
#include "GrContext.h"
#include "GrContextPriv.h"
#include "GrSurfaceContext.h"
#include "GrTextureProxy.h"
#include "../src/image/SkImage_Gpu.h"
-#endif
static void draw_something(SkCanvas* canvas, const SkRect& bounds) {
SkPaint paint;
@@ -145,7 +143,6 @@
EmptyGenerator(const SkImageInfo& info) : SkImageGenerator(info) {}
};
-#if SK_SUPPORT_GPU
class TextureGenerator : public SkImageGenerator {
public:
TextureGenerator(GrContext* ctx, const SkImageInfo& info, sk_sp<SkPicture> pic)
@@ -216,7 +213,6 @@
}
return skstd::make_unique<TextureGenerator>(ctx, info, pic);
}
-#endif
class ImageCacheratorGM : public skiagm::GM {
SkString fName;
@@ -269,7 +265,6 @@
}
static void draw_as_tex(SkCanvas* canvas, SkImage* image, SkScalar x, SkScalar y) {
-#if SK_SUPPORT_GPU
sk_sp<SkColorSpace> texColorSpace;
sk_sp<GrTextureProxy> proxy(as_IB(image)->asTextureProxyRef(
canvas->getGrContext(), GrSamplerState::ClampBilerp(),
@@ -291,7 +286,6 @@
sk_ref_sp(canvas->getGrContext()), image->uniqueID(), kPremul_SkAlphaType,
std::move(proxy), std::move(texColorSpace), SkBudgeted::kNo));
canvas->drawImage(texImage.get(), x, y);
-#endif
}
void drawSet(SkCanvas* canvas) const {
@@ -333,6 +327,4 @@
};
DEF_GM( return new ImageCacheratorGM("picture", make_pic_generator); )
DEF_GM( return new ImageCacheratorGM("raster", make_ras_generator); )
-#if SK_SUPPORT_GPU
- DEF_GM( return new ImageCacheratorGM("texture", make_tex_generator); )
-#endif
+DEF_GM( return new ImageCacheratorGM("texture", make_tex_generator); )
diff --git a/gm/imagefromyuvtextures.cpp b/gm/imagefromyuvtextures.cpp
index a6aa000..8a26a00 100644
--- a/gm/imagefromyuvtextures.cpp
+++ b/gm/imagefromyuvtextures.cpp
@@ -9,8 +9,6 @@
#include "gm.h"
-#if SK_SUPPORT_GPU
-
#include "GrContext.h"
#include "GrContextPriv.h"
#include "GrGpu.h"
@@ -169,5 +167,3 @@
DEF_GM(return new ImageFromYUVTextures;)
}
-
-#endif
diff --git a/gm/imagemasksubset.cpp b/gm/imagemasksubset.cpp
index 9974af3..adfea6b 100644
--- a/gm/imagemasksubset.cpp
+++ b/gm/imagemasksubset.cpp
@@ -53,9 +53,7 @@
// SkImage_Gpu
[](SkCanvas* c, const SkImageInfo& info) -> sk_sp<SkImage> {
sk_sp<SkSurface> surface;
-#if SK_SUPPORT_GPU
surface = SkSurface::MakeRenderTarget(c->getGrContext(), SkBudgeted::kNo, info);
-#endif
return make_mask(surface ? surface : SkSurface::MakeRaster(info));
},
diff --git a/gm/pathmaskcache.cpp b/gm/pathmaskcache.cpp
index 400c5df..0952033 100644
--- a/gm/pathmaskcache.cpp
+++ b/gm/pathmaskcache.cpp
@@ -7,8 +7,6 @@
#include "gm.h"
-#if SK_SUPPORT_GPU
-
#include "GrContext.h"
#include "GrContextOptions.h"
#include "SkPath.h"
@@ -113,5 +111,3 @@
};
DEF_GM( return new PathMaskCache(); )
-
-#endif
diff --git a/gm/rectangletexture.cpp b/gm/rectangletexture.cpp
index 1ce915b..a603be7 100644
--- a/gm/rectangletexture.cpp
+++ b/gm/rectangletexture.cpp
@@ -9,8 +9,6 @@
#include "gm.h"
-#if SK_SUPPORT_GPU
-
#include "GrBackendSurface.h"
#include "GrContext.h"
#include "GrContextPriv.h"
@@ -188,5 +186,3 @@
DEF_GM(return new RectangleTexture;)
}
-
-#endif
diff --git a/gm/rrects.cpp b/gm/rrects.cpp
index d6b5291..ff704c8 100644
--- a/gm/rrects.cpp
+++ b/gm/rrects.cpp
@@ -7,14 +7,12 @@
#include "gm.h"
#include "sk_tool_utils.h"
-#if SK_SUPPORT_GPU
#include "GrCaps.h"
#include "GrContext.h"
#include "GrRenderTargetContextPriv.h"
#include "effects/GrRRectEffect.h"
#include "ops/GrDrawOp.h"
#include "ops/GrRectOpFactory.h"
-#endif
#include "SkRRect.h"
namespace skiagm {
@@ -83,11 +81,7 @@
SkIntToScalar(kImageHeight));
#endif
-#if SK_SUPPORT_GPU
int lastEdgeType = (kEffect_Type == fType) ? (int) GrClipEdgeType::kLast: 0;
-#else
- int lastEdgeType = 0;
-#endif
int y = 1;
for (int et = 0; et <= lastEdgeType; ++et) {
@@ -103,7 +97,6 @@
canvas->save();
canvas->translate(SkIntToScalar(x), SkIntToScalar(y));
if (kEffect_Type == fType) {
-#if SK_SUPPORT_GPU
SkRRect rrect = fRRects[curRRect];
rrect.offset(SkIntToScalar(x), SkIntToScalar(y));
GrClipEdgeType edgeType = (GrClipEdgeType) et;
@@ -125,7 +118,6 @@
} else {
drew = false;
}
-#endif
} else if (kBW_Clip_Type == fType || kAA_Clip_Type == fType) {
bool aaClip = (kAA_Clip_Type == fType);
canvas->clipRRect(fRRects[curRRect], aaClip);
@@ -257,8 +249,6 @@
DEF_GM( return new RRectGM(RRectGM::kBW_Draw_Type); )
DEF_GM( return new RRectGM(RRectGM::kAA_Clip_Type); )
DEF_GM( return new RRectGM(RRectGM::kBW_Clip_Type); )
-#if SK_SUPPORT_GPU
DEF_GM( return new RRectGM(RRectGM::kEffect_Type); )
-#endif
}
diff --git a/gm/srcmode.cpp b/gm/srcmode.cpp
index e43933c..21cf979 100644
--- a/gm/srcmode.cpp
+++ b/gm/srcmode.cpp
@@ -116,11 +116,9 @@
SkImageInfo info = SkImageInfo::MakeN32Premul(size);
bool callNewSurface = true;
-#if SK_SUPPORT_GPU
if (canvas->getGrContext() && skipGPU) {
callNewSurface = false;
}
-#endif
sk_sp<SkSurface> surface = callNewSurface ? canvas->makeSurface(info) : nullptr;
if (nullptr == surface) {
// picture canvas will return null, so fall-back to raster
diff --git a/gm/textblobmixedsizes.cpp b/gm/textblobmixedsizes.cpp
index 7ada13a..fcb1a59 100644
--- a/gm/textblobmixedsizes.cpp
+++ b/gm/textblobmixedsizes.cpp
@@ -98,7 +98,6 @@
SkCanvas* canvas = inputCanvas;
sk_sp<SkSurface> surface;
if (fUseDFT) {
-#if SK_SUPPORT_GPU
// Create a new Canvas to enable DFT
GrContext* ctx = inputCanvas->getGrContext();
SkISize size = onISize();
@@ -111,7 +110,6 @@
canvas = surface.get() ? surface->getCanvas() : inputCanvas;
// init our new canvas with the old canvas's matrix
canvas->setMatrix(inputCanvas->getTotalMatrix());
-#endif
}
canvas->drawColor(sk_tool_utils::color_to_565(SK_ColorWHITE));
@@ -164,7 +162,6 @@
}
canvas->restore();
-#if SK_SUPPORT_GPU
// render offscreen buffer
if (surface) {
SkAutoCanvasRestore acr(inputCanvas, true);
@@ -172,7 +169,6 @@
inputCanvas->resetMatrix();
inputCanvas->drawImage(surface->makeImageSnapshot().get(), 0, 0, nullptr);
}
-#endif
}
private:
@@ -189,7 +185,5 @@
//////////////////////////////////////////////////////////////////////////////
DEF_GM( return new TextBlobMixedSizes(false); )
-#if SK_SUPPORT_GPU
DEF_GM( return new TextBlobMixedSizes(true); )
-#endif
}
diff --git a/gm/textblobrandomfont.cpp b/gm/textblobrandomfont.cpp
index acde468..87dabf6 100644
--- a/gm/textblobrandomfont.cpp
+++ b/gm/textblobrandomfont.cpp
@@ -17,8 +17,6 @@
#include "SkTextBlob.h"
#include "SkTypeface.h"
-#if SK_SUPPORT_GPU
-
#include "GrContext.h"
namespace skiagm {
@@ -168,4 +166,3 @@
DEF_GM(return new TextBlobRandomFont;)
}
-#endif
diff --git a/gm/textblobuseaftergpufree.cpp b/gm/textblobuseaftergpufree.cpp
index b892c7f..f09eb1f 100644
--- a/gm/textblobuseaftergpufree.cpp
+++ b/gm/textblobuseaftergpufree.cpp
@@ -8,8 +8,6 @@
#include "gm.h"
#include "sk_tool_utils.h"
-#if SK_SUPPORT_GPU
-
#include "SkCanvas.h"
#include "SkSurface.h"
#include "SkTextBlob.h"
@@ -73,4 +71,3 @@
DEF_GM(return new TextBlobUseAfterGpuFree;)
}
-#endif
diff --git a/gm/texturedomaineffect.cpp b/gm/texturedomaineffect.cpp
index e5e2627..e314668 100644
--- a/gm/texturedomaineffect.cpp
+++ b/gm/texturedomaineffect.cpp
@@ -9,8 +9,6 @@
#include "gm.h"
-#if SK_SUPPORT_GPU
-
#include "GrContext.h"
#include "GrContextPriv.h"
#include "GrProxyProvider.h"
@@ -155,5 +153,3 @@
DEF_GM(return new TextureDomainEffect;)
}
-
-#endif
diff --git a/gm/windowrectangles.cpp b/gm/windowrectangles.cpp
index d03cf6d..9e1b64e 100644
--- a/gm/windowrectangles.cpp
+++ b/gm/windowrectangles.cpp
@@ -10,7 +10,6 @@
#include "SkClipStack.h"
#include "SkRRect.h"
-#if SK_SUPPORT_GPU
#include "GrAppliedClip.h"
#include "GrCaps.h"
#include "GrContextPriv.h"
@@ -20,7 +19,6 @@
#include "GrResourceProvider.h"
#include "GrStencilClip.h"
#include "effects/GrTextureDomain.h"
-#endif
constexpr static SkIRect kDeviceRect = {0, 0, 600, 600};
constexpr static SkIRect kCoverRect = {50, 50, 550, 550};
@@ -104,8 +102,6 @@
////////////////////////////////////////////////////////////////////////////////////////////////////
-#if SK_SUPPORT_GPU
-
constexpr static int kNumWindows = 8;
/**
@@ -286,6 +282,4 @@
DEF_GM( return new WindowRectanglesMaskGM(); )
-#endif
-
}
diff --git a/gm/xfermodes3.cpp b/gm/xfermodes3.cpp
index e1b1c76..0d13148 100644
--- a/gm/xfermodes3.cpp
+++ b/gm/xfermodes3.cpp
@@ -13,9 +13,7 @@
#include "SkBlendModePriv.h"
#include "SkColorPriv.h"
-#if SK_SUPPORT_GPU
#include "GrContext.h"
-#endif
namespace skiagm {
diff --git a/gm/yuvtorgbeffect.cpp b/gm/yuvtorgbeffect.cpp
index 0c69ec0..5efbc3a 100644
--- a/gm/yuvtorgbeffect.cpp
+++ b/gm/yuvtorgbeffect.cpp
@@ -9,8 +9,6 @@
#include "gm.h"
-#if SK_SUPPORT_GPU
-
#include "GrContext.h"
#include "GrContextPriv.h"
#include "GrProxyProvider.h"
@@ -264,5 +262,3 @@
DEF_GM(return new YUVNV12toRGBEffect;)
}
-
-#endif
diff --git a/tests/ApplyGammaTest.cpp b/tests/ApplyGammaTest.cpp
index d210e9e..4662de5 100644
--- a/tests/ApplyGammaTest.cpp
+++ b/tests/ApplyGammaTest.cpp
@@ -7,8 +7,6 @@
#include "SkTypes.h"
-#if SK_SUPPORT_GPU
-
#include "GrCaps.h"
#include "GrContext.h"
#include "GrContextFactory.h"
@@ -168,4 +166,3 @@
}
}
}
-#endif
diff --git a/tests/BlendTest.cpp b/tests/BlendTest.cpp
index 5b2f6fa..74e6a8f 100644
--- a/tests/BlendTest.cpp
+++ b/tests/BlendTest.cpp
@@ -19,7 +19,6 @@
#include "SkTypes.h"
#include "Test.h"
-#if SK_SUPPORT_GPU
#include "GrBackendSurface.h"
#include "GrContext.h"
#include "GrContextFactory.h"
@@ -27,7 +26,6 @@
#include "GrResourceProvider.h"
#include "GrTexture.h"
#include "GrTypes.h"
-#endif
#include <vector>
@@ -87,7 +85,6 @@
for (auto multiply : perfect) { REPORTER_ASSERT(r, test(multiply).diffs == 0); }
}
-#if SK_SUPPORT_GPU
namespace {
static sk_sp<SkSurface> create_gpu_surface_backend_texture_as_render_target(
GrContext* context, int sampleCnt, int width, int height, SkColorType colorType,
@@ -206,4 +203,3 @@
backingSurface.reset();
}
}
-#endif
diff --git a/tests/BlurTest.cpp b/tests/BlurTest.cpp
index 07cfdcd..2462342 100644
--- a/tests/BlurTest.cpp
+++ b/tests/BlurTest.cpp
@@ -39,9 +39,7 @@
#include "Test.h"
#include "sk_pixel_iter.h"
-#if SK_SUPPORT_GPU
#include "GrContextFactory.h"
-#endif
#include <math.h>
#include <string.h>
@@ -349,9 +347,7 @@
#if WRITE_CSV
write_as_csv("RectSpecialCase", sigma, rectSpecialCaseResult, kSize);
write_as_csv("GeneralCase", sigma, generalCaseResult, kSize);
-#if SK_SUPPORT_GPU
write_as_csv("GPU", sigma, gpuResult, kSize);
-#endif
write_as_csv("GroundTruth2D", sigma, groundTruthResult, kSize);
write_as_csv("BruteForce1D", sigma, bruteForce1DResult, kSize);
#endif
@@ -500,8 +496,6 @@
}
}
-#if SK_SUPPORT_GPU
-
// This exercises the problem discovered in crbug.com/570232. The return value from
// SkBlurMask::BoxBlur wasn't being checked in SkBlurMaskFilter.cpp::GrRRectBlurEffect::Create
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SmallBoxBlurBug, reporter, ctxInfo) {
@@ -519,9 +513,6 @@
canvas->drawRRect(rr, p);
}
-#endif
-
-
DEF_TEST(BlurredRRectNinePatchComputation, reporter) {
const SkRect r = SkRect::MakeXYWH(10, 10, 100, 100);
static const SkScalar kBlurRad = 3.0f;
@@ -710,7 +701,6 @@
///////////////////////////////////////////////////////////////////////////////////////////
-#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(BlurMaskBiggerThanDest, reporter, ctxInfo) {
GrContext* context = ctxInfo.grContext();
@@ -741,6 +731,3 @@
REPORTER_ASSERT(reporter, SkColorGetB(readback.getColor(15, 15)) == 0);
REPORTER_ASSERT(reporter, readback.getColor(31, 31) == SK_ColorBLACK);
}
-
-#endif
-
diff --git a/tests/ClearTest.cpp b/tests/ClearTest.cpp
index 1110fdd..703792d 100644
--- a/tests/ClearTest.cpp
+++ b/tests/ClearTest.cpp
@@ -7,7 +7,6 @@
#include "SkTypes.h"
-#if SK_SUPPORT_GPU
#include "GrColor.h"
#include "GrContext.h"
#include "GrContextFactory.h"
@@ -295,5 +294,3 @@
fullscreen_clear_with_layer_test(reporter, workaroundFactory.get(ctxInfo.type()));
}
}
-
-#endif
diff --git a/tests/ClipBoundsTest.cpp b/tests/ClipBoundsTest.cpp
index d616902..32b17ad 100644
--- a/tests/ClipBoundsTest.cpp
+++ b/tests/ClipBoundsTest.cpp
@@ -7,8 +7,6 @@
#include "SkTypes.h"
-// This is a GR test
-#if SK_SUPPORT_GPU
#include "GrClipStackClip.h"
#include "SkClipOpPriv.h"
#include "SkClipStack.h"
@@ -56,5 +54,3 @@
REPORTER_ASSERT(reporter, intScreen == devGrClipBound);
REPORTER_ASSERT(reporter, isIntersectionOfRects);
}
-
-#endif
diff --git a/tests/ClipStackTest.cpp b/tests/ClipStackTest.cpp
index a716c04..70d7dca 100644
--- a/tests/ClipStackTest.cpp
+++ b/tests/ClipStackTest.cpp
@@ -27,7 +27,6 @@
#include "SkTypes.h"
#include "Test.h"
-#if SK_SUPPORT_GPU
#include "GrCaps.h"
#include "GrClip.h"
#include "GrClipStackClip.h"
@@ -43,7 +42,6 @@
#include "GrTextureProxy.h"
typedef GrReducedClip::ElementList ElementList;
typedef GrReducedClip::InitialState InitialState;
-#endif
#include <cstring>
#include <new>
@@ -878,7 +876,6 @@
///////////////////////////////////////////////////////////////////////////////////////////////////
-#if SK_SUPPORT_GPU
// Functions that add a shape to the clip stack. The shape is computed from a rectangle.
// AA is always disabled since the clip stack reducer can cause changes in aa rasterization of the
// stack. A fractional edge repeated in different elements may be rasterized fewer times using the
@@ -1430,8 +1427,6 @@
}
}
-#endif
-
DEF_TEST(ClipStack, reporter) {
SkClipStack stack;
@@ -1478,18 +1473,16 @@
test_path_replace(reporter);
test_quickContains(reporter);
test_invfill_diff_bug(reporter);
-#if SK_SUPPORT_GPU
+
test_reduced_clip_stack(reporter);
test_reduced_clip_stack_genid(reporter);
test_reduced_clip_stack_no_aa_crash(reporter);
test_reduced_clip_stack_aa(reporter);
test_tiny_query_bounds_assertion_bug(reporter);
-#endif
}
//////////////////////////////////////////////////////////////////////////////
-#if SK_SUPPORT_GPU
sk_sp<GrTextureProxy> GrClipStackClip::testingOnly_createClipMask(GrContext* context) const {
const GrReducedClip reducedClip(*fStack, SkRect::MakeWH(512, 512), 0);
return this->createSoftwareClipMask(context, reducedClip, nullptr);
@@ -1563,4 +1556,3 @@
REPORTER_ASSERT(reporter, rgn.getBounds() == SkIRect::MakeLTRB(3, 3, 7, 7));
canvas->restore();
}
-#endif
diff --git a/tests/CopySurfaceTest.cpp b/tests/CopySurfaceTest.cpp
index acdc2b9..4921f5b 100644
--- a/tests/CopySurfaceTest.cpp
+++ b/tests/CopySurfaceTest.cpp
@@ -7,7 +7,6 @@
#include "SkTypes.h"
-#if SK_SUPPORT_GPU
#include "GrContext.h"
#include "GrContextFactory.h"
#include "GrContextPriv.h"
@@ -162,4 +161,3 @@
}
}
}
-#endif
diff --git a/tests/DefaultPathRendererTest.cpp b/tests/DefaultPathRendererTest.cpp
index 8619f5c..61778ca 100644
--- a/tests/DefaultPathRendererTest.cpp
+++ b/tests/DefaultPathRendererTest.cpp
@@ -7,7 +7,6 @@
#include "SkTypes.h"
-#if SK_SUPPORT_GPU
#include "GrClip.h"
#include "GrColor.h"
#include "GrContext.h"
@@ -138,5 +137,3 @@
run_test(ctx, reporter);
}
-
-#endif
diff --git a/tests/DeferredDisplayListTest.cpp b/tests/DeferredDisplayListTest.cpp
index f67d346..996e04f 100644
--- a/tests/DeferredDisplayListTest.cpp
+++ b/tests/DeferredDisplayListTest.cpp
@@ -7,7 +7,6 @@
#include "SkTypes.h"
-#if SK_SUPPORT_GPU
#include "GrBackendSurface.h"
#include "GrCaps.h"
#include "GrContext.h"
@@ -939,5 +938,3 @@
}
}
-
-#endif
diff --git a/tests/DetermineDomainModeTest.cpp b/tests/DetermineDomainModeTest.cpp
index 4310cbe..c40a957 100644
--- a/tests/DetermineDomainModeTest.cpp
+++ b/tests/DetermineDomainModeTest.cpp
@@ -7,7 +7,6 @@
#include "SkTypes.h"
-#if SK_SUPPORT_GPU
#include "GrContext.h"
#include "GrContextFactory.h"
#include "GrContextPriv.h"
@@ -389,5 +388,3 @@
proxy_test(reporter, context->contextPriv().proxyProvider());
}
-
-#endif
diff --git a/tests/DeviceTest.cpp b/tests/DeviceTest.cpp
index 184da92..a9e21e6 100644
--- a/tests/DeviceTest.cpp
+++ b/tests/DeviceTest.cpp
@@ -16,12 +16,10 @@
#include "Test.h"
class SkColorSpace;
-#if SK_SUPPORT_GPU
#include "GrContextFactory.h"
#include "GrTypes.h"
#include "SkGpuDevice.h"
class GrContext;
-#endif
class DeviceTestingAccess {
public:
@@ -78,8 +76,6 @@
#endif
-#if SK_SUPPORT_GPU
-
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SpecialImage_GPUDevice, reporter, ctxInfo) {
GrContext* context = ctxInfo.grContext();
@@ -131,5 +127,3 @@
SkASSERT(2*kHeight == special->height());
SkASSERT(SkIRect::MakeWH(2*kWidth, 2*kHeight) == special->subset());
}
-
-#endif
diff --git a/tests/DrawOpAtlasTest.cpp b/tests/DrawOpAtlasTest.cpp
index a2e0836..0a5f991 100644
--- a/tests/DrawOpAtlasTest.cpp
+++ b/tests/DrawOpAtlasTest.cpp
@@ -7,7 +7,6 @@
#include "SkTypes.h"
-#if SK_SUPPORT_GPU
#include "GrContext.h"
#include "GrContextFactory.h"
#include "GrContextPriv.h"
@@ -224,6 +223,3 @@
op->prepare(&flushState);
flushState.setOpArgs(nullptr);
}
-
-
-#endif
diff --git a/tests/EGLImageTest.cpp b/tests/EGLImageTest.cpp
index 0b54e81..f2c7371 100644
--- a/tests/EGLImageTest.cpp
+++ b/tests/EGLImageTest.cpp
@@ -7,7 +7,6 @@
#include "Test.h"
#include "TestUtils.h"
-#if SK_SUPPORT_GPU
#include "GrContext.h"
#include "GrContextFactory.h"
#include "GrContextPriv.h"
@@ -198,5 +197,3 @@
cleanup(glCtx0, externalTexture.fID, glCtx1.get(), context1, &backendTexture1, image);
}
-
-#endif
diff --git a/tests/FloatingPointTextureTest.cpp b/tests/FloatingPointTextureTest.cpp
index dac13a5..178392a 100644
--- a/tests/FloatingPointTextureTest.cpp
+++ b/tests/FloatingPointTextureTest.cpp
@@ -15,7 +15,6 @@
#include <float.h>
#include "Test.h"
-#if SK_SUPPORT_GPU
#include "GrContext.h"
#include "GrContextPriv.h"
#include "GrProxyProvider.h"
@@ -98,5 +97,3 @@
kMaxIntegerRepresentableInHalfFloatingPoint, HALF_RGBA_CONTROL_ARRAY_SIZE,
GrColorType::kRGBA_F16);
}
-
-#endif
diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp
index 3e4ed5f..6910ab5 100644
--- a/tests/GLProgramsTest.cpp
+++ b/tests/GLProgramsTest.cpp
@@ -9,7 +9,7 @@
#include "SkTypes.h"
-#if SK_SUPPORT_GPU && SK_ALLOW_STATIC_GLOBAL_INITIALIZERS
+#if SK_ALLOW_STATIC_GLOBAL_INITIALIZERS
#include "GrAutoLocaleSetter.h"
#include "GrContextFactory.h"
diff --git a/tests/GpuDrawPathTest.cpp b/tests/GpuDrawPathTest.cpp
index 79afa63..39e332f 100644
--- a/tests/GpuDrawPathTest.cpp
+++ b/tests/GpuDrawPathTest.cpp
@@ -7,8 +7,6 @@
#include "SkTypes.h"
-#if SK_SUPPORT_GPU
-
#include "GrContext.h"
#include "GrPath.h"
#include "GrShape.h"
@@ -163,5 +161,3 @@
}
}
}
-
-#endif
diff --git a/tests/GpuLayerCacheTest.cpp b/tests/GpuLayerCacheTest.cpp
index 7419f17..b22809c 100644
--- a/tests/GpuLayerCacheTest.cpp
+++ b/tests/GpuLayerCacheTest.cpp
@@ -9,8 +9,6 @@
// The test fails when we add a discard to a newly created render target.
#if 0
-#if SK_SUPPORT_GPU
-
#include "GrContext.h"
#include "GrLayerCache.h"
#include "GrResourceCache.h"
@@ -371,4 +369,3 @@
}
#endif
-#endif
diff --git a/tests/GpuRectanizerTest.cpp b/tests/GpuRectanizerTest.cpp
index 2ee641e..5b737fe 100644
--- a/tests/GpuRectanizerTest.cpp
+++ b/tests/GpuRectanizerTest.cpp
@@ -5,8 +5,6 @@
* found in the LICENSE file.
*/
-#if SK_SUPPORT_GPU
-
#include "GrRectanizer_pow2.h"
#include "GrRectanizer_skyline.h"
#include "SkRandom.h"
@@ -70,5 +68,3 @@
test_skyline(reporter, rects);
test_pow2(reporter, rects);
}
-
-#endif
diff --git a/tests/GrAllocatorTest.cpp b/tests/GrAllocatorTest.cpp
index c02a7ca..7c1c1fa 100644
--- a/tests/GrAllocatorTest.cpp
+++ b/tests/GrAllocatorTest.cpp
@@ -6,8 +6,6 @@
*/
#include "Test.h"
-// This is a GPU-backend specific test
-#if SK_SUPPORT_GPU
#include "GrAllocator.h"
namespace {
@@ -99,5 +97,3 @@
check_allocator(allocators[i], 100, 10, reporter);
}
}
-
-#endif
diff --git a/tests/GrCCPRTest.cpp b/tests/GrCCPRTest.cpp
index 8cde797..35e3a1f 100644
--- a/tests/GrCCPRTest.cpp
+++ b/tests/GrCCPRTest.cpp
@@ -8,8 +8,6 @@
#include "SkTypes.h"
#include "Test.h"
-#if SK_SUPPORT_GPU
-
#include "GrContext.h"
#include "GrContextPriv.h"
#include "GrClip.h"
@@ -310,5 +308,3 @@
}
};
DEF_CCPR_RENDERING_TEST(GrCCPRTest_busyPath)
-
-#endif
diff --git a/tests/GrContextAbandonTest.cpp b/tests/GrContextAbandonTest.cpp
index 544e121..dcd18e2 100644
--- a/tests/GrContextAbandonTest.cpp
+++ b/tests/GrContextAbandonTest.cpp
@@ -7,8 +7,6 @@
#include "SkTypes.h"
-#if SK_SUPPORT_GPU
-
#include "GrContextFactory.h"
#include "Test.h"
@@ -49,5 +47,3 @@
}
}
}
-
-#endif
diff --git a/tests/GrContextFactoryTest.cpp b/tests/GrContextFactoryTest.cpp
index d98fe09..92801eb 100644
--- a/tests/GrContextFactoryTest.cpp
+++ b/tests/GrContextFactoryTest.cpp
@@ -7,8 +7,6 @@
#include "SkTypes.h"
-#if SK_SUPPORT_GPU
-
#include "GrContextFactory.h"
#include "GrContextPriv.h"
#include "GrCaps.h"
@@ -167,5 +165,3 @@
SkString result = ctxInfo.grContext()->contextPriv().dump();
REPORTER_ASSERT(reporter, !result.isEmpty());
}
-
-#endif
diff --git a/tests/GrGLExtensionsTest.cpp b/tests/GrGLExtensionsTest.cpp
index 7062076..0c78081 100644
--- a/tests/GrGLExtensionsTest.cpp
+++ b/tests/GrGLExtensionsTest.cpp
@@ -7,9 +7,6 @@
#include "SkTypes.h"
-// This test is a GPU-backend specific test.
-#if SK_SUPPORT_GPU
-
#include "gl/GrGLDefines.h"
#include "gl/GrGLExtensions.h"
#include "Test.h"
@@ -49,5 +46,3 @@
REPORTER_ASSERT(reporter, ext.remove("test_extension_1"));
REPORTER_ASSERT(reporter, !ext.has("test_extension_1"));
}
-
-#endif
diff --git a/tests/GrMemoryPoolTest.cpp b/tests/GrMemoryPoolTest.cpp
index 4eb5ca7..3df4078 100644
--- a/tests/GrMemoryPoolTest.cpp
+++ b/tests/GrMemoryPoolTest.cpp
@@ -6,8 +6,6 @@
*/
#include "Test.h"
-// This is a GPU-backend specific test
-#if SK_SUPPORT_GPU
#include "GrMemoryPool.h"
#include "SkRandom.h"
#include "SkTArray.h"
@@ -397,5 +395,3 @@
REPORTER_ASSERT(reporter, secondBlockCount == kMinAllocCount);
}
}
-
-#endif
diff --git a/tests/GrMeshTest.cpp b/tests/GrMeshTest.cpp
index d9ffca5..1cdfe38 100644
--- a/tests/GrMeshTest.cpp
+++ b/tests/GrMeshTest.cpp
@@ -8,8 +8,6 @@
#include "SkTypes.h"
#include "Test.h"
-#if SK_SUPPORT_GPU
-
#include <array>
#include <vector>
#include "GrCaps.h"
@@ -406,5 +404,3 @@
}
}
}
-
-#endif
diff --git a/tests/GrMipMappedTest.cpp b/tests/GrMipMappedTest.cpp
index e356779..5c30363 100644
--- a/tests/GrMipMappedTest.cpp
+++ b/tests/GrMipMappedTest.cpp
@@ -7,8 +7,6 @@
#include "SkTypes.h"
-#if SK_SUPPORT_GPU
-
#include "GrBackendSurface.h"
#include "GrBackendTextureImageGenerator.h"
#include "GrContext.h"
@@ -289,5 +287,3 @@
}
}
}
-
-#endif
diff --git a/tests/GrPipelineDynamicStateTest.cpp b/tests/GrPipelineDynamicStateTest.cpp
index 4272957..b6ca8f0 100644
--- a/tests/GrPipelineDynamicStateTest.cpp
+++ b/tests/GrPipelineDynamicStateTest.cpp
@@ -8,8 +8,6 @@
#include "SkTypes.h"
#include "Test.h"
-#if SK_SUPPORT_GPU
-
#include "GrContext.h"
#include "GrColor.h"
#include "GrGeometryProcessor.h"
@@ -218,5 +216,3 @@
}
}
}
-
-#endif
diff --git a/tests/GrPorterDuffTest.cpp b/tests/GrPorterDuffTest.cpp
index cceebbb..2a666a6 100644
--- a/tests/GrPorterDuffTest.cpp
+++ b/tests/GrPorterDuffTest.cpp
@@ -7,8 +7,6 @@
#include "Test.h"
-#if SK_SUPPORT_GPU
-
#include "GrContextFactory.h"
#include "GrContextOptions.h"
#include "GrContextPriv.h"
@@ -1104,5 +1102,3 @@
}
gpu->deleteTestingOnlyBackendTexture(backendTex);
}
-
-#endif
diff --git a/tests/GrSKSLPrettyPrintTest.cpp b/tests/GrSKSLPrettyPrintTest.cpp
index c0de6c0..f0ded45 100644
--- a/tests/GrSKSLPrettyPrintTest.cpp
+++ b/tests/GrSKSLPrettyPrintTest.cpp
@@ -7,7 +7,6 @@
#include "Test.h"
-#if SK_SUPPORT_GPU
#include "GrSKSLPrettyPrint.h"
#define ASSERT(x) REPORTER_ASSERT(r, x)
@@ -120,5 +119,3 @@
ASSERT(GrSKSLPrettyPrint::PrettyPrint(testStr.begin(), lengths.begin(), 1,
true).c_str() != nullptr);
}
-
-#endif
diff --git a/tests/GrShapeTest.cpp b/tests/GrShapeTest.cpp
index a53dad8..86f007e 100644
--- a/tests/GrShapeTest.cpp
+++ b/tests/GrShapeTest.cpp
@@ -8,7 +8,6 @@
#include <initializer_list>
#include <functional>
#include "Test.h"
-#if SK_SUPPORT_GPU
#include "GrShape.h"
#include "SkCanvas.h"
#include "SkDashPathEffect.h"
@@ -2328,5 +2327,3 @@
ovalArcWithCenter.compare(reporter, oval, ovalExpectations);
}
}
-
-#endif
diff --git a/tests/GrSurfaceTest.cpp b/tests/GrSurfaceTest.cpp
index 4323ed6..80d54df 100644
--- a/tests/GrSurfaceTest.cpp
+++ b/tests/GrSurfaceTest.cpp
@@ -7,8 +7,6 @@
#include "SkTypes.h"
-#if SK_SUPPORT_GPU
-
#include "GrContext.h"
#include "GrContextPriv.h"
#include "GrGpu.h"
@@ -231,4 +229,3 @@
}
}
}
-#endif
diff --git a/tests/GrTRecorderTest.cpp b/tests/GrTRecorderTest.cpp
index 5041dd9..a4d9b1f 100644
--- a/tests/GrTRecorderTest.cpp
+++ b/tests/GrTRecorderTest.cpp
@@ -10,8 +10,6 @@
#include "SkString.h"
#include "Test.h"
-#if SK_SUPPORT_GPU
-
#include "GrTRecorder.h"
////////////////////////////////////////////////////////////////////////////////
@@ -292,5 +290,3 @@
test_subclasses(reporter);
REPORTER_ASSERT(reporter, 0 == activeRecorderItems); // Ensure ~GrTRecorder invokes dtors.
}
-
-#endif
diff --git a/tests/GrTextureMipMapInvalidationTest.cpp b/tests/GrTextureMipMapInvalidationTest.cpp
index cfb6853..d832889 100644
--- a/tests/GrTextureMipMapInvalidationTest.cpp
+++ b/tests/GrTextureMipMapInvalidationTest.cpp
@@ -7,8 +7,6 @@
#include "SkTypes.h"
-#if SK_SUPPORT_GPU
-
#include "GrContext.h"
#include "GrTexturePriv.h"
#include "SkCanvas.h"
@@ -53,5 +51,3 @@
REPORTER_ASSERT(reporter, isMipped(surf1.get()));
REPORTER_ASSERT(reporter, mipsAreDirty(surf1.get()));
}
-
-#endif
diff --git a/tests/ImageFilterCacheTest.cpp b/tests/ImageFilterCacheTest.cpp
index f4640d1..e651b33 100644
--- a/tests/ImageFilterCacheTest.cpp
+++ b/tests/ImageFilterCacheTest.cpp
@@ -191,7 +191,6 @@
test_image_backed(reporter, srcImage);
}
-#if SK_SUPPORT_GPU
#include "GrContext.h"
#include "GrContextPriv.h"
#include "GrProxyProvider.h"
@@ -282,4 +281,3 @@
test_internal_purge(reporter, fullImg);
test_explicit_purging(reporter, fullImg, subsetImg);
}
-#endif
diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp
index 8e46715..e475ddd 100644
--- a/tests/ImageFilterTest.cpp
+++ b/tests/ImageFilterTest.cpp
@@ -42,11 +42,9 @@
#include "Test.h"
#include "sk_tool_utils.h"
-#if SK_SUPPORT_GPU
#include "GrCaps.h"
#include "GrContext.h"
#include "GrContextPriv.h"
-#endif
static const int kBitmapSize = 4;
@@ -390,14 +388,11 @@
}
static sk_sp<SkSpecialSurface> create_empty_special_surface(GrContext* context, int widthHeight) {
-#if SK_SUPPORT_GPU
if (context) {
return SkSpecialSurface::MakeRenderTarget(context,
widthHeight, widthHeight,
kRGBA_8888_GrPixelConfig, nullptr);
- } else
-#endif
- {
+ } else {
const SkImageInfo info = SkImageInfo::MakeN32(widthHeight, widthHeight,
kOpaque_SkAlphaType);
return SkSpecialSurface::MakeRaster(info);
@@ -406,12 +401,9 @@
static sk_sp<SkSurface> create_surface(GrContext* context, int width, int height) {
const SkImageInfo info = SkImageInfo::MakeN32(width, height, kOpaque_SkAlphaType);
-#if SK_SUPPORT_GPU
if (context) {
return SkSurface::MakeRenderTarget(context, SkBudgeted::kNo, info);
- } else
-#endif
- {
+ } else {
return SkSurface::MakeRaster(info);
}
}
@@ -650,11 +642,9 @@
test_negative_blur_sigma(reporter, nullptr);
}
-#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageFilterNegativeBlurSigma_Gpu, reporter, ctxInfo) {
test_negative_blur_sigma(reporter, ctxInfo.grContext());
}
-#endif
static void test_zero_blur_sigma(skiatest::Reporter* reporter, GrContext* context) {
// Check that SkBlurImageFilter with a zero sigma and a non-zero srcOffset works correctly.
@@ -694,11 +684,9 @@
test_zero_blur_sigma(reporter, nullptr);
}
-#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageFilterZeroBlurSigma_Gpu, reporter, ctxInfo) {
test_zero_blur_sigma(reporter, ctxInfo.grContext());
}
-#endif
// Tests that, even when an upstream filter has returned null (due to failure or clipping), a
@@ -726,11 +714,9 @@
test_fail_affects_transparent_black(reporter, nullptr);
}
-#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageFilterFailAffectsTransparentBlack_Gpu, reporter, ctxInfo) {
test_fail_affects_transparent_black(reporter, ctxInfo.grContext());
}
-#endif
DEF_TEST(ImageFilterDrawTiled, reporter) {
// Check that all filters when drawn tiled (with subsequent clip rects) exactly
@@ -1017,11 +1003,9 @@
test_imagefilter_merge_result_size(reporter, nullptr);
}
-#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageFilterMergeResultSize_Gpu, reporter, ctxInfo) {
test_imagefilter_merge_result_size(reporter, ctxInfo.grContext());
}
-#endif
static void draw_blurred_rect(SkCanvas* canvas) {
SkPaint filterPaint;
@@ -1186,22 +1170,18 @@
test_big_kernel(reporter, nullptr);
}
-#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageFilterMatrixConvolutionBigKernel_Gpu,
reporter, ctxInfo) {
test_big_kernel(reporter, ctxInfo.grContext());
}
-#endif
DEF_TEST(ImageFilterCropRect, reporter) {
test_crop_rects(reporter, nullptr);
}
-#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageFilterCropRect_Gpu, reporter, ctxInfo) {
test_crop_rects(reporter, ctxInfo.grContext());
}
-#endif
DEF_TEST(ImageFilterMatrix, reporter) {
SkBitmap temp;
@@ -1260,11 +1240,9 @@
test_clipped_picture_imagefilter(reporter, nullptr);
}
-#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageFilterClippedPictureImageFilter_Gpu, reporter, ctxInfo) {
test_clipped_picture_imagefilter(reporter, ctxInfo.grContext());
}
-#endif
DEF_TEST(ImageFilterEmptySaveLayer, reporter) {
// Even when there's an empty saveLayer()/restore(), ensure that an image
@@ -1516,11 +1494,9 @@
test_composed_imagefilter_offset(reporter, nullptr);
}
-#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ComposedImageFilterOffset_Gpu, reporter, ctxInfo) {
test_composed_imagefilter_offset(reporter, ctxInfo.grContext());
}
-#endif
static void test_composed_imagefilter_bounds(skiatest::Reporter* reporter, GrContext* context) {
// The bounds passed to the inner filter must be filtered by the outer
@@ -1558,11 +1534,9 @@
test_composed_imagefilter_bounds(reporter, nullptr);
}
-#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ComposedImageFilterBounds_Gpu, reporter, ctxInfo) {
test_composed_imagefilter_bounds(reporter, ctxInfo.grContext());
}
-#endif
static void test_partial_crop_rect(skiatest::Reporter* reporter, GrContext* context) {
sk_sp<SkSpecialImage> srcImg(create_empty_special_image(context, 100));
@@ -1587,11 +1561,9 @@
test_partial_crop_rect(reporter, nullptr);
}
-#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageFilterPartialCropRect_Gpu, reporter, ctxInfo) {
test_partial_crop_rect(reporter, ctxInfo.grContext());
}
-#endif
DEF_TEST(ImageFilterCanComputeFastBounds, reporter) {
@@ -1692,12 +1664,10 @@
SkBitmap largeBmp;
int largeW = 5000;
int largeH = 5000;
-#if SK_SUPPORT_GPU
// If we're GPU-backed make the bitmap too large to be converted into a texture.
if (GrContext* ctx = canvas->getGrContext()) {
largeW = ctx->contextPriv().caps()->maxTextureSize() + 1;
}
-#endif
largeBmp.allocN32Pixels(largeW, largeH);
largeBmp.eraseColor(0);
@@ -1799,13 +1769,9 @@
test_make_with_filter(reporter, nullptr);
}
-#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageFilterMakeWithFilter_Gpu, reporter, ctxInfo) {
test_make_with_filter(reporter, ctxInfo.grContext());
}
-#endif
-
-#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageFilterHugeBlur_Gpu, reporter, ctxInfo) {
@@ -1834,7 +1800,6 @@
SkImageInfo::Make(100, 100, kRGBA_8888_SkColorType, kPremul_SkAlphaType)));
test_large_blur_input(reporter, surface->getCanvas());
}
-#endif
/*
* Test that colorfilterimagefilter does not require its CTM to be decomposed when it has more
diff --git a/tests/ImageIsOpaqueTest.cpp b/tests/ImageIsOpaqueTest.cpp
index 5bec2b0..8a2c816 100644
--- a/tests/ImageIsOpaqueTest.cpp
+++ b/tests/ImageIsOpaqueTest.cpp
@@ -9,9 +9,7 @@
#include "Resources.h"
#include "Test.h"
-#if SK_SUPPORT_GPU
#include "GrContext.h"
-#endif
#include "SkCanvas.h"
#include "SkImage.h"
#include "SkSurface.h"
@@ -34,8 +32,6 @@
check_isopaque(reporter, surfaceOpaque, true);
}
-#if SK_SUPPORT_GPU
-
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageIsOpaqueTest_Gpu, reporter, ctxInfo) {
GrContext* context = ctxInfo.grContext();
SkImageInfo infoTransparent = SkImageInfo::MakeN32Premul(5, 5);
@@ -48,8 +44,6 @@
check_isopaque(reporter, surfaceOpaque, true);
}
-#endif
-
///////////////////////////////////////////////////////////////////////////////////////////////////
#include "SkPictureRecorder.h"
diff --git a/tests/ImageNewShaderTest.cpp b/tests/ImageNewShaderTest.cpp
index ff80729..092a422 100644
--- a/tests/ImageNewShaderTest.cpp
+++ b/tests/ImageNewShaderTest.cpp
@@ -12,9 +12,7 @@
#include "SkTypes.h"
#include "Test.h"
-#if SK_SUPPORT_GPU
#include "GrContext.h"
-#endif
static void test_bitmap_equality(skiatest::Reporter* reporter, SkBitmap& bm1, SkBitmap& bm2) {
REPORTER_ASSERT(reporter, bm1.computeByteSize() == bm2.computeByteSize());
@@ -106,8 +104,6 @@
run_shader_test(reporter, sourceSurface.get(), destinationSurface.get(), info);
}
-#if SK_SUPPORT_GPU
-
static void gpu_to_gpu(skiatest::Reporter* reporter, GrContext* context) {
SkImageInfo info = SkImageInfo::MakeN32Premul(5, 5);
@@ -145,5 +141,3 @@
// RASTER -> GPU
raster_to_gpu(reporter, ctxInfo.grContext());
}
-
-#endif
diff --git a/tests/ImageTest.cpp b/tests/ImageTest.cpp
index 44e901e..9d03948 100644
--- a/tests/ImageTest.cpp
+++ b/tests/ImageTest.cpp
@@ -32,14 +32,12 @@
#include "sk_pixel_iter.h"
#include "sk_tool_utils.h"
-#if SK_SUPPORT_GPU
#include "GrContextPriv.h"
#include "GrGpu.h"
#include "GrResourceCache.h"
#include "GrTest.h"
#include "GrTexture.h"
#include "SkGr.h"
-#endif
using namespace sk_gpu_test;
@@ -106,7 +104,6 @@
sk_sp<SkData> data(create_image_data(&info));
return SkImage::MakeRasterData(info, std::move(data), info.minRowBytes());
}
-#if SK_SUPPORT_GPU // not gpu-specific but currently only used in GPU tests
static sk_sp<SkImage> create_image_large(int maxTextureSize) {
const SkImageInfo info = SkImageInfo::MakeN32(maxTextureSize + 1, 32, kOpaque_SkAlphaType);
auto surface(SkSurface::MakeRaster(info));
@@ -124,7 +121,6 @@
nullptr, nullptr, SkImage::BitDepth::kU8,
SkColorSpace::MakeSRGB());
};
-#endif
// Want to ensure that our Release is called when the owning image is destroyed
struct RasterDataHolder {
RasterDataHolder() : fReleaseCount(0) {}
@@ -151,14 +147,12 @@
sk_sp<SkData> src(sk_tool_utils::EncodeImageToData(bitmap, SkEncodedImageFormat::kPNG, 100));
return SkImage::MakeFromEncoded(std::move(src));
}
-#if SK_SUPPORT_GPU
static sk_sp<SkImage> create_gpu_image(GrContext* context) {
const SkImageInfo info = SkImageInfo::MakeN32(20, 20, kOpaque_SkAlphaType);
auto surface(SkSurface::MakeRenderTarget(context, SkBudgeted::kNo, info));
draw_image_test_pattern(surface->getCanvas());
return surface->makeImageSnapshot();
}
-#endif
static void test_encode(skiatest::Reporter* reporter, SkImage* image) {
const SkIRect ir = SkIRect::MakeXYWH(5, 5, 10, 10);
@@ -185,11 +179,9 @@
test_encode(reporter, create_image().get());
}
-#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageEncode_Gpu, reporter, ctxInfo) {
test_encode(reporter, create_gpu_image(ctxInfo.grContext()).get());
}
-#endif
DEF_TEST(Image_MakeFromRasterBitmap, reporter) {
const struct {
@@ -331,7 +323,6 @@
}
///////////////////////////////////////////////////////////////////////////////////////////////////
-#if SK_SUPPORT_GPU
#include "SkBitmapCache.h"
@@ -619,8 +610,6 @@
}
}
-#endif
-
class EmptyGenerator : public SkImageGenerator {
public:
EmptyGenerator() : SkImageGenerator(SkImageInfo::MakeN32Premul(0, 0)) {}
@@ -721,11 +710,9 @@
image = create_codec_image();
image_test_read_pixels(reporter, image.get());
}
-#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageReadPixels_Gpu, reporter, ctxInfo) {
image_test_read_pixels(reporter, create_gpu_image(ctxInfo.grContext()).get());
}
-#endif
static void check_legacy_bitmap(skiatest::Reporter* reporter, const SkImage* image,
const SkBitmap& bitmap) {
@@ -779,12 +766,10 @@
image = create_codec_image();
test_legacy_bitmap(reporter, image.get());
}
-#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageLegacyBitmap_Gpu, reporter, ctxInfo) {
sk_sp<SkImage> image(create_gpu_image(ctxInfo.grContext()));
test_legacy_bitmap(reporter, image.get());
}
-#endif
static void test_peek(skiatest::Reporter* reporter, SkImage* image, bool expectPeekSuccess) {
if (!image) {
@@ -821,14 +806,11 @@
image = create_codec_image();
test_peek(reporter, image.get(), false);
}
-#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImagePeek_Gpu, reporter, ctxInfo) {
sk_sp<SkImage> image(create_gpu_image(ctxInfo.grContext()));
test_peek(reporter, image.get(), false);
}
-#endif
-#if SK_SUPPORT_GPU
struct TextureReleaseChecker {
TextureReleaseChecker() : fReleaseCount(0) {}
int fReleaseCount;
@@ -1153,7 +1135,6 @@
context->flush();
}
}
-#endif
///////////////////////////////////////////////////////////////////////////////////////////////////
@@ -1346,7 +1327,6 @@
test_scale_pixels(reporter, codecImage.get(), pmRed);
}
-#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageScalePixels_Gpu, reporter, ctxInfo) {
const SkPMColor pmRed = SkPackARGB32(0xFF, 0xFF, 0, 0);
const SkColor red = SK_ColorRED;
@@ -1358,7 +1338,6 @@
sk_sp<SkImage> gpuImage = surface->makeImageSnapshot();
test_scale_pixels(reporter, gpuImage.get(), pmRed);
}
-#endif
static sk_sp<SkImage> any_image_will_do() {
return GetResourceAsImage("images/mandrill_32.png");
diff --git a/tests/LazyProxyTest.cpp b/tests/LazyProxyTest.cpp
index dc8232b..28ba817 100644
--- a/tests/LazyProxyTest.cpp
+++ b/tests/LazyProxyTest.cpp
@@ -7,8 +7,6 @@
#include "Test.h"
-#if SK_SUPPORT_GPU
-
#include "GrClip.h"
#include "GrContextPriv.h"
#include "GrProxyProvider.h"
@@ -469,5 +467,3 @@
gpu->deleteTestingOnlyBackendTexture(backendTex);
}
}
-
-#endif
diff --git a/tests/OnFlushCallbackTest.cpp b/tests/OnFlushCallbackTest.cpp
index 706ce7a..e980e99 100644
--- a/tests/OnFlushCallbackTest.cpp
+++ b/tests/OnFlushCallbackTest.cpp
@@ -7,8 +7,6 @@
#include "Test.h"
-#if SK_SUPPORT_GPU
-
#include "GrBackendSemaphore.h"
#include "GrClip.h"
#include "GrContextPriv.h"
@@ -584,5 +582,3 @@
x += kDrawnTileSize;
test_color(reporter, readBack, x, SK_ColorYELLOW);
}
-
-#endif
diff --git a/tests/PackedConfigsTextureTest.cpp b/tests/PackedConfigsTextureTest.cpp
index adc8a3d..047ae44 100644
--- a/tests/PackedConfigsTextureTest.cpp
+++ b/tests/PackedConfigsTextureTest.cpp
@@ -13,7 +13,6 @@
#include "Test.h"
-#if SK_SUPPORT_GPU
#include "GrContext.h"
#include "GrContextPriv.h"
#include "GrProxyProvider.h"
@@ -145,5 +144,3 @@
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(RGB565TextureTest, reporter, ctxInfo) {
run_test(reporter, ctxInfo.grContext(), CONTROL_ARRAY_SIZE, kRGB_565_SkColorType);
}
-
-#endif
diff --git a/tests/PathRendererCacheTests.cpp b/tests/PathRendererCacheTests.cpp
index f8c95b3..0dfe654 100644
--- a/tests/PathRendererCacheTests.cpp
+++ b/tests/PathRendererCacheTests.cpp
@@ -9,7 +9,6 @@
#include "SkPath.h"
-#if SK_SUPPORT_GPU
#include "GrClip.h"
#include "GrContext.h"
#include "GrContextPriv.h"
@@ -150,5 +149,3 @@
test_path(reporter, create_concave_path, createPR, kExpectedResources, GrAAType::kCoverage,
style);
}
-
-#endif
diff --git a/tests/PinnedImageTest.cpp b/tests/PinnedImageTest.cpp
index b5f53fc..00720a5 100644
--- a/tests/PinnedImageTest.cpp
+++ b/tests/PinnedImageTest.cpp
@@ -9,8 +9,6 @@
#include "Test.h"
-#if SK_SUPPORT_GPU
-
using namespace sk_gpu_test;
#include "GrContextFactory.h"
@@ -128,5 +126,3 @@
basic_test(reporter, ctxInfo.grContext());
cleanup_test(reporter);
}
-
-#endif
diff --git a/tests/PremulAlphaRoundTripTest.cpp b/tests/PremulAlphaRoundTripTest.cpp
index ba00363..bc92bd8 100644
--- a/tests/PremulAlphaRoundTripTest.cpp
+++ b/tests/PremulAlphaRoundTripTest.cpp
@@ -10,9 +10,7 @@
#include "Test.h"
#include "sk_tool_utils.h"
-#if SK_SUPPORT_GPU
#include "GrContext.h"
-#endif
static uint32_t pack_unpremul_rgba(SkColor c) {
uint32_t packed;
@@ -102,7 +100,6 @@
test_premul_alpha_roundtrip(reporter, surf.get());
}
-#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(PremulAlphaRoundTrip_Gpu, reporter, ctxInfo) {
const SkImageInfo info = SkImageInfo::MakeN32Premul(256, 256);
@@ -111,4 +108,3 @@
info));
test_premul_alpha_roundtrip(reporter, surf.get());
}
-#endif
diff --git a/tests/PrimitiveProcessorTest.cpp b/tests/PrimitiveProcessorTest.cpp
index 95855e0..36709f8 100644
--- a/tests/PrimitiveProcessorTest.cpp
+++ b/tests/PrimitiveProcessorTest.cpp
@@ -10,7 +10,6 @@
#include "SkTypes.h"
#include "Test.h"
-#if SK_SUPPORT_GPU
#include "GrContext.h"
#include "GrContextPriv.h"
#include "GrGeometryProcessor.h"
@@ -155,4 +154,3 @@
REPORTER_ASSERT(reporter, gpu->stats()->numFailedDraws() == 1);
#endif
}
-#endif
diff --git a/tests/ProcessorTest.cpp b/tests/ProcessorTest.cpp
index 9cb23ac..b1da1b5 100644
--- a/tests/ProcessorTest.cpp
+++ b/tests/ProcessorTest.cpp
@@ -8,7 +8,6 @@
#include "SkTypes.h"
#include "Test.h"
-#if SK_SUPPORT_GPU
#include <random>
#include "GrClip.h"
#include "GrContext.h"
@@ -567,4 +566,3 @@
#endif // GR_TEST_UTILS
#endif // SK_ALLOW_STATIC_GLOBAL_INITIALIZERS
-#endif // SK_SUPPORT_GPU
diff --git a/tests/PromiseImageTest.cpp b/tests/PromiseImageTest.cpp
index ef4a299..365b132 100644
--- a/tests/PromiseImageTest.cpp
+++ b/tests/PromiseImageTest.cpp
@@ -7,8 +7,6 @@
#include "Test.h"
-#if SK_SUPPORT_GPU
-
#include "GrBackendSurface.h"
#include "GrContextPriv.h"
#include "GrGpu.h"
@@ -240,5 +238,3 @@
gpu->deleteTestingOnlyBackendTexture(backendTex);
}
}
-
-#endif
diff --git a/tests/ProxyConversionTest.cpp b/tests/ProxyConversionTest.cpp
index 7103403..4a95d48 100644
--- a/tests/ProxyConversionTest.cpp
+++ b/tests/ProxyConversionTest.cpp
@@ -9,7 +9,6 @@
#include "Test.h"
-#if SK_SUPPORT_GPU
#include "GrBackendSurface.h"
#include "GrContextPriv.h"
#include "GrGpu.h"
@@ -175,4 +174,3 @@
REPORTER_ASSERT(reporter, !tProxy->asRenderTargetProxy());
}
}
-#endif
diff --git a/tests/ProxyRefTest.cpp b/tests/ProxyRefTest.cpp
index 30cc449..6a7dfbd 100644
--- a/tests/ProxyRefTest.cpp
+++ b/tests/ProxyRefTest.cpp
@@ -9,7 +9,6 @@
#include "Test.h"
-#if SK_SUPPORT_GPU
#include "GrContextPriv.h"
#include "GrGpuResourceRef.h"
#include "GrProxyProvider.h"
@@ -195,5 +194,3 @@
}
}
}
-
-#endif
diff --git a/tests/ProxyTest.cpp b/tests/ProxyTest.cpp
index 369cd1c..19e0598 100644
--- a/tests/ProxyTest.cpp
+++ b/tests/ProxyTest.cpp
@@ -9,8 +9,6 @@
#include "Test.h"
-#if SK_SUPPORT_GPU
-
#include "GrBackendSurface.h"
#include "GrContextPriv.h"
#include "GrProxyProvider.h"
@@ -354,5 +352,3 @@
}
}
}
-
-#endif
diff --git a/tests/ReadPixelsTest.cpp b/tests/ReadPixelsTest.cpp
index 867f766..12a567f 100644
--- a/tests/ReadPixelsTest.cpp
+++ b/tests/ReadPixelsTest.cpp
@@ -14,14 +14,12 @@
#include "SkSurface.h"
#include "Test.h"
-#if SK_SUPPORT_GPU
#include "GrContext.h"
#include "GrContextFactory.h"
#include "GrContextPriv.h"
#include "GrProxyProvider.h"
#include "ProxyUtils.h"
#include "SkGr.h"
-#endif
static const int DEV_W = 100, DEV_H = 100;
@@ -453,7 +451,6 @@
// SW readback fails a premul check when reading back to an unaligned rowbytes.
test_readpixels(reporter, surface, info, kLastAligned_BitmapInit);
}
-#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ReadPixels_Gpu, reporter, ctxInfo) {
if (ctxInfo.type() == sk_gpu_test::GrContextFactory::kANGLE_D3D9_ES2_ContextType ||
ctxInfo.type() == sk_gpu_test::GrContextFactory::kANGLE_GL_ES2_ContextType ||
@@ -479,9 +476,7 @@
}
}
}
-#endif
-#if SK_SUPPORT_GPU
static void test_readpixels_texture(skiatest::Reporter* reporter,
sk_sp<GrSurfaceContext> sContext,
const SkImageInfo& surfaceInfo) {
@@ -556,7 +551,6 @@
}
}
}
-#endif
///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/tests/ReadWriteAlphaTest.cpp b/tests/ReadWriteAlphaTest.cpp
index b82c48f..0dc1fc0 100644
--- a/tests/ReadWriteAlphaTest.cpp
+++ b/tests/ReadWriteAlphaTest.cpp
@@ -8,7 +8,6 @@
#include "Test.h"
// This test is specific to the GPU backend.
-#if SK_SUPPORT_GPU
#include "GrContext.h"
#include "GrContextPriv.h"
#include "GrProxyProvider.h"
@@ -218,5 +217,3 @@
}
}
}
-
-#endif
diff --git a/tests/RectangleTextureTest.cpp b/tests/RectangleTextureTest.cpp
index 04ced77..3516acf 100644
--- a/tests/RectangleTextureTest.cpp
+++ b/tests/RectangleTextureTest.cpp
@@ -8,7 +8,6 @@
#include "Test.h"
#include "TestUtils.h"
-#if SK_SUPPORT_GPU
#include "GrClip.h"
#include "GrContext.h"
#include "GrContextPriv.h"
@@ -167,5 +166,3 @@
GR_GL_CALL(glContext->gl(), DeleteTextures(1, &rectTexID));
}
}
-
-#endif
diff --git a/tests/RenderTargetContextTest.cpp b/tests/RenderTargetContextTest.cpp
index 07c6fe1..c93a608 100644
--- a/tests/RenderTargetContextTest.cpp
+++ b/tests/RenderTargetContextTest.cpp
@@ -13,7 +13,6 @@
// mixes this test up. Re-enable once backing GPU resources are distributed by MDB at flush time.
#if 0
-#if SK_SUPPORT_GPU
#include "GrTextureProxy.h"
#include "GrRenderTargetContext.h"
@@ -75,4 +74,3 @@
// GrRenderTargetContext
}
#endif
-#endif
diff --git a/tests/ResourceAllocatorTest.cpp b/tests/ResourceAllocatorTest.cpp
index e4df621..51ecdb7 100644
--- a/tests/ResourceAllocatorTest.cpp
+++ b/tests/ResourceAllocatorTest.cpp
@@ -5,10 +5,8 @@
* found in the LICENSE file.
*/
-// Include here to ensure SK_SUPPORT_GPU is set correctly before it is examined.
#include "SkTypes.h"
-#if SK_SUPPORT_GPU
#include "Test.h"
#include "GrContextPriv.h"
@@ -215,5 +213,3 @@
resourceProvider->testingOnly_setExplicitlyAllocateGPUResources(orig);
}
-
-#endif
diff --git a/tests/ResourceCacheTest.cpp b/tests/ResourceCacheTest.cpp
index 857286a..aee6484 100644
--- a/tests/ResourceCacheTest.cpp
+++ b/tests/ResourceCacheTest.cpp
@@ -5,10 +5,8 @@
* found in the LICENSE file.
*/
-// Include here to ensure SK_SUPPORT_GPU is set correctly before it is examined.
#include "SkTypes.h"
-#if SK_SUPPORT_GPU
#include <thread>
#include "GrContext.h"
#include "GrContextPriv.h"
@@ -1810,5 +1808,3 @@
REPORTER_ASSERT(reporter, kSize*kSize*4+(kSize*kSize*4)/3 == size);
}
}
-
-#endif
diff --git a/tests/SRGBMipMapTest.cpp b/tests/SRGBMipMapTest.cpp
index 2da7102..ac7b5cc 100644
--- a/tests/SRGBMipMapTest.cpp
+++ b/tests/SRGBMipMapTest.cpp
@@ -6,7 +6,6 @@
*/
#include "Test.h"
-#if SK_SUPPORT_GPU
#include "GrCaps.h"
#include "GrClip.h"
#include "GrContext.h"
@@ -185,4 +184,3 @@
read_and_check_pixels(reporter, s32RenderTargetContext.get(), expectedSRGB, iiSRGBA, error,
"re-render as sRGB");
}
-#endif
diff --git a/tests/SRGBReadWritePixelsTest.cpp b/tests/SRGBReadWritePixelsTest.cpp
index d090237..9c56de0 100644
--- a/tests/SRGBReadWritePixelsTest.cpp
+++ b/tests/SRGBReadWritePixelsTest.cpp
@@ -6,7 +6,6 @@
*/
#include "Test.h"
-#if SK_SUPPORT_GPU
#include "GrCaps.h"
#include "GrContext.h"
#include "GrContextPriv.h"
@@ -386,4 +385,3 @@
test_write_read(Encoding::kLinear, Encoding::kLinear, Encoding::kLinear, error,
check_no_conversion, context, reporter);
}
-#endif
diff --git a/tests/SkRemoteGlyphCacheTest.cpp b/tests/SkRemoteGlyphCacheTest.cpp
index 7370bda..235d4ca 100644
--- a/tests/SkRemoteGlyphCacheTest.cpp
+++ b/tests/SkRemoteGlyphCacheTest.cpp
@@ -15,9 +15,7 @@
#include "SkTypeface_remote.h"
#include "Test.h"
-#if SK_SUPPORT_GPU
#include "text/GrTextContext.h"
-#endif
class DiscardableManager : public SkStrikeServer::DiscardableHandleManager,
public SkStrikeClient::DiscardableHandleManager {
@@ -86,7 +84,6 @@
} \
}
-#if SK_SUPPORT_GPU
SkTextBlobCacheDiffCanvas::Settings MakeSettings(GrContext* context) {
SkTextBlobCacheDiffCanvas::Settings settings;
settings.fContextSupportsDistanceFieldText = context->supportsDistanceFieldText();
@@ -105,7 +102,6 @@
surface->readPixels(bitmap, 0, 0);
return bitmap;
}
-#endif
DEF_TEST(SkRemoteGlyphCache_TypefaceSerialization, reporter) {
sk_sp<DiscardableManager> discardableManager = sk_make_sp<DiscardableManager>();
@@ -124,7 +120,6 @@
discardableManager->unlockAndDeleteAll();
}
-#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SkRemoteGlyphCache_StrikeSerialization, reporter, ctxInfo) {
sk_sp<DiscardableManager> discardableManager = sk_make_sp<DiscardableManager>();
SkStrikeServer server(discardableManager.get());
@@ -158,7 +153,6 @@
// Must unlock everything on termination, otherwise valgrind complains about memory leaks.
discardableManager->unlockAndDeleteAll();
}
-#endif
DEF_TEST(SkRemoteGlyphCache_StrikeLockingServer, reporter) {
sk_sp<DiscardableManager> discardableManager = sk_make_sp<DiscardableManager>();
@@ -290,7 +284,6 @@
discardableManager->unlockAndDeleteAll();
}
-#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SkRemoteGlyphCache_DrawTextAsPath, reporter, ctxInfo) {
sk_sp<DiscardableManager> discardableManager = sk_make_sp<DiscardableManager>();
SkStrikeServer server(discardableManager.get());
@@ -328,9 +321,7 @@
// Must unlock everything on termination, otherwise valgrind complains about memory leaks.
discardableManager->unlockAndDeleteAll();
}
-#endif
-#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SkRemoteGlyphCache_DrawTextAsDFT, reporter, ctxInfo) {
sk_sp<DiscardableManager> discardableManager = sk_make_sp<DiscardableManager>();
SkStrikeServer server(discardableManager.get());
@@ -406,4 +397,3 @@
// Must unlock everything on termination, otherwise valgrind complains about memory leaks.
discardableManager->unlockAndDeleteAll();
}
-#endif
diff --git a/tests/SkSLErrorTest.cpp b/tests/SkSLErrorTest.cpp
index c24a25d..432f35b 100644
--- a/tests/SkSLErrorTest.cpp
+++ b/tests/SkSLErrorTest.cpp
@@ -9,8 +9,6 @@
#include "Test.h"
-#if SK_SUPPORT_GPU
-
static void test_failure(skiatest::Reporter* r, const char* src, const char* error) {
SkSL::Compiler compiler;
SkSL::Program::Settings settings;
@@ -508,4 +506,3 @@
"layout (location=0, index=0) out half4 duplicateOutput;",
"error: 1: out location=0, index=0 is reserved for sk_FragColor\n1 error\n");
}
-#endif
diff --git a/tests/SkSLFPTest.cpp b/tests/SkSLFPTest.cpp
index 03b3922..4208246 100644
--- a/tests/SkSLFPTest.cpp
+++ b/tests/SkSLFPTest.cpp
@@ -9,8 +9,6 @@
#include "Test.h"
-#if SK_SUPPORT_GPU
-
static void test(skiatest::Reporter* r, const char* src, const GrShaderCaps& caps,
std::vector<const char*> expectedH, std::vector<const char*> expectedCPP) {
SkSL::Program::Settings settings;
@@ -383,5 +381,3 @@
"this->registerChildProcessor(src.childProcessor(1).clone());"
});
}
-
-#endif
diff --git a/tests/SkSLGLSLTest.cpp b/tests/SkSLGLSLTest.cpp
index fe30ef4..c3577e0 100644
--- a/tests/SkSLGLSLTest.cpp
+++ b/tests/SkSLGLSLTest.cpp
@@ -9,8 +9,6 @@
#include "Test.h"
-#if SK_SUPPORT_GPU
-
// Note that the optimizer will aggressively kill dead code and substitute constants in place of
// variables, so we have to jump through a few hoops to ensure that the code in these tests has the
// necessary side-effects to remain live. In some cases we rely on the optimizer not (yet) being
@@ -1956,5 +1954,3 @@
" sk_FragColor = vec4(float(exp));\n"
"}\n");
}
-
-#endif
diff --git a/tests/SkSLMemoryLayoutTest.cpp b/tests/SkSLMemoryLayoutTest.cpp
index ef13835..f4df89e 100644
--- a/tests/SkSLMemoryLayoutTest.cpp
+++ b/tests/SkSLMemoryLayoutTest.cpp
@@ -10,8 +10,6 @@
#include "Test.h"
-#if SK_SUPPORT_GPU
-
DEF_TEST(SkSLMemoryLayout140Test, r) {
SkSL::Context context;
SkSL::MemoryLayout layout(SkSL::MemoryLayout::k140_Standard);
@@ -173,4 +171,3 @@
REPORTER_ASSERT(r, 16 == layout.alignment(array2));
REPORTER_ASSERT(r, 16 == layout.stride(array2));
}
-#endif
diff --git a/tests/SkSLSPIRVTest.cpp b/tests/SkSLSPIRVTest.cpp
index f688d50..d7c7ac9 100644
--- a/tests/SkSLSPIRVTest.cpp
+++ b/tests/SkSLSPIRVTest.cpp
@@ -9,8 +9,6 @@
#include "Test.h"
-#if SK_SUPPORT_GPU
-
static void test_failure(skiatest::Reporter* r, const char* src, const char* error) {
SkSL::Compiler compiler;
SkSL::Program::Settings settings;
@@ -40,5 +38,3 @@
"sk_FragColor.r = float(bad.x); }",
"error: 1: offset of field 'y' must be at least 4\n1 error\n");
}
-
-#endif
diff --git a/tests/SpecialImageTest.cpp b/tests/SpecialImageTest.cpp
index 719a3af..b2f8743 100644
--- a/tests/SpecialImageTest.cpp
+++ b/tests/SpecialImageTest.cpp
@@ -15,7 +15,6 @@
#include "SkSurface.h"
#include "Test.h"
-#if SK_SUPPORT_GPU
#include "GrBackendSurface.h"
#include "GrContext.h"
#include "GrContextPriv.h"
@@ -23,7 +22,6 @@
#include "GrSurfaceProxy.h"
#include "GrTextureProxy.h"
#include "SkGr.h"
-#endif
// This test creates backing resources exactly sized to [kFullSize x kFullSize].
@@ -68,14 +66,12 @@
// Test that isTextureBacked reports the correct backing type
REPORTER_ASSERT(reporter, isGPUBacked == img->isTextureBacked());
-#if SK_SUPPORT_GPU
//--------------
// Test asTextureProxyRef - as long as there is a context this should succeed
if (context) {
sk_sp<GrTextureProxy> proxy(img->asTextureProxyRef(context));
REPORTER_ASSERT(reporter, proxy);
}
-#endif
//--------------
// Test getROPixels - this should always succeed regardless of backing store
@@ -127,7 +123,6 @@
SkPixmap tmpPixmap;
REPORTER_ASSERT(reporter, isGPUBacked != !!tightImg->peekPixels(&tmpPixmap));
}
-#if SK_SUPPORT_GPU
{
SkImageFilter::OutputProperties outProps(img->getColorSpace());
sk_sp<SkSurface> tightSurf(img->makeTightSurface(outProps, subset.size()));
@@ -140,7 +135,6 @@
SkPixmap tmpPixmap;
REPORTER_ASSERT(reporter, isGPUBacked != !!tightSurf->peekPixels(&tmpPixmap));
}
-#endif
}
DEF_TEST(SpecialImage_Raster, reporter) {
@@ -196,8 +190,6 @@
test_specialimage_image(reporter, srgbColorSpace.get());
}
-#if SK_SUPPORT_GPU
-
static void test_texture_backed(skiatest::Reporter* reporter,
const sk_sp<SkSpecialImage>& orig,
const sk_sp<SkSpecialImage>& gpuBacked) {
@@ -341,5 +333,3 @@
test_image(subSImg2, reporter, context, true, kPad, kFullSize);
}
}
-
-#endif
diff --git a/tests/SpecialSurfaceTest.cpp b/tests/SpecialSurfaceTest.cpp
index 3c6de0a..7b3896b 100644
--- a/tests/SpecialSurfaceTest.cpp
+++ b/tests/SpecialSurfaceTest.cpp
@@ -11,12 +11,10 @@
#include "SkSpecialSurface.h"
#include "Test.h"
-#if SK_SUPPORT_GPU
#include "GrCaps.h"
#include "GrContext.h"
#include "GrContextPriv.h"
#include "SkGr.h"
-#endif
class TestingSpecialSurfaceAccess {
public:
@@ -79,8 +77,6 @@
// TODO: check that the clear didn't escape the active region
}
-#if SK_SUPPORT_GPU
-
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SpecialSurface_Gpu1, reporter, ctxInfo) {
for (auto config : { kRGBA_8888_GrPixelConfig, kRGBA_1010102_GrPixelConfig }) {
if (!ctxInfo.grContext()->contextPriv().caps()->isConfigRenderable(config)) {
@@ -92,5 +88,3 @@
test_surface(surf, reporter, 0);
}
}
-
-#endif
diff --git a/tests/SurfaceSemaphoreTest.cpp b/tests/SurfaceSemaphoreTest.cpp
index b3a030e..6e8863f 100644
--- a/tests/SurfaceSemaphoreTest.cpp
+++ b/tests/SurfaceSemaphoreTest.cpp
@@ -7,7 +7,6 @@
#include "SkTypes.h"
-#if SK_SUPPORT_GPU
#include "GrContextPriv.h"
#include "GrContextFactory.h"
#include "GrTest.h"
@@ -312,5 +311,3 @@
}
#endif
}
-
-#endif
diff --git a/tests/SurfaceTest.cpp b/tests/SurfaceTest.cpp
index 965298a..bb5291c 100644
--- a/tests/SurfaceTest.cpp
+++ b/tests/SurfaceTest.cpp
@@ -6,19 +6,7 @@
*/
#include <functional>
-#include "SkCanvas.h"
-#include "SkData.h"
-#include "SkDevice.h"
-#include "SkImage_Base.h"
-#include "SkOverdrawCanvas.h"
-#include "SkPath.h"
-#include "SkRegion.h"
-#include "SkRRect.h"
-#include "SkSurface.h"
-#include "SkUtils.h"
-#include "Test.h"
-
-#if SK_SUPPORT_GPU
+#include <initializer_list>
#include <vector>
#include "GrContext.h"
#include "GrContextPriv.h"
@@ -27,14 +15,23 @@
#include "GrRenderTargetContext.h"
#include "GrResourceProvider.h"
#include "GrTest.h"
+#include "SkCanvas.h"
+#include "SkData.h"
+#include "SkDevice.h"
#include "SkGpuDevice.h"
+#include "SkImage_Base.h"
#include "SkImage_Gpu.h"
+#include "SkOverdrawCanvas.h"
+#include "SkPath.h"
+#include "SkRegion.h"
+#include "SkRRect.h"
+#include "SkSurface.h"
#include "SkSurface_Gpu.h"
-#endif
+#include "SkUtils.h"
+#include "Test.h"
#include "sk_tool_utils.h"
-#include <initializer_list>
static void release_direct_surface_storage(void* pixels, void* context) {
SkASSERT(pixels == context);
@@ -60,7 +57,6 @@
release_direct_surface_storage,
storage);
}
-#if SK_SUPPORT_GPU
static sk_sp<SkSurface> create_gpu_surface(GrContext* context, SkAlphaType at = kPremul_SkAlphaType,
SkImageInfo* requestedInfo = nullptr) {
const SkImageInfo info = SkImageInfo::MakeN32(10, 10, at);
@@ -78,7 +74,6 @@
}
return SkSurface::MakeRenderTarget(context, SkBudgeted::kYes, info);
}
-#endif
DEF_TEST(SurfaceEmpty, reporter) {
const SkImageInfo info = SkImageInfo::Make(0, 0, kN32_SkColorType, kPremul_SkAlphaType);
@@ -86,15 +81,12 @@
REPORTER_ASSERT(reporter, nullptr == SkSurface::MakeRasterDirect(info, nullptr, 0));
}
-#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceEmpty_Gpu, reporter, ctxInfo) {
const SkImageInfo info = SkImageInfo::Make(0, 0, kN32_SkColorType, kPremul_SkAlphaType);
REPORTER_ASSERT(reporter, nullptr ==
SkSurface::MakeRenderTarget(ctxInfo.grContext(), SkBudgeted::kNo, info));
}
-#endif
-#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrContext_colorTypeSupportedAsSurface, reporter, ctxInfo) {
for (int ct = 0; ct < kLastEnum_SkColorType; ++ct) {
static constexpr int kSize = 10;
@@ -210,7 +202,6 @@
REPORTER_ASSERT(reporter, sampleCnt == max, "Exected: %d, actual: %d", max, sampleCnt);
}
}
-#endif
static void test_canvas_peek(skiatest::Reporter* reporter,
sk_sp<SkSurface>& surface,
@@ -246,7 +237,6 @@
test_canvas_peek(reporter, surface, requestInfo, true);
}
}
-#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceCanvasPeek_Gpu, reporter, ctxInfo) {
for (auto& surface_func : { &create_gpu_surface, &create_gpu_scratch_surface }) {
SkImageInfo requestInfo;
@@ -254,7 +244,6 @@
test_canvas_peek(reporter, surface, requestInfo, false);
}
}
-#endif
static void test_snapshot_alphatype(skiatest::Reporter* reporter, const sk_sp<SkSurface>& surface,
SkAlphaType expectedAlphaType) {
@@ -275,7 +264,6 @@
}
}
}
-#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceSnapshotAlphaType_Gpu, reporter, ctxInfo) {
for (auto& surface_func : { &create_gpu_surface, &create_gpu_scratch_surface }) {
// GPU doesn't support creating unpremul surfaces, so only test opaque + premul
@@ -331,9 +319,6 @@
}
}
}
-#endif
-
-#if SK_SUPPORT_GPU
template<typename Type, Type(SkSurface::*func)(SkSurface::BackendHandleAccess)>
static void test_backend_unique_id(skiatest::Reporter* reporter, SkSurface* surface) {
@@ -374,7 +359,6 @@
}
}
}
-#endif
// Verify that the right canvas commands trigger a copy on write.
static void test_copy_on_write(skiatest::Reporter* reporter, SkSurface* surface) {
@@ -454,14 +438,12 @@
DEF_TEST(SurfaceCopyOnWrite, reporter) {
test_copy_on_write(reporter, create_surface().get());
}
-#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceCopyOnWrite_Gpu, reporter, ctxInfo) {
for (auto& surface_func : { &create_gpu_surface, &create_gpu_scratch_surface }) {
auto surface(surface_func(ctxInfo.grContext(), kPremul_SkAlphaType, nullptr));
test_copy_on_write(reporter, surface.get());
}
}
-#endif
static void test_writable_after_snapshot_release(skiatest::Reporter* reporter,
SkSurface* surface) {
@@ -476,16 +458,13 @@
DEF_TEST(SurfaceWriteableAfterSnapshotRelease, reporter) {
test_writable_after_snapshot_release(reporter, create_surface().get());
}
-#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceWriteableAfterSnapshotRelease_Gpu, reporter, ctxInfo) {
for (auto& surface_func : { &create_gpu_surface, &create_gpu_scratch_surface }) {
auto surface(surface_func(ctxInfo.grContext(), kPremul_SkAlphaType, nullptr));
test_writable_after_snapshot_release(reporter, surface.get());
}
}
-#endif
-#if SK_SUPPORT_GPU
static void test_crbug263329(skiatest::Reporter* reporter,
SkSurface* surface1,
SkSurface* surface2) {
@@ -525,7 +504,6 @@
test_crbug263329(reporter, surface1.get(), surface2.get());
}
}
-#endif
DEF_TEST(SurfaceGetTexture, reporter) {
auto surface(create_surface());
@@ -534,7 +512,6 @@
surface->notifyContentWillChange(SkSurface::kDiscard_ContentChangeMode);
REPORTER_ASSERT(reporter, !as_IB(image)->isTextureBacked());
}
-#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfacepeekTexture_Gpu, reporter, ctxInfo) {
for (auto& surface_func : { &create_gpu_surface, &create_gpu_scratch_surface }) {
auto surface(surface_func(ctxInfo.grContext(), kPremul_SkAlphaType, nullptr));
@@ -549,9 +526,6 @@
REPORTER_ASSERT(reporter, GrBackendTexture::TestingOnly_Equals(backendTex, backendTex2));
}
}
-#endif
-
-#if SK_SUPPORT_GPU
static SkBudgeted is_budgeted(const sk_sp<SkSurface>& surf) {
SkSurface_Gpu* gsurf = (SkSurface_Gpu*)surf.get();
@@ -591,7 +565,6 @@
REPORTER_ASSERT(reporter, budgeted == is_budgeted(image));
}
}
-#endif
static void test_no_canvas1(skiatest::Reporter* reporter,
SkSurface* surface,
@@ -627,7 +600,6 @@
}
}
}
-#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceNoCanvas_Gpu, reporter, ctxInfo) {
SkSurface::ContentChangeMode modes[] =
{ SkSurface::kDiscard_ContentChangeMode, SkSurface::kRetain_ContentChangeMode};
@@ -640,7 +612,6 @@
}
}
}
-#endif
static void check_rowbytes_remain_consistent(SkSurface* surface, skiatest::Reporter* reporter) {
SkPixmap surfacePM;
@@ -691,7 +662,6 @@
}
}
-#if SK_SUPPORT_GPU
static sk_sp<SkSurface> create_gpu_surface_backend_texture(
GrContext* context, int sampleCnt, uint32_t color, GrBackendTexture* outTexture) {
GrGpu* gpu = context->contextPriv().getGpu();
@@ -920,7 +890,6 @@
}
}
}
-#endif
static void test_surface_creation_and_snapshot_with_color_space(
skiatest::Reporter* reporter,
@@ -991,7 +960,6 @@
surfaceMaker);
}
-#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceCreationWithColorSpace_Gpu, reporter, ctxInfo) {
auto context = ctxInfo.grContext();
@@ -1039,7 +1007,6 @@
gpu->deleteTestingOnlyBackendTexture(backendTex);
}
}
-#endif
static void test_overdraw_surface(skiatest::Reporter* r, SkSurface* surface) {
SkOverdrawCanvas canvas(surface->getCanvas());
@@ -1060,13 +1027,11 @@
test_overdraw_surface(r, surface.get());
}
-#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(OverdrawSurface_Gpu, r, ctxInfo) {
GrContext* context = ctxInfo.grContext();
sk_sp<SkSurface> surface = create_gpu_surface(context);
test_overdraw_surface(r, surface.get());
}
-#endif
DEF_TEST(Surface_null, r) {
REPORTER_ASSERT(r, SkSurface::MakeNull(0, 0) == nullptr);
diff --git a/tests/TessellatingPathRendererTests.cpp b/tests/TessellatingPathRendererTests.cpp
index 086d2e5..6e5d12e 100644
--- a/tests/TessellatingPathRendererTests.cpp
+++ b/tests/TessellatingPathRendererTests.cpp
@@ -9,7 +9,6 @@
#include "SkPath.h"
-#if SK_SUPPORT_GPU
#include "GrClip.h"
#include "GrContext.h"
#include "GrContextPriv.h"
@@ -621,4 +620,3 @@
test_path(ctx, rtc.get(), create_path_34());
test_path(ctx, rtc.get(), create_path_35());
}
-#endif
diff --git a/tests/Test.h b/tests/Test.h
index f74b98a..97604a2 100644
--- a/tests/Test.h
+++ b/tests/Test.h
@@ -12,18 +12,7 @@
#include "SkString.h"
#include "SkTraceEvent.h"
#include "SkTypes.h"
-
-#if SK_SUPPORT_GPU
#include "GrContextFactory.h"
-#else
-namespace sk_gpu_test {
-class GrContextFactory;
-class ContextInfo;
-class GLTestContext;
-} // namespace sk_gpu_test
-class GrContext;
-struct GrContextOptions;
-#endif
namespace skiatest {
@@ -133,11 +122,7 @@
}
*/
-#if SK_SUPPORT_GPU
using GrContextFactoryContextType = sk_gpu_test::GrContextFactory::ContextType;
-#else
-using GrContextFactoryContextType = int;
-#endif
typedef void GrContextTestFn(Reporter*, const sk_gpu_test::ContextInfo&);
typedef bool GrContextTypeFilterFn(GrContextFactoryContextType);
diff --git a/tests/TestConfigParsing.cpp b/tests/TestConfigParsing.cpp
index df02815..c5f620f 100644
--- a/tests/TestConfigParsing.cpp
+++ b/tests/TestConfigParsing.cpp
@@ -39,7 +39,6 @@
REPORTER_ASSERT(reporter, configs.count() == 1);
REPORTER_ASSERT(reporter, configs[0]->getTag().equals("gl"));
REPORTER_ASSERT(reporter, configs[0]->getViaParts().count() == 0);
-#if SK_SUPPORT_GPU
REPORTER_ASSERT(reporter, configs[0]->asConfigGpu());
REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getContextType() ==
GrContextFactory::kGL_ContextType);
@@ -50,7 +49,6 @@
REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getColorSpace() == nullptr);
REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getSurfType() ==
SkCommandLineConfigGpu::SurfType::kDefault);
-#endif
}
DEF_TEST(ParseConfigs_OutParam, reporter) {
@@ -125,7 +123,6 @@
REPORTER_ASSERT(reporter, configs[i]->getTag().equals(config1[i]));
REPORTER_ASSERT(reporter, configs[i]->getViaParts().count() == 0);
}
-#if SK_SUPPORT_GPU
REPORTER_ASSERT(reporter, !configs[0]->asConfigGpu());
REPORTER_ASSERT(reporter, !configs[1]->asConfigGpu());
REPORTER_ASSERT(reporter, configs[2]->asConfigGpu());
@@ -197,7 +194,6 @@
REPORTER_ASSERT(reporter, configs[36]->asConfigGpu());
REPORTER_ASSERT(reporter, configs[36]->asConfigGpu()->getSurfType() ==
SkCommandLineConfigGpu::SurfType::kBackendRenderTarget);
-#endif
}
DEF_TEST(ParseConfigs_ExtendedGpuConfigsCorrect, reporter) {
@@ -220,7 +216,6 @@
for (int i = 0; i < config1.count(); ++i) {
REPORTER_ASSERT(reporter, configs[i]->getTag().equals(config1[i]));
}
-#if SK_SUPPORT_GPU
REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getContextType() ==
GrContextFactory::kGL_ContextType);
REPORTER_ASSERT(reporter, configs[0]->asConfigGpu()->getUseNVPR());
@@ -263,7 +258,6 @@
GrContextFactory::kMock_ContextType);
REPORTER_ASSERT(reporter, configs[9]->asConfigGpu()->getSurfType() ==
SkCommandLineConfigGpu::SurfType::kBackendTexture);
-#endif
}
DEF_TEST(ParseConfigs_ExtendedGpuConfigsIncorrect, reporter) {
@@ -290,9 +284,7 @@
for (int i = 0; i < config1.count(); ++i) {
REPORTER_ASSERT(reporter, configs[i]->getTag().equals(config1[i]));
REPORTER_ASSERT(reporter, configs[i]->getBackend().equals(config1[i]));
-#if SK_SUPPORT_GPU
REPORTER_ASSERT(reporter, !configs[i]->asConfigGpu());
-#endif
}
}
@@ -309,16 +301,11 @@
REPORTER_ASSERT(reporter, configs.count() == config1.count());
for (int i = 0; i < config1.count(); ++i) {
REPORTER_ASSERT(reporter, configs[i]->getTag().equals(config1[i]));
-#if SK_SUPPORT_GPU
REPORTER_ASSERT(reporter, configs[i]->getBackend().equals("gpu"));
REPORTER_ASSERT(reporter, configs[i]->asConfigGpu());
-#else
- REPORTER_ASSERT(reporter, configs[i]->getBackend().equals(config1[i]));
-#endif
}
}
-#if SK_SUPPORT_GPU
DEF_TEST(ParseConfigs_ViaParsing, reporter) {
SkCommandLineFlags::StringArray config1 = make_string_array({
"a-b-c-8888",
@@ -349,7 +336,6 @@
}
}
}
-#endif
DEF_TEST(ParseConfigs_ViaParsingExtendedForm, reporter) {
SkCommandLineFlags::StringArray config1 = make_string_array({
@@ -365,13 +351,8 @@
const char* backend;
const char* vias[3];
} expectedConfigs[] = {
-#if SK_SUPPORT_GPU
{"gpu", {"zz", "qq", nullptr}},
{"gpu", {"abc", "nbc", "cbs"}},
-#else
- {"gpu[api=gles]", {"zz", "qq", nullptr}},
- {"gpu[api=angle_d3d9_es2,samples=1]", {"abc", "nbc", "cbs"}},
-#endif
{"gpu[api=gl", {"a", nullptr, nullptr}}, // Missing bracket makes this is not extended
// form but via still works as expected.
{"angle_gl_es2[api=gles]", {"abc", "def", nullptr}} // This is not extended form.
@@ -391,10 +372,8 @@
configs[i]->getViaParts()[j].equals(expectedConfigs[i].vias[j]));
}
}
-#if SK_SUPPORT_GPU
REPORTER_ASSERT(reporter, configs[0]->asConfigGpu());
REPORTER_ASSERT(reporter, configs[1]->asConfigGpu());
REPORTER_ASSERT(reporter, !configs[2]->asConfigGpu());
REPORTER_ASSERT(reporter, !configs[3]->asConfigGpu());
-#endif
}
diff --git a/tests/TestTest.cpp b/tests/TestTest.cpp
index fbec683..ee691f4 100644
--- a/tests/TestTest.cpp
+++ b/tests/TestTest.cpp
@@ -7,11 +7,8 @@
#include "Test.h"
-#if SK_SUPPORT_GPU
#include "GrContext.h"
#include "gl/GLTestContext.h"
-#endif
-
// This is an example of a normal test.
DEF_TEST(TestNormal, reporter) {
@@ -19,35 +16,27 @@
}
// This is an example of a GPU test that uses GrContextOptions to do the test.
-#if SK_SUPPORT_GPU
DEF_GPUTEST(TestGpuFactory, reporter, factory) {
REPORTER_ASSERT(reporter, reporter);
}
-#endif
// This is an example of a GPU test that tests a property that should work for all GPU contexts.
// Note: Some of the contexts might not produce a rendering output.
-#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_ALL_CONTEXTS(TestGpuAllContexts, reporter, ctxInfo) {
REPORTER_ASSERT(reporter, reporter);
REPORTER_ASSERT(reporter, ctxInfo.grContext());
}
-#endif
// This is an example of a GPU test that tests a property that should work for all GPU contexts that
// produce a rendering output.
-#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(TestGpuRenderingContexts, reporter, ctxInfo) {
REPORTER_ASSERT(reporter, reporter);
REPORTER_ASSERT(reporter, ctxInfo.grContext());
}
-#endif
// This is an example of a GPU test that tests a property that uses the null GPU context. It should
// be used if the test tests some behavior that is mocked with the null context.
-#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_NULLGL_CONTEXT(TestGpuNullContext, reporter, ctxInfo) {
REPORTER_ASSERT(reporter, reporter);
REPORTER_ASSERT(reporter, ctxInfo.grContext());
}
-#endif
diff --git a/tests/TestUtils.cpp b/tests/TestUtils.cpp
index 1b146c2..44a78c5 100644
--- a/tests/TestUtils.cpp
+++ b/tests/TestUtils.cpp
@@ -7,8 +7,6 @@
#include "TestUtils.h"
-#if SK_SUPPORT_GPU
-
#include "GrProxyProvider.h"
#include "GrSurfaceContext.h"
#include "GrSurfaceContextPriv.h"
@@ -115,5 +113,3 @@
}
}
}
-
-#endif
diff --git a/tests/TestUtils.h b/tests/TestUtils.h
index fc310be..1fe96bf 100644
--- a/tests/TestUtils.h
+++ b/tests/TestUtils.h
@@ -7,8 +7,6 @@
#include "Test.h"
-#if SK_SUPPORT_GPU
-
class GrSurfaceContext;
class GrSurfaceProxy;
@@ -31,4 +29,3 @@
// Ensure that RGBA 8888 pixels can be copied into 'dstContext'
void test_copy_to_surface(skiatest::Reporter*, GrProxyProvider*,
GrSurfaceContext* dstContext, const char* testName);
-#endif
diff --git a/tests/TextBlobCacheTest.cpp b/tests/TextBlobCacheTest.cpp
index 4d606c9..897ba1d 100644
--- a/tests/TextBlobCacheTest.cpp
+++ b/tests/TextBlobCacheTest.cpp
@@ -23,7 +23,6 @@
#include "Test.h"
-#if SK_SUPPORT_GPU
#include "GrContext.h"
#include "GrContextPriv.h"
#include "GrTest.h"
@@ -163,4 +162,3 @@
DEF_GPUTEST_FOR_NULLGL_CONTEXT(TextBlobStressAbnormal, reporter, ctxInfo) {
text_blob_cache_inner(reporter, ctxInfo.grContext(), 256, 256, 10, false, true);
}
-#endif
diff --git a/tests/TextureProxyTest.cpp b/tests/TextureProxyTest.cpp
index 8727bef..0225f14 100644
--- a/tests/TextureProxyTest.cpp
+++ b/tests/TextureProxyTest.cpp
@@ -9,8 +9,6 @@
#include "Test.h"
-#if SK_SUPPORT_GPU
-
#include "GrBackendSurface.h"
#include "GrContextPriv.h"
#include "GrResourceCache.h"
@@ -303,5 +301,3 @@
invalidation_test(context, reporter);
invalidation_and_instantiation_test(context, reporter);
}
-
-#endif
diff --git a/tests/TextureStripAtlasManagerTest.cpp b/tests/TextureStripAtlasManagerTest.cpp
index d03529f..0511e64 100644
--- a/tests/TextureStripAtlasManagerTest.cpp
+++ b/tests/TextureStripAtlasManagerTest.cpp
@@ -15,9 +15,6 @@
#include "Resources.h"
#include "Test.h"
-#if SK_SUPPORT_GPU // These are all GPU-backend specific tests
-
-
// The gradient shader will use the texture strip atlas if it has too many colors. Make sure
// abandoning the context works.
DEF_GPUTEST_FOR_RENDERING_CONTEXTS(TextureStripAtlasManagerGradientTest, reporter, ctxInfo) {
@@ -72,5 +69,3 @@
context->abandonContext();
}
-
-#endif
diff --git a/tests/TraceMemoryDumpTest.cpp b/tests/TraceMemoryDumpTest.cpp
index 5cae99b..a5ec930 100644
--- a/tests/TraceMemoryDumpTest.cpp
+++ b/tests/TraceMemoryDumpTest.cpp
@@ -9,8 +9,6 @@
#include "Test.h"
-// These tests are currently GPU-speicifc.
-#if SK_SUPPORT_GPU
#include "GrContextPriv.h"
#include "GrRenderTarget.h"
#include "GrTexture.h"
@@ -176,5 +174,3 @@
ValidateMemoryDumps(reporter, context, rt->gpuMemorySize(), false /* isOwned */);
}
-
-#endif
diff --git a/tests/TransferPixelsTest.cpp b/tests/TransferPixelsTest.cpp
index 5ff2386..5bb3094 100755
--- a/tests/TransferPixelsTest.cpp
+++ b/tests/TransferPixelsTest.cpp
@@ -9,8 +9,6 @@
#include "SkTypes.h"
-#if SK_SUPPORT_GPU
-
#include "GrContextFactory.h"
#include "GrContextPriv.h"
#include "GrGpu.h"
@@ -194,5 +192,3 @@
basic_transfer_test(reporter, ctxInfo.grContext(), GrColorType::kBGRA_8888,
kBottomLeft_GrSurfaceOrigin, true);
}
-
-#endif
diff --git a/tests/VkBackendSurfaceTest.cpp b/tests/VkBackendSurfaceTest.cpp
index 3b3a9ce..c5d707b 100644
--- a/tests/VkBackendSurfaceTest.cpp
+++ b/tests/VkBackendSurfaceTest.cpp
@@ -9,7 +9,7 @@
#include "SkTypes.h"
-#if SK_SUPPORT_GPU && defined(SK_VULKAN)
+#if defined(SK_VULKAN)
#include "GrTest.h"
#include "Test.h"
diff --git a/tests/VkMakeCopyPipelineTest.cpp b/tests/VkMakeCopyPipelineTest.cpp
index c8fe6f2..b21a0e6 100644
--- a/tests/VkMakeCopyPipelineTest.cpp
+++ b/tests/VkMakeCopyPipelineTest.cpp
@@ -9,7 +9,7 @@
#include "SkTypes.h"
-#if SK_SUPPORT_GPU && defined(SK_VULKAN)
+#if defined(SK_VULKAN)
#include "GrContextFactory.h"
#include "GrContextPriv.h"
diff --git a/tests/VkUploadPixelsTests.cpp b/tests/VkUploadPixelsTests.cpp
index 27d30bd..bd87d19 100644
--- a/tests/VkUploadPixelsTests.cpp
+++ b/tests/VkUploadPixelsTests.cpp
@@ -9,7 +9,7 @@
#include "SkTypes.h"
-#if SK_SUPPORT_GPU && defined(SK_VULKAN)
+#if defined(SK_VULKAN)
#include "GrContextFactory.h"
#include "GrContextPriv.h"
diff --git a/tests/VkWrapTests.cpp b/tests/VkWrapTests.cpp
index cd0b72e..2bfcd4a 100644
--- a/tests/VkWrapTests.cpp
+++ b/tests/VkWrapTests.cpp
@@ -9,7 +9,7 @@
#include "SkTypes.h"
-#if SK_SUPPORT_GPU && defined(SK_VULKAN)
+#if defined(SK_VULKAN)
#include "GrContextPriv.h"
#include "GrContextFactory.h"
diff --git a/tests/WindowRectanglesTest.cpp b/tests/WindowRectanglesTest.cpp
index ed4e403..2c2531b 100644
--- a/tests/WindowRectanglesTest.cpp
+++ b/tests/WindowRectanglesTest.cpp
@@ -8,8 +8,6 @@
#include "SkTypes.h"
#include "Test.h"
-#if SK_SUPPORT_GPU
-
#include "GrWindowRectangles.h"
#include "SkRandom.h"
#include "SkRectPriv.h"
@@ -74,5 +72,3 @@
GrWindowRectangles::kMaxWindows * sizeof(SkIRect)));
}
}
-
-#endif
diff --git a/tests/WritePixelsTest.cpp b/tests/WritePixelsTest.cpp
index 1f57581..3fe4985 100644
--- a/tests/WritePixelsTest.cpp
+++ b/tests/WritePixelsTest.cpp
@@ -13,14 +13,12 @@
#include "Test.h"
#include "sk_tool_utils.h"
-#if SK_SUPPORT_GPU
#include "GrBackendSurface.h"
#include "GrContext.h"
#include "GrContextPriv.h"
#include "GrGpu.h"
#include "GrProxyProvider.h"
#include "GrTest.h"
-#endif
#include <initializer_list>
@@ -434,7 +432,6 @@
}
}
-#if SK_SUPPORT_GPU
static void test_write_pixels(skiatest::Reporter* reporter, GrContext* context, int sampleCnt) {
const SkImageInfo ii = SkImageInfo::MakeN32Premul(DEV_W, DEV_H);
for (auto& origin : { kTopLeft_GrSurfaceOrigin, kBottomLeft_GrSurfaceOrigin }) {
@@ -572,6 +569,3 @@
REPORTER_ASSERT(reporter, isCorrect);
}
-
-
-#endif
diff --git a/tests/skbug5221.cpp b/tests/skbug5221.cpp
index 356a620..b6989a0 100644
--- a/tests/skbug5221.cpp
+++ b/tests/skbug5221.cpp
@@ -23,11 +23,9 @@
test(surface->getCanvas());
}
-#if SK_SUPPORT_GPU
DEF_GPUTEST_FOR_ALL_CONTEXTS(skbug5221_GPU, r, contextInfo) {
sk_sp<SkSurface> surface(SkSurface::MakeRenderTarget(
contextInfo.grContext(), SkBudgeted::kYes,
SkImageInfo::Make(256, 256, kRGBA_8888_SkColorType, kPremul_SkAlphaType)));
test(surface->getCanvas());
}
-#endif
diff --git a/tests/skbug6653.cpp b/tests/skbug6653.cpp
index dbd288e..0b88a98 100644
--- a/tests/skbug6653.cpp
+++ b/tests/skbug6653.cpp
@@ -10,8 +10,6 @@
#include "SkCanvas.h"
#include "SkSurface.h"
-#if SK_SUPPORT_GPU
-
#include "GrContext.h"
#include "GrTest.h"
#include "Test.h"
@@ -96,5 +94,3 @@
REPORTER_ASSERT(reporter, match);
}
}
-
-#endif
diff --git a/tests/skia_test.cpp b/tests/skia_test.cpp
index 1d90cdc..834585f 100644
--- a/tests/skia_test.cpp
+++ b/tests/skia_test.cpp
@@ -19,12 +19,8 @@
#include "SkTime.h"
#include "Test.h"
-#if SK_SUPPORT_GPU
#include "GrContext.h"
#include "GrContextFactory.h"
-#else
-struct GrContextOptions {};
-#endif
using namespace skiatest;
using namespace sk_gpu_test;
diff --git a/tools/DDLPromiseImageHelper.cpp b/tools/DDLPromiseImageHelper.cpp
index 1eed565..43a2546 100644
--- a/tools/DDLPromiseImageHelper.cpp
+++ b/tools/DDLPromiseImageHelper.cpp
@@ -7,8 +7,6 @@
#include "DDLPromiseImageHelper.h"
-#if SK_SUPPORT_GPU
-
#include "GrContext.h"
#include "GrContextPriv.h"
#include "GrGpu.h"
@@ -177,5 +175,3 @@
SkASSERT(this->isValidID(newID));
return newID;
}
-
-#endif
diff --git a/tools/DDLPromiseImageHelper.h b/tools/DDLPromiseImageHelper.h
index b4b51a4..5bc97af 100644
--- a/tools/DDLPromiseImageHelper.h
+++ b/tools/DDLPromiseImageHelper.h
@@ -11,8 +11,6 @@
#include "SkBitmap.h"
#include "SkTArray.h"
-#if SK_SUPPORT_GPU
-
#include "GrBackendSurface.h"
class GrContext;
@@ -141,4 +139,3 @@
};
#endif
-#endif
diff --git a/tools/DDLTileHelper.cpp b/tools/DDLTileHelper.cpp
index 462915a..3f5482b 100644
--- a/tools/DDLTileHelper.cpp
+++ b/tools/DDLTileHelper.cpp
@@ -7,8 +7,6 @@
#include "DDLTileHelper.h"
-#if SK_SUPPORT_GPU
-
#include "DDLPromiseImageHelper.h"
#include "SkCanvas.h"
#include "SkDeferredDisplayListRecorder.h"
@@ -162,5 +160,3 @@
fTiles[i].reset();
}
}
-
-#endif
diff --git a/tools/DDLTileHelper.h b/tools/DDLTileHelper.h
index fa6f811..669eded 100644
--- a/tools/DDLTileHelper.h
+++ b/tools/DDLTileHelper.h
@@ -12,8 +12,6 @@
#include "SkRefCnt.h"
#include "SkSurfaceCharacterization.h"
-#if SK_SUPPORT_GPU
-
class DDLPromiseImageHelper;
class SkCanvas;
class SkData;
@@ -77,4 +75,3 @@
};
#endif
-#endif
diff --git a/tools/debugger/SkDebugCanvas.cpp b/tools/debugger/SkDebugCanvas.cpp
index d9e9871..8026eed 100644
--- a/tools/debugger/SkDebugCanvas.cpp
+++ b/tools/debugger/SkDebugCanvas.cpp
@@ -14,11 +14,9 @@
#include "SkTextBlob.h"
#include "SkClipOpPriv.h"
-#if SK_SUPPORT_GPU
#include "GrAuditTrail.h"
#include "GrContext.h"
#include "GrRenderTargetContext.h"
-#endif
#define SKDEBUGCANVAS_VERSION 1
#define SKDEBUGCANVAS_ATTRIBUTE_VERSION "version"
@@ -112,17 +110,14 @@
DebugPaintFilterCanvas filterCanvas(originalCanvas, fOverdrawViz);
-#if SK_SUPPORT_GPU
// If we have a GPU backend we can also visualize the op information
GrAuditTrail* at = nullptr;
if (fDrawGpuOpBounds || m != -1) {
// The audit trail must be obtained from the original canvas.
at = this->getAuditTrail(originalCanvas);
}
-#endif
for (int i = 0; i <= index; i++) {
-#if SK_SUPPORT_GPU
// We need to flush any pending operations, or they might combine with commands below.
// Previous operations were not registered with the audit trail when they were
// created, so if we allow them to combine, the audit trail will fail to find them.
@@ -132,16 +127,13 @@
if (at) {
acb = new GrAuditTrail::AutoCollectOps(at, i);
}
-#endif
if (fCommandVector[i]->isVisible()) {
fCommandVector[i]->execute(&filterCanvas);
}
-#if SK_SUPPORT_GPU
if (at && acb) {
delete acb;
}
-#endif
}
if (SkColorGetA(fClipVizColor) != 0) {
@@ -160,7 +152,6 @@
fClip = filterCanvas.getDeviceClipBounds();
filterCanvas.restoreToCount(saveCount);
-#if SK_SUPPORT_GPU
// draw any ops if required and issue a full reset onto GrAuditTrail
if (at) {
// just in case there is global reordering, we flush the canvas before querying
@@ -208,7 +199,6 @@
}
}
}
-#endif
this->cleanupAuditTrail(originalCanvas);
}
@@ -225,17 +215,14 @@
GrAuditTrail* SkDebugCanvas::getAuditTrail(SkCanvas* canvas) {
GrAuditTrail* at = nullptr;
-#if SK_SUPPORT_GPU
GrContext* ctx = canvas->getGrContext();
if (ctx) {
at = ctx->contextPriv().getAuditTrail();
}
-#endif
return at;
}
void SkDebugCanvas::drawAndCollectOps(int n, SkCanvas* canvas) {
-#if SK_SUPPORT_GPU
GrAuditTrail* at = this->getAuditTrail(canvas);
if (at) {
// loop over all of the commands and draw them, this is to collect reordering
@@ -251,16 +238,13 @@
canvas->flush();
}
}
-#endif
}
void SkDebugCanvas::cleanupAuditTrail(SkCanvas* canvas) {
GrAuditTrail* at = this->getAuditTrail(canvas);
if (at) {
-#if SK_SUPPORT_GPU
GrAuditTrail::AutoEnable ae(at);
at->fullReset();
-#endif
}
}
@@ -268,15 +252,12 @@
this->drawAndCollectOps(n, canvas);
// now collect json
-#if SK_SUPPORT_GPU
GrAuditTrail* at = this->getAuditTrail(canvas);
-#endif
Json::Value result = Json::Value(Json::objectValue);
result[SKDEBUGCANVAS_ATTRIBUTE_VERSION] = Json::Value(SKDEBUGCANVAS_VERSION);
Json::Value commands = Json::Value(Json::arrayValue);
for (int i = 0; i < this->getSize() && i <= n; i++) {
commands[i] = this->getDrawCommandAt(i)->toJSON(urlDataManager);
-#if SK_SUPPORT_GPU
if (at) {
// TODO if this is inefficient we could add a method to GrAuditTrail which takes
// a Json::Value and is only compiled in this file
@@ -286,7 +267,6 @@
commands[i][SKDEBUGCANVAS_ATTRIBUTE_AUDITTRAIL] = parsedFromString;
}
-#endif
}
this->cleanupAuditTrail(canvas);
result[SKDEBUGCANVAS_ATTRIBUTE_COMMANDS] = commands;
@@ -297,14 +277,12 @@
this->drawAndCollectOps(n, canvas);
Json::Value parsedFromString;
-#if SK_SUPPORT_GPU
GrAuditTrail* at = this->getAuditTrail(canvas);
if (at) {
GrAuditTrail::AutoManageOpList enable(at);
Json::Reader reader;
SkAssertResult(reader.parse(at->toJson().c_str(), parsedFromString));
}
-#endif
this->cleanupAuditTrail(canvas);
return parsedFromString;
}
diff --git a/tools/flags/SkCommonFlags.cpp b/tools/flags/SkCommonFlags.cpp
index 42a5cde..73b0eb4 100644
--- a/tools/flags/SkCommonFlags.cpp
+++ b/tools/flags/SkCommonFlags.cpp
@@ -150,8 +150,6 @@
return true;
}
-#if SK_SUPPORT_GPU
-
#include "SkCommonFlagsGpu.h"
DEFINE_int32(gpuThreads, 2, "Create this many extra threads to assist with GPU work, "
@@ -175,5 +173,3 @@
ctxOptions->fGpuPathRenderers = CollectGpuPathRenderersFromFlags();
ctxOptions->fDisableDriverCorrectnessWorkarounds = FLAGS_disableDriverCorrectnessWorkarounds;
}
-
-#endif
diff --git a/tools/flags/SkCommonFlagsConfig.cpp b/tools/flags/SkCommonFlagsConfig.cpp
index 7e826c6..ba07ec8 100644
--- a/tools/flags/SkCommonFlagsConfig.cpp
+++ b/tools/flags/SkCommonFlagsConfig.cpp
@@ -11,9 +11,7 @@
#include <stdlib.h>
-#if SK_SUPPORT_GPU
using sk_gpu_test::GrContextFactory;
-#endif
#if defined(SK_BUILD_FOR_ANDROID) || defined(SK_BUILD_FOR_IOS)
# define DEFAULT_GPU_CONFIG "gles"
@@ -35,7 +33,6 @@
const char* backend;
const char* options;
} gPredefinedConfigs[] = {
-#if SK_SUPPORT_GPU
{ "gl", "gpu", "api=gl" },
{ "gles", "gpu", "api=gles" },
{ "glmsaa4", "gpu", "api=gl,samples=4" },
@@ -96,9 +93,6 @@
,{ "mtlmsaa4", "gpu", "api=metal,samples=4" }
,{ "mtlmsaa8", "gpu", "api=metal,samples=8" }
#endif
-#else
- { "", "", "" }
-#endif
};
static const char configHelp[] =
@@ -117,7 +111,6 @@
static const char configExtendedHelp[] =
"Extended form: 'backend(option=value,...)'\n\n"
"Possible backends and options:\n"
-#if SK_SUPPORT_GPU
"\n"
"gpu[api=string,color=string,dit=bool,nvpr=bool,inst=bool,samples=int]\n"
"\tapi\ttype: string\trequired\n"
@@ -171,7 +164,6 @@
"\n"
"Predefined configs:\n\n"
// Help text for pre-defined configs is auto-generated from gPredefinedConfigs
-#endif
;
static const char* config_extended_help_fn() {
@@ -217,7 +209,6 @@
}
return false;
}
-#if SK_SUPPORT_GPU
static bool parse_option_gpu_api(const SkString& value,
SkCommandLineConfigGpu::ContextType* outContextType) {
if (value.equals("gl")) {
@@ -337,7 +328,6 @@
}
return false;
}
-#endif
// Extended options take form --config item[key1=value1,key2=value2,...]
// Example: --config gpu[api=gl,color=8888]
@@ -366,7 +356,6 @@
*outParseSucceeded = true;
}
-#if SK_SUPPORT_GPU
bool get_option_gpu_color(const char* optionKey,
SkColorType* outColorType,
SkAlphaType* alphaType,
@@ -398,7 +387,6 @@
}
return parse_option_gpu_surf_type(*optionValue, outSurfType);
}
-#endif
bool get_option_int(const char* optionKey, int* outInt, bool optional = true) const {
SkString* optionValue = fOptionsMap.find(SkString(optionKey));
@@ -420,7 +408,6 @@
SkTHashMap<SkString, SkString> fOptionsMap;
};
-#if SK_SUPPORT_GPU
SkCommandLineConfigGpu::SkCommandLineConfigGpu(
const SkString& tag, const SkTArray<SkString>& viaParts, ContextType contextType,
bool useNVPR, bool useDIText, int samples, SkColorType colorType, SkAlphaType alphaType,
@@ -499,7 +486,6 @@
colorType, alphaType, colorSpace, useStencils, testThreading,
surfType);
}
-#endif
SkCommandLineConfigSvg::SkCommandLineConfigSvg(const SkString& tag,
const SkTArray<SkString>& viaParts, int pageIndex)
@@ -570,11 +556,9 @@
}
}
SkCommandLineConfig* parsedConfig = nullptr;
-#if SK_SUPPORT_GPU
if (extendedBackend.equals("gpu")) {
parsedConfig = parse_command_line_config_gpu(tag, vias, extendedOptions);
}
-#endif
if (extendedBackend.equals("svg")) {
parsedConfig = parse_command_line_config_svg(tag, vias, extendedOptions);
}
diff --git a/tools/flags/SkCommonFlagsConfig.h b/tools/flags/SkCommonFlagsConfig.h
index 3f1056d..7c097ea 100644
--- a/tools/flags/SkCommonFlagsConfig.h
+++ b/tools/flags/SkCommonFlagsConfig.h
@@ -9,16 +9,11 @@
#define SK_COMMON_FLAGS_CONFIG_H
#include "SkCommandLineFlags.h"
-
-#if SK_SUPPORT_GPU
#include "GrContextFactory.h"
-#endif
DECLARE_string(config);
-#if SK_SUPPORT_GPU
class SkCommandLineConfigGpu;
-#endif
class SkCommandLineConfigSvg;
// SkCommandLineConfig represents a Skia rendering configuration string.
@@ -32,9 +27,7 @@
SkCommandLineConfig(const SkString& tag, const SkString& backend,
const SkTArray<SkString>& viaParts);
virtual ~SkCommandLineConfig();
-#if SK_SUPPORT_GPU
virtual const SkCommandLineConfigGpu* asConfigGpu() const { return nullptr; }
-#endif
virtual const SkCommandLineConfigSvg* asConfigSvg() const { return nullptr; }
const SkString& getTag() const { return fTag; }
const SkString& getBackend() const { return fBackend; }
@@ -45,7 +38,6 @@
SkTArray<SkString> fViaParts;
};
-#if SK_SUPPORT_GPU
// SkCommandLineConfigGpu is a SkCommandLineConfig that extracts information out of the backend
// part of the tag. It is constructed tags that have:
// * backends of form "gpu[option=value,option2=value,...]"
@@ -94,7 +86,6 @@
bool fTestThreading;
SurfType fSurfType;
};
-#endif
// SkCommandLineConfigSvg is a SkCommandLineConfig that extracts information out of the backend
// part of the tag. It is constructed tags that have:
diff --git a/tools/flags/SkCommonFlagsGpu.h b/tools/flags/SkCommonFlagsGpu.h
index 92986e9..23800ec 100644
--- a/tools/flags/SkCommonFlagsGpu.h
+++ b/tools/flags/SkCommonFlagsGpu.h
@@ -8,8 +8,6 @@
#ifndef SK_COMMON_FLAGS_GPU_H
#define SK_COMMON_FLAGS_GPU_H
-#if SK_SUPPORT_GPU
-
#include "GrTypesPriv.h"
#include "SkCommandLineFlags.h"
#include "SkTypes.h"
@@ -67,6 +65,4 @@
*/
void SetCtxOptionsFromCommonFlags(struct GrContextOptions*);
-#endif // SK_SUPPORT_GPU
-
#endif
diff --git a/tools/skiaserve/Request.cpp b/tools/skiaserve/Request.cpp
index 7808638..61f79f1 100644
--- a/tools/skiaserve/Request.cpp
+++ b/tools/skiaserve/Request.cpp
@@ -27,20 +27,14 @@
, fOverdraw(false)
, fColorMode(0) {
// create surface
-#if SK_SUPPORT_GPU
GrContextOptions grContextOpts;
fContextFactory = new GrContextFactory(grContextOpts);
-#else
- fContextFactory = nullptr;
-#endif
}
Request::~Request() {
-#if SK_SUPPORT_GPU
if (fContextFactory) {
delete fContextFactory;
}
-#endif
}
SkBitmap* Request::getBitmapFromCanvas(SkCanvas* canvas) {
@@ -70,7 +64,6 @@
}
SkCanvas* Request::getCanvas() {
-#if SK_SUPPORT_GPU
GrContextFactory* factory = fContextFactory;
GLTestContext* gl = factory->getContextInfo(GrContextFactory::kGL_ContextType,
GrContextFactory::ContextOverrides::kNone).glContext();
@@ -81,7 +74,6 @@
if (gl) {
gl->makeCurrent();
}
-#endif
SkASSERT(fDebugCanvas);
// create the appropriate surface if necessary
@@ -117,7 +109,6 @@
}
GrContext* Request::getContext() {
-#if SK_SUPPORT_GPU
GrContext* result = fContextFactory->get(GrContextFactory::kGL_ContextType,
GrContextFactory::ContextOverrides::kNone);
if (!result) {
@@ -125,9 +116,6 @@
GrContextFactory::ContextOverrides::kNone);
}
return result;
-#else
- return nullptr;
-#endif
}
SkIRect Request::getBounds() {
@@ -135,11 +123,9 @@
if (fPicture) {
bounds = fPicture->cullRect().roundOut();
if (fGPUEnabled) {
-#if SK_SUPPORT_GPU
int maxRTSize = this->getContext()->maxRenderTargetSize();
bounds = SkIRect::MakeWH(SkTMin(bounds.width(), maxRTSize),
SkTMin(bounds.height(), maxRTSize));
-#endif
}
} else {
bounds = SkIRect::MakeWH(kDefaultWidth, kDefaultHeight);
diff --git a/tools/skiaserve/Request.h b/tools/skiaserve/Request.h
index 7f41748..44df83d 100644
--- a/tools/skiaserve/Request.h
+++ b/tools/skiaserve/Request.h
@@ -10,9 +10,7 @@
#include "SkTypes.h"
-#if SK_SUPPORT_GPU
#include "GrContextFactory.h"
-#endif
#include "SkDebugCanvas.h"
#include "SkPicture.h"