diff options
143 files changed, 38 insertions, 907 deletions
diff --git a/bench/CubicKLMBench.cpp b/bench/CubicKLMBench.cpp index 191e1804aa..8e13a2de00 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 @@ DEF_BENCH( return new CubicKLMBench(285.625f, 499.687f, 411.625f, 808.188f, 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 0628644ab9..5406cea057 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(513.049988f, 245.049988f, 73.750000f, 13 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 55ba3e6af0..b4b05ccd2f 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 @@ private: 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 e151fe519f..e756c13bb4 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(511, 511); ) 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 cc185cf04f..527e0ffde2 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(54); ) 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 a6ee430c61..d8f6cbbc25 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 @@ private: 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 2c87efb414..edbb4de4e9 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, true, true)); 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 b282313d1d..c5ec21d91c 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 @@ DEF_BENCH(return new RectanizerBench(RectanizerBench::kSkyline_RectanizerType, 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 1391b40cf6..2612021510 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 @@ void SKPBench::onDraw(int loops, SkCanvas* canvas) { 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 @@ void SKPBench::drawPicture() { } } -#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 @@ static void draw_pic_for_stats(SkCanvas* canvas, GrContext* context, const SkPic (*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 @@ void SKPBench::getGpuStats(SkCanvas* canvas, SkTArray<SkString>* keys, SkTArray< // 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 8c89ec716c..0376bdbec3 100644 --- a/bench/nanobench.cpp +++ b/bench/nanobench.cpp @@ -60,23 +60,19 @@ extern bool gSkForceRasterPipelineBlitter; #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" - - using sk_gpu_test::ContextInfo; - using sk_gpu_test::GrContextFactory; - using sk_gpu_test::TestContext; - - GrContextOptions grContextOpts; -#endif +#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; - struct GrContextOptions; +GrContextOptions grContextOpts; static const int kAutoTuneLoops = 0; @@ -171,7 +167,6 @@ bool Target::capturePixels(SkBitmap* bmp) { return true; } -#if SK_SUPPORT_GPU struct GPUTarget : public Target { explicit GPUTarget(const Config& c) : Target(c) {} ContextInfo contextInfo; @@ -243,8 +238,6 @@ struct GPUTarget : public Target { } }; -#endif - static double time(int loops, Benchmark* bench, Target* target) { SkCanvas* canvas = target->getCanvas(); if (canvas) { @@ -409,17 +402,10 @@ static int setup_gpu_bench(Target* target, Benchmark* bench, int maxGpuFrameLag) 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 @@ static void create_config(const SkCommandLineConfig* config, SkTArray<Config>* c configs->push_back(target); return; } -#endif #define CPU_CONFIG(name, backend, color, alpha, colorSpace) \ if (config->getTag().equals(#name)) { \ @@ -544,11 +529,9 @@ static Target* is_enabled(Benchmark* bench, const Config& config) { 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 @@ int main(int argc, char** argv) { SkAutoGraphics ag; SkTaskGroup::Enabler enabled(FLAGS_threads); -#if SK_SUPPORT_GPU SetCtxOptionsFromCommonFlags(&grContextOpts); -#endif if (FLAGS_veryVerbose) { FLAGS_verbose = true; @@ -1295,7 +1276,6 @@ int main(int argc, char** argv) { } } -#if SK_SUPPORT_GPU SkTArray<SkString> keys; SkTArray<double> values; bool gpuStatsDump = FLAGS_gpuStatsDump && Benchmark::kGPU_Backend == configs[i].backend; @@ -1303,7 +1283,6 @@ int main(int argc, char** argv) { // TODO cache stats bench->getGpuStats(canvas, &keys, &values); } -#endif bench->perCanvasPostDraw(canvas); @@ -1322,7 +1301,6 @@ int main(int argc, char** argv) { 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 @@ int main(int argc, char** argv) { log->metric(keys[i].c_str(), values[i]); } } -#endif if (runs++ % FLAGS_flushEvery == 0) { log->flush(); @@ -1382,11 +1359,9 @@ int main(int argc, char** argv) { ); } -#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 45882cc043..5b95d59cbf 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 @@ struct Config { 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 { @@ -857,17 +857,8 @@ static void push_sink(const SkCommandLineConfig& config, Sink* s) { 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 @@ static Sink* create_sink(const GrContextOptions& grCtxOptions, const SkCommandLi } } } -#endif if (const SkCommandLineConfigSvg* svgConfig = config->asConfigSvg()) { int pageIndex = svgConfig->getPageIndex(); return new SVGSink(pageIndex); @@ -1273,7 +1263,7 @@ static void gather_tests() { 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 @@ int main(int argc, char** argv) { } 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 1ed00953c1..0000000000 --- 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 ef55c0ab55..abae62806f 100644 --- a/dm/DMGpuTestProcs.cpp +++ b/dm/DMGpuTestProcs.cpp @@ -11,11 +11,8 @@ using sk_gpu_test::GrContextFactory; 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 IsRenderingGLContextType(sk_gpu_test::GrContextFactory::ContextType type) { 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 @@ void RunWithGPUTestContexts(GrContextTestFn* test, GrContextTypeFilterFn* contex ctxInfo.grContext()->flush(); } } -#endif } } // namespace skiatest diff --git a/dm/DMSrcSink.cpp b/dm/DMSrcSink.cpp index e111ecc0f0..5b93de3ed9 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 @@ Error GPUSink::onDraw(const Src& src, SkBitmap* dst, SkWStream*, SkString* log, 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 @@ Error GPUSink::onDraw(const Src& src, SkBitmap* dst, SkWStream*, SkString* log, } break; } -#endif if (!surface) { return "Could not create a surface."; @@ -1552,10 +1548,8 @@ Error GPUSink::onDraw(const Src& src, SkBitmap* dst, SkWStream*, SkString* log, } 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 @@ Error GPUSink::onDraw(const Src& src, SkBitmap* dst, SkWStream*, SkString* log, } else if (FLAGS_releaseAndAbandonGpuContext) { factory.releaseResourcesAndAbandonContexts(); } -#if SK_SUPPORT_GPU if (!context->contextPriv().abandoned()) { surface.reset(); if (backendTexture.isValid()) { @@ -1581,7 +1574,6 @@ Error GPUSink::onDraw(const Src& src, SkBitmap* dst, SkWStream*, SkString* log, context->contextPriv().getGpu()->deleteTestingOnlyBackendRenderTarget(backendRT); } } -#endif return ""; } @@ -1599,11 +1591,7 @@ GPUThreadTestingSink::GPUThreadTestingSink(GrContextFactory::ContextType ct, 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 @@ Error GPUThreadTestingSink::draw(const Src& src, SkBitmap* dst, SkWStream* wStre // 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 @@ Error GPUThreadTestingSink::draw(const Src& src, SkBitmap* dst, SkWStream* wStre 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 @@ Error ViaTiles::draw(const Src& src, SkBitmap* bitmap, SkWStream* stream, SkStri /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ -#if SK_SUPPORT_GPU - ViaDDL::ViaDDL(int numDivisions, Sink* sink) : Via(sink) , fNumDivisions(numDivisions) { @@ -2071,16 +2053,6 @@ Error ViaDDL::draw(const Src& src, SkBitmap* bitmap, SkWStream* stream, SkString }); } -#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 982040469c..9c31c0ab22 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 @@ public: 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 51e8415556..ab9a5fdb5b 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 BezierCubicEffects;) DEF_GM(return new BezierConicEffects;) DEF_GM(return new BezierQuadEffects;) } - -#endif diff --git a/gm/bigrrectaaeffect.cpp b/gm/bigrrectaaeffect.cpp index 6f75344ea7..dee19c5547 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 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 3f3c51e81a..2671b5a4d2 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 @@ DEF_SIMPLE_GM(hugebitmapshader, canvas, 100, 100) { // (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 a8ac05aed6..20469360db 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_horizontal, canvas, 1124, 365, SK_ColorB 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 85d3328428..6dc0ebbfaf 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 @@ protected: } } -#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 2e85714faf..26da988aea 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 @@ private: DEF_GM(return new ConstColorProcessor;) } - -#endif diff --git a/gm/convexpolyeffect.cpp b/gm/convexpolyeffect.cpp index 8942602fb9..fa48e7bb88 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 @@ private: DEF_GM(return new ConvexPolyEffect;) } - -#endif diff --git a/gm/crosscontextimage.cpp b/gm/crosscontextimage.cpp index 19760c45e4..12ef6796ff 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 @@ DEF_SIMPLE_GM(cross_context_image, canvas, 512 * 3 + 60, 512 + 128 + 30) { 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 34c1f9a94e..b420567292 100644 --- a/gm/dftext.cpp +++ b/gm/dftext.cpp @@ -39,7 +39,6 @@ protected: 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 @@ protected: 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 @@ protected: 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 @@ protected: 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 cfa681d984..e9df4afd19 100644 --- a/gm/dftext_blob_persp.cpp +++ b/gm/dftext_blob_persp.cpp @@ -46,7 +46,6 @@ protected: 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 @@ protected: 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 @@ protected: maxH = 0; } } -#if SK_SUPPORT_GPU // render offscreen buffer if (surface) { SkAutoCanvasRestore acr(inputCanvas, true); @@ -96,7 +91,6 @@ protected: inputCanvas->resetMatrix(); inputCanvas->drawImage(surface->makeImageSnapshot().get(), 0, 0, nullptr); } -#endif } private: diff --git a/gm/discard.cpp b/gm/discard.cpp index 8db3a68ab0..7a1e9d9f44 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 @@ private: DEF_GM(return new DiscardGM;) } // end namespace - -#endif diff --git a/gm/flippity.cpp b/gm/flippity.cpp index fb0288b191..853606e245 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 @@ private: }; DEF_GM(return new FlippityGM;) - -#endif diff --git a/gm/fontcache.cpp b/gm/fontcache.cpp index 6c99700d93..c9c8cf7480 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 @@ constexpr SkScalar FontCacheGM::kSize; 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 2c1b8d8458..2592131334 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 @@ protected: 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 11bb902291..eee458360f 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 @@ public: 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 @@ static std::unique_ptr<SkImageGenerator> make_tex_generator(GrContext* ctx, sk_s } return skstd::make_unique<TextureGenerator>(ctx, info, pic); } -#endif class ImageCacheratorGM : public skiagm::GM { SkString fName; @@ -269,7 +265,6 @@ protected: } 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 @@ protected: 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 @@ private: }; 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 a6aa000f1f..8a26a0066e 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 @@ private: DEF_GM(return new ImageFromYUVTextures;) } - -#endif diff --git a/gm/imagemasksubset.cpp b/gm/imagemasksubset.cpp index 9974af35c4..adfea6b8e9 100644 --- a/gm/imagemasksubset.cpp +++ b/gm/imagemasksubset.cpp @@ -53,9 +53,7 @@ const MakerT makers[] = { // 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 400c5df9d1..0952033001 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 @@ private: }; DEF_GM( return new PathMaskCache(); ) - -#endif diff --git a/gm/rectangletexture.cpp b/gm/rectangletexture.cpp index 1ce915bf52..a603be7bdc 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 @@ private: DEF_GM(return new RectangleTexture;) } - -#endif diff --git a/gm/rrects.cpp b/gm/rrects.cpp index d6b52918ef..ff704c82a2 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 @@ protected: 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 @@ protected: 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 @@ protected: } 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::kAA_Draw_Type); ) 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 e43933ce11..21cf9797f5 100644 --- a/gm/srcmode.cpp +++ b/gm/srcmode.cpp @@ -116,11 +116,9 @@ protected: 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 7ada13a3c5..fcb1a598e4 100644 --- a/gm/textblobmixedsizes.cpp +++ b/gm/textblobmixedsizes.cpp @@ -98,7 +98,6 @@ protected: 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 @@ protected: 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 @@ protected: } canvas->restore(); -#if SK_SUPPORT_GPU // render offscreen buffer if (surface) { SkAutoCanvasRestore acr(inputCanvas, true); @@ -172,7 +169,6 @@ protected: inputCanvas->resetMatrix(); inputCanvas->drawImage(surface->makeImageSnapshot().get(), 0, 0, nullptr); } -#endif } private: @@ -189,7 +185,5 @@ private: ////////////////////////////////////////////////////////////////////////////// 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 acde46887d..87dabf6526 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 @@ private: DEF_GM(return new TextBlobRandomFont;) } -#endif diff --git a/gm/textblobuseaftergpufree.cpp b/gm/textblobuseaftergpufree.cpp index b892c7fde1..f09eb1fa11 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 @@ private: DEF_GM(return new TextBlobUseAfterGpuFree;) } -#endif diff --git a/gm/texturedomaineffect.cpp b/gm/texturedomaineffect.cpp index e5e26278e3..e314668d00 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 @@ private: DEF_GM(return new TextureDomainEffect;) } - -#endif diff --git a/gm/windowrectangles.cpp b/gm/windowrectangles.cpp index d03cf6dd28..9e1b64e08d 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 @@ DEF_GM( return new WindowRectanglesGM(); ) //////////////////////////////////////////////////////////////////////////////////////////////////// -#if SK_SUPPORT_GPU - constexpr static int kNumWindows = 8; /** @@ -286,6 +282,4 @@ void WindowRectanglesMaskGM::fail(SkCanvas* canvas) { DEF_GM( return new WindowRectanglesMaskGM(); ) -#endif - } diff --git a/gm/xfermodes3.cpp b/gm/xfermodes3.cpp index e1b1c76248..0d13148956 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 0c69ec0dd5..5efbc3ad4f 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 @@ private: DEF_GM(return new YUVNV12toRGBEffect;) } - -#endif diff --git a/tests/ApplyGammaTest.cpp b/tests/ApplyGammaTest.cpp index d210e9e947..4662de5f85 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ApplyGamma, reporter, ctxInfo) { } } } -#endif diff --git a/tests/BlendTest.cpp b/tests/BlendTest.cpp index 5b2f6faa14..74e6a8f8de 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 @@ DEF_TEST(Blend_byte_multiply, r) { 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 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ES2BlendWithNoTexture, reporter, ctxInfo) backingSurface.reset(); } } -#endif diff --git a/tests/BlurTest.cpp b/tests/BlurTest.cpp index 07cfdcd2b1..2462342032 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 @@ DEF_TEST(BlurSigmaRange, reporter) { #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 @@ DEF_TEST(BlurAsABlur, reporter) { } } -#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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SmallBoxBlurBug, reporter, ctxInfo) { 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 @@ DEF_TEST(BlurZeroSigma, reporter) { /////////////////////////////////////////////////////////////////////////////////////////// -#if SK_SUPPORT_GPU DEF_GPUTEST_FOR_RENDERING_CONTEXTS(BlurMaskBiggerThanDest, reporter, ctxInfo) { GrContext* context = ctxInfo.grContext(); @@ -741,6 +731,3 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(BlurMaskBiggerThanDest, reporter, ctxInfo) { 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 1110fddbd2..703792d1a2 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(FullScreenClearWithLayers, reporter, ctxInfo) fullscreen_clear_with_layer_test(reporter, workaroundFactory.get(ctxInfo.type())); } } - -#endif diff --git a/tests/ClipBoundsTest.cpp b/tests/ClipBoundsTest.cpp index d6169022ff..32b17ad883 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrClipBounds, reporter, ctxInfo) { REPORTER_ASSERT(reporter, intScreen == devGrClipBound); REPORTER_ASSERT(reporter, isIntersectionOfRects); } - -#endif diff --git a/tests/ClipStackTest.cpp b/tests/ClipStackTest.cpp index a716c04239..70d7dcacee 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 @@ static void test_invfill_diff_bug(skiatest::Reporter* reporter) { /////////////////////////////////////////////////////////////////////////////////////////////////// -#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 @@ static void test_tiny_query_bounds_assertion_bug(skiatest::Reporter* reporter) { } } -#endif - DEF_TEST(ClipStack, reporter) { SkClipStack stack; @@ -1478,18 +1473,16 @@ DEF_TEST(ClipStack, reporter) { 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 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(canvas_private_clipRgn, reporter, ctxInfo) { 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 acdc2b9f5d..4921f5bbbe 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(CopySurface, reporter, ctxInfo) { } } } -#endif diff --git a/tests/DefaultPathRendererTest.cpp b/tests/DefaultPathRendererTest.cpp index 8619f5ce32..61778ca30e 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 @@ DEF_GPUTEST_FOR_CONTEXTS(GrDefaultPathRendererTest, run_test(ctx, reporter); } - -#endif diff --git a/tests/DeferredDisplayListTest.cpp b/tests/DeferredDisplayListTest.cpp index f67d3466c6..996e04fa79 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 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(DDLCompatibilityTest, reporter, ctxInfo) { } } - -#endif diff --git a/tests/DetermineDomainModeTest.cpp b/tests/DetermineDomainModeTest.cpp index 4310cbe2fe..c40a957239 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(DetermineDomainModeTest, reporter, ctxInfo) { proxy_test(reporter, context->contextPriv().proxyProvider()); } - -#endif diff --git a/tests/DeviceTest.cpp b/tests/DeviceTest.cpp index 184da92fb7..a9e21e6fa9 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 @@ DEF_TEST(SpecialImage_BitmapDevice, reporter) { #endif -#if SK_SUPPORT_GPU - DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SpecialImage_GPUDevice, reporter, ctxInfo) { GrContext* context = ctxInfo.grContext(); @@ -131,5 +127,3 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SpecialImage_GPUDevice, reporter, ctxInfo) { 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 a2e08362c9..0a5f991e69 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrAtlasTextOpPreparation, reporter, ctxInfo) op->prepare(&flushState); flushState.setOpArgs(nullptr); } - - -#endif diff --git a/tests/EGLImageTest.cpp b/tests/EGLImageTest.cpp index 0b54e814c7..f2c73711e7 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 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(EGLImageTest, reporter, ctxInfo) { cleanup(glCtx0, externalTexture.fID, glCtx1.get(), context1, &backendTexture1, image); } - -#endif diff --git a/tests/FloatingPointTextureTest.cpp b/tests/FloatingPointTextureTest.cpp index dac13a5a70..178392a152 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(HalfFloatRGBATextureTest, reporter, ctxInfo) kMaxIntegerRepresentableInHalfFloatingPoint, HALF_RGBA_CONTROL_ARRAY_SIZE, GrColorType::kRGBA_F16); } - -#endif diff --git a/tests/GLProgramsTest.cpp b/tests/GLProgramsTest.cpp index 3e4ed5f5ce..6910ab5b33 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 79afa63f2d..39e332ff68 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 @@ DEF_GPUTEST(GrPathKeys, reporter, /* options */) { } } } - -#endif diff --git a/tests/GpuLayerCacheTest.cpp b/tests/GpuLayerCacheTest.cpp index 7419f17eb1..b22809c553 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GpuLayerCache, reporter, ctxInfo) { } #endif -#endif diff --git a/tests/GpuRectanizerTest.cpp b/tests/GpuRectanizerTest.cpp index 2ee641e916..5b737fee24 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 @@ DEF_GPUTEST(GpuRectanizer, reporter, factory) { test_skyline(reporter, rects); test_pow2(reporter, rects); } - -#endif diff --git a/tests/GrAllocatorTest.cpp b/tests/GrAllocatorTest.cpp index c02a7ca9af..7c1c1fa876 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 @@ DEF_TEST(GrAllocator, reporter) { check_allocator(allocators[i], 100, 10, reporter); } } - -#endif diff --git a/tests/GrCCPRTest.cpp b/tests/GrCCPRTest.cpp index 8cde797f43..35e3a1fde7 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 @@ class GrCCPRTest_busyPath : public CCPRRenderingTest { } }; DEF_CCPR_RENDERING_TEST(GrCCPRTest_busyPath) - -#endif diff --git a/tests/GrContextAbandonTest.cpp b/tests/GrContextAbandonTest.cpp index 544e121e04..dcd18e2fb7 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 @@ DEF_GPUTEST(GrContext_abandonContext, reporter, options) { } } } - -#endif diff --git a/tests/GrContextFactoryTest.cpp b/tests/GrContextFactoryTest.cpp index d98fe096a4..92801eba83 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 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(GrContextDump, reporter, ctxInfo) { SkString result = ctxInfo.grContext()->contextPriv().dump(); REPORTER_ASSERT(reporter, !result.isEmpty()); } - -#endif diff --git a/tests/GrGLExtensionsTest.cpp b/tests/GrGLExtensionsTest.cpp index 70620764cb..0c780814b1 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 @@ DEF_TEST(GrGLExtensionsTest_remove, reporter) { 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 4eb5ca786f..3df4078db2 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 @@ DEF_TEST(GrObjectMemoryPoolAPI, reporter) { REPORTER_ASSERT(reporter, secondBlockCount == kMinAllocCount); } } - -#endif diff --git a/tests/GrMeshTest.cpp b/tests/GrMeshTest.cpp index d9ffca5084..1cdfe380d8 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 @@ static void run_test(const char* testName, skiatest::Reporter* reporter, } } } - -#endif diff --git a/tests/GrMipMappedTest.cpp b/tests/GrMipMappedTest.cpp index e356779044..5c303633ec 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrImageSnapshotMipMappedTest, reporter, ctxIn } } } - -#endif diff --git a/tests/GrPipelineDynamicStateTest.cpp b/tests/GrPipelineDynamicStateTest.cpp index 4272957ae4..b6ca8f07ce 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrPipelineDynamicStateTest, reporter, ctxInfo } } } - -#endif diff --git a/tests/GrPorterDuffTest.cpp b/tests/GrPorterDuffTest.cpp index cceebbbf5f..2a666a68c7 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 @@ DEF_GPUTEST(PorterDuffNoDualSourceBlending, reporter, options) { } gpu->deleteTestingOnlyBackendTexture(backendTex); } - -#endif diff --git a/tests/GrSKSLPrettyPrintTest.cpp b/tests/GrSKSLPrettyPrintTest.cpp index c0de6c02a8..f0ded45154 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 @@ DEF_TEST(GrSKSLPrettyPrint, r) { ASSERT(GrSKSLPrettyPrint::PrettyPrint(testStr.begin(), lengths.begin(), 1, true).c_str() != nullptr); } - -#endif diff --git a/tests/GrShapeTest.cpp b/tests/GrShapeTest.cpp index a53dad8517..86f007e984 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 @@ DEF_TEST(GrShape_arcs, reporter) { ovalArcWithCenter.compare(reporter, oval, ovalExpectations); } } - -#endif diff --git a/tests/GrSurfaceTest.cpp b/tests/GrSurfaceTest.cpp index 4323ed6045..80d54df05a 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(InitialTextureClear, reporter, context_info) } } } -#endif diff --git a/tests/GrTRecorderTest.cpp b/tests/GrTRecorderTest.cpp index 5041dd9854..a4d9b1fedd 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 @@ DEF_GPUTEST(GrTRecorder, reporter, /* options */) { test_subclasses(reporter); REPORTER_ASSERT(reporter, 0 == activeRecorderItems); // Ensure ~GrTRecorder invokes dtors. } - -#endif diff --git a/tests/GrTextureMipMapInvalidationTest.cpp b/tests/GrTextureMipMapInvalidationTest.cpp index cfb6853806..d832889144 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 @@ DEF_GPUTEST_FOR_NULLGL_CONTEXT(GrTextureMipMapInvalidationTest, reporter, ctxInf REPORTER_ASSERT(reporter, isMipped(surf1.get())); REPORTER_ASSERT(reporter, mipsAreDirty(surf1.get())); } - -#endif diff --git a/tests/ImageFilterCacheTest.cpp b/tests/ImageFilterCacheTest.cpp index f4640d1439..e651b33aa6 100644 --- a/tests/ImageFilterCacheTest.cpp +++ b/tests/ImageFilterCacheTest.cpp @@ -191,7 +191,6 @@ DEF_TEST(ImageFilterCache_ImageBackedRaster, reporter) { test_image_backed(reporter, srcImage); } -#if SK_SUPPORT_GPU #include "GrContext.h" #include "GrContextPriv.h" #include "GrProxyProvider.h" @@ -282,4 +281,3 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageFilterCache_GPUBacked, reporter, ctxInfo test_internal_purge(reporter, fullImg); test_explicit_purging(reporter, fullImg, subsetImg); } -#endif diff --git a/tests/ImageFilterTest.cpp b/tests/ImageFilterTest.cpp index 8e46715fbb..e475ddd59a 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<SkImageFilter> make_blue(sk_sp<SkImageFilter> input, } 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<SkSpecialSurface> create_empty_special_surface(GrContext* context, 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 @@ DEF_TEST(ImageFilterNegativeBlurSigma, reporter) { 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 @@ DEF_TEST(ImageFilterZeroBlurSigma, reporter) { 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 @@ DEF_TEST(ImageFilterFailAffectsTransparentBlack, reporter) { 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 @@ DEF_TEST(ImageFilterMergeResultSize, reporter) { 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 @@ DEF_TEST(ImageFilterMatrixConvolutionBigKernel, reporter) { 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 @@ DEF_TEST(ImageFilterClippedPictureImageFilter, reporter) { 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 @@ DEF_TEST(ComposedImageFilterOffset, reporter) { 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 @@ DEF_TEST(ComposedImageFilterBounds, reporter) { 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 @@ DEF_TEST(ImageFilterPartialCropRect, reporter) { 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 @@ static void test_large_blur_input(skiatest::Reporter* reporter, SkCanvas* canvas 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 @@ DEF_TEST(ImageFilterMakeWithFilter, reporter) { 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 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(ImageFilterBlurLargeImage_Gpu, reporter, ctxInfo) { 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 5bec2b0590..8a2c816050 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 @@ DEF_TEST(ImageIsOpaqueTest, reporter) { 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageIsOpaqueTest_Gpu, reporter, ctxInfo) { check_isopaque(reporter, surfaceOpaque, true); } -#endif - /////////////////////////////////////////////////////////////////////////////////////////////////// #include "SkPictureRecorder.h" diff --git a/tests/ImageNewShaderTest.cpp b/tests/ImageNewShaderTest.cpp index ff80729d7b..092a42227c 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 @@ DEF_TEST(ImageNewShader, reporter) { 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageNewShader_GPU, reporter, ctxInfo) { // RASTER -> GPU raster_to_gpu(reporter, ctxInfo.grContext()); } - -#endif diff --git a/tests/ImageTest.cpp b/tests/ImageTest.cpp index 44e901e3e0..9d0394839e 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 @@ static sk_sp<SkImage> create_data_image() { 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 @@ static sk_sp<SkImage> create_picture_image() { 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 @@ static sk_sp<SkImage> create_codec_image() { 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 @@ DEF_TEST(ImageEncode, reporter) { 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 @@ DEF_TEST(image_newfrombitmap, reporter) { } /////////////////////////////////////////////////////////////////////////////////////////////////// -#if SK_SUPPORT_GPU #include "SkBitmapCache.h" @@ -619,8 +610,6 @@ DEF_GPUTEST(AbandonedContextImage, reporter, options) { } } -#endif - class EmptyGenerator : public SkImageGenerator { public: EmptyGenerator() : SkImageGenerator(SkImageInfo::MakeN32Premul(0, 0)) {} @@ -721,11 +710,9 @@ DEF_TEST(ImageReadPixels, reporter) { 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 @@ DEF_TEST(ImageLegacyBitmap, reporter) { 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 @@ DEF_TEST(ImagePeek, reporter) { 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 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(makeBackendTexture, reporter, ctxInfo) { context->flush(); } } -#endif /////////////////////////////////////////////////////////////////////////////////////////////////// @@ -1346,7 +1327,6 @@ DEF_TEST(ImageScalePixels, reporter) { 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ImageScalePixels_Gpu, reporter, ctxInfo) { 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 dc8232b644..28ba8177c8 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 @@ DEF_GPUTEST(LazyProxyUninstantiateTest, reporter, /* options */) { gpu->deleteTestingOnlyBackendTexture(backendTex); } } - -#endif diff --git a/tests/OnFlushCallbackTest.cpp b/tests/OnFlushCallbackTest.cpp index 706ce7a9d9..e980e9928a 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 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(OnFlushCallbackTest, reporter, ctxInfo) { x += kDrawnTileSize; test_color(reporter, readBack, x, SK_ColorYELLOW); } - -#endif diff --git a/tests/PackedConfigsTextureTest.cpp b/tests/PackedConfigsTextureTest.cpp index adc8a3de7c..047ae44f88 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(RGBA4444TextureTest, reporter, ctxInfo) { 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 f8c95b34a4..0dfe654b8c 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 @@ DEF_GPUTEST(SoftwarePathRendererCacheTest, reporter, /* options */) { test_path(reporter, create_concave_path, createPR, kExpectedResources, GrAAType::kCoverage, style); } - -#endif diff --git a/tests/PinnedImageTest.cpp b/tests/PinnedImageTest.cpp index b5f53fc2ec..00720a59c7 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(PinnedImageTest, reporter, ctxInfo) { basic_test(reporter, ctxInfo.grContext()); cleanup_test(reporter); } - -#endif diff --git a/tests/PremulAlphaRoundTripTest.cpp b/tests/PremulAlphaRoundTripTest.cpp index ba00363a62..bc92bd81ff 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 @@ DEF_TEST(PremulAlphaRoundTrip, reporter) { 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(PremulAlphaRoundTrip_Gpu, reporter, ctxInfo) info)); test_premul_alpha_roundtrip(reporter, surf.get()); } -#endif diff --git a/tests/PrimitiveProcessorTest.cpp b/tests/PrimitiveProcessorTest.cpp index 95855e0401..36709f8694 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 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(VertexAttributeCount, reporter, ctxInfo) { REPORTER_ASSERT(reporter, gpu->stats()->numFailedDraws() == 1); #endif } -#endif diff --git a/tests/ProcessorTest.cpp b/tests/ProcessorTest.cpp index 9cb23ac5c3..b1da1b5419 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 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(ProcessorCloneTest, reporter, ctxInfo) { #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 ef4a299850..365b132261 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(PromiseImageTest, reporter, ctxInfo) { gpu->deleteTestingOnlyBackendTexture(backendTex); } } - -#endif diff --git a/tests/ProxyConversionTest.cpp b/tests/ProxyConversionTest.cpp index 7103403d43..4a95d486c5 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(DefferredProxyConversionTest, reporter, ctxIn REPORTER_ASSERT(reporter, !tProxy->asRenderTargetProxy()); } } -#endif diff --git a/tests/ProxyRefTest.cpp b/tests/ProxyRefTest.cpp index 30cc449c99..6a7dfbdcf0 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ProxyRefTest, reporter, ctxInfo) { } } } - -#endif diff --git a/tests/ProxyTest.cpp b/tests/ProxyTest.cpp index 369cd1c7a6..19e05989ae 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ZeroSizedProxyTest, reporter, ctxInfo) { } } } - -#endif diff --git a/tests/ReadPixelsTest.cpp b/tests/ReadPixelsTest.cpp index 867f766d17..12a567fd8a 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 @@ DEF_TEST(ReadPixels, reporter) { // 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ReadPixels_Gpu, reporter, ctxInfo) { } } } -#endif -#if SK_SUPPORT_GPU static void test_readpixels_texture(skiatest::Reporter* reporter, sk_sp<GrSurfaceContext> sContext, const SkImageInfo& surfaceInfo) { @@ -556,7 +551,6 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ReadPixels_Texture, reporter, ctxInfo) { } } } -#endif /////////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/tests/ReadWriteAlphaTest.cpp b/tests/ReadWriteAlphaTest.cpp index b82c48fd5d..0dc1fc090c 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ReadWriteAlpha, reporter, ctxInfo) { } } } - -#endif diff --git a/tests/RectangleTextureTest.cpp b/tests/RectangleTextureTest.cpp index 04ced776ae..3516acf339 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 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(RectangleTexture, reporter, ctxInfo) { GR_GL_CALL(glContext->gl(), DeleteTextures(1, &rectTexID)); } } - -#endif diff --git a/tests/RenderTargetContextTest.cpp b/tests/RenderTargetContextTest.cpp index 07c6fe16ed..c93a6080eb 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(RenderTargetContextTest, reporter, ctxInfo) { // GrRenderTargetContext } #endif -#endif diff --git a/tests/ResourceAllocatorTest.cpp b/tests/ResourceAllocatorTest.cpp index e4df621253..51ecdb7ed0 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(ResourceAllocatorTest, reporter, ctxInfo) { resourceProvider->testingOnly_setExplicitlyAllocateGPUResources(orig); } - -#endif diff --git a/tests/ResourceCacheTest.cpp b/tests/ResourceCacheTest.cpp index 857286ab6c..aee64842a9 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GPUMemorySize, reporter, ctxInfo) { REPORTER_ASSERT(reporter, kSize*kSize*4+(kSize*kSize*4)/3 == size); } } - -#endif diff --git a/tests/SRGBMipMapTest.cpp b/tests/SRGBMipMapTest.cpp index 2da7102658..ac7b5cc0b7 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 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SRGBMipMaps, reporter, ctxInfo) { 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 d090237b2d..9c56de0c9c 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SRGBReadWritePixels, reporter, ctxInfo) { 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 7370bdafdb..235d4ca567 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 @@ sk_sp<SkTextBlob> buildTextBlob(sk_sp<SkTypeface> tf, int glyphCount) { } \ } -#if SK_SUPPORT_GPU SkTextBlobCacheDiffCanvas::Settings MakeSettings(GrContext* context) { SkTextBlobCacheDiffCanvas::Settings settings; settings.fContextSupportsDistanceFieldText = context->supportsDistanceFieldText(); @@ -105,7 +102,6 @@ SkBitmap RasterBlob(sk_sp<SkTextBlob> blob, int width, int height, const SkPaint 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 @@ DEF_TEST(SkRemoteGlyphCache_TypefaceSerialization, reporter) { 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SkRemoteGlyphCache_StrikeSerialization, repor // 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 @@ DEF_TEST(SkRemoteGlyphCache_ClientMemoryAccounting, reporter) { 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SkRemoteGlyphCache_DrawTextAsPath, reporter, // 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SkRemoteGlyphCache_CacheMissReporting, report // 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 c24a25d832..432f35bff5 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 @@ DEF_TEST(SkSLDuplicateOutput, r) { "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 03b3922ec2..4208246938 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 @@ DEF_TEST(SkSLFPChildProcessors, r) { "this->registerChildProcessor(src.childProcessor(1).clone());" }); } - -#endif diff --git a/tests/SkSLGLSLTest.cpp b/tests/SkSLGLSLTest.cpp index fe30ef49fd..c3577e0c3c 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 @@ DEF_TEST(SkSLFrExp, r) { " sk_FragColor = vec4(float(exp));\n" "}\n"); } - -#endif diff --git a/tests/SkSLMemoryLayoutTest.cpp b/tests/SkSLMemoryLayoutTest.cpp index ef1383573e..f4df89ea2c 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 @@ DEF_TEST(SkSLMemoryLayout430Test, r) { 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 f688d50baa..d7c7ac948f 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 @@ DEF_TEST(SkSLBadOffset, r) { "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 719a3afec6..b2f8743b0e 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 @@ static void test_image(const sk_sp<SkSpecialImage>& img, skiatest::Reporter* rep // 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 @@ static void test_image(const sk_sp<SkSpecialImage>& img, skiatest::Reporter* rep 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 @@ static void test_image(const sk_sp<SkSpecialImage>& img, skiatest::Reporter* rep SkPixmap tmpPixmap; REPORTER_ASSERT(reporter, isGPUBacked != !!tightSurf->peekPixels(&tmpPixmap)); } -#endif } DEF_TEST(SpecialImage_Raster, reporter) { @@ -196,8 +190,6 @@ DEF_TEST(SpecialImage_Image_ColorSpaceAware, reporter) { 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SpecialImage_DeferredGpu, reporter, ctxInfo) test_image(subSImg2, reporter, context, true, kPad, kFullSize); } } - -#endif diff --git a/tests/SpecialSurfaceTest.cpp b/tests/SpecialSurfaceTest.cpp index 3c6de0a1a1..7b3896be5f 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 @@ DEF_TEST(SpecialSurface_Raster2, reporter) { // 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SpecialSurface_Gpu1, reporter, ctxInfo) { test_surface(surf, reporter, 0); } } - -#endif diff --git a/tests/SurfaceSemaphoreTest.cpp b/tests/SurfaceSemaphoreTest.cpp index b3a030e7c9..6e8863f3b8 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(EmptySurfaceSemaphoreTest, reporter, ctxInfo) } #endif } - -#endif diff --git a/tests/SurfaceTest.cpp b/tests/SurfaceTest.cpp index 965298a816..bb5291cbb3 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 @@ static sk_sp<SkSurface> create_direct_surface(SkAlphaType at = kPremul_SkAlphaTy 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 @@ static sk_sp<SkSurface> create_gpu_scratch_surface(GrContext* context, } 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 @@ DEF_TEST(SurfaceEmpty, reporter) { 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrContext_maxSurfaceSamplesForColorType, repo 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 @@ DEF_TEST(SurfaceCanvasPeek, reporter) { 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceCanvasPeek_Gpu, reporter, ctxInfo) { 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 @@ DEF_TEST(SurfaceSnapshotAlphaType, reporter) { } } } -#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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceBackendSurfaceAccessCopyOnWrite_Gpu, r } } } -#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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceBackendHandleAccessIDs_Gpu, reporter, } } } -#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 @@ static void test_copy_on_write(skiatest::Reporter* reporter, SkSurface* surface) 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 @@ static void test_writable_after_snapshot_release(skiatest::Reporter* reporter, 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceCRBug263329_Gpu, reporter, ctxInfo) { test_crbug263329(reporter, surface1.get(), surface2.get()); } } -#endif DEF_TEST(SurfaceGetTexture, reporter) { auto surface(create_surface()); @@ -534,7 +512,6 @@ DEF_TEST(SurfaceGetTexture, reporter) { 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfacepeekTexture_Gpu, reporter, ctxInfo) { 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceBudget, reporter, ctxInfo) { REPORTER_ASSERT(reporter, budgeted == is_budgeted(image)); } } -#endif static void test_no_canvas1(skiatest::Reporter* reporter, SkSurface* surface, @@ -627,7 +600,6 @@ DEF_TEST(SurfaceNoCanvas, reporter) { } } } -#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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceNoCanvas_Gpu, reporter, ctxInfo) { } } } -#endif static void check_rowbytes_remain_consistent(SkSurface* surface, skiatest::Reporter* reporter) { SkPixmap surfacePM; @@ -691,7 +662,6 @@ DEF_TEST(surface_raster_zeroinitialized, reporter) { } } -#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 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SurfaceAttachStencil_Gpu, reporter, ctxInf } } } -#endif static void test_surface_creation_and_snapshot_with_color_space( skiatest::Reporter* reporter, @@ -991,7 +960,6 @@ DEF_TEST(SurfaceCreationWithColorSpace, reporter) { surfaceMaker); } -#if SK_SUPPORT_GPU DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceCreationWithColorSpace_Gpu, reporter, ctxInfo) { auto context = ctxInfo.grContext(); @@ -1039,7 +1007,6 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(SurfaceCreationWithColorSpace_Gpu, reporter, gpu->deleteTestingOnlyBackendTexture(backendTex); } } -#endif static void test_overdraw_surface(skiatest::Reporter* r, SkSurface* surface) { SkOverdrawCanvas canvas(surface->getCanvas()); @@ -1060,13 +1027,11 @@ DEF_TEST(OverdrawSurface_Raster, r) { 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 086d2e546c..6e5d12eee6 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 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(TessellatingPathRendererTests, reporter, ctxInfo) { 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 f74b98aa9c..97604a2c72 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 @@ typedef sk_tools::Registry<Test> TestRegistry; } */ -#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 df028153e2..c5f620f748 100644 --- a/tests/TestConfigParsing.cpp +++ b/tests/TestConfigParsing.cpp @@ -39,7 +39,6 @@ DEF_TEST(ParseConfigs_Gpu, reporter) { 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 @@ DEF_TEST(ParseConfigs_Gpu, reporter) { 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 @@ DEF_TEST(ParseConfigs_DefaultConfigs, reporter) { 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 @@ DEF_TEST(ParseConfigs_DefaultConfigs, reporter) { 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 @@ DEF_TEST(ParseConfigs_ExtendedGpuConfigsCorrect, reporter) { 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 @@ DEF_TEST(ParseConfigs_ExtendedGpuConfigsCorrect, reporter) { GrContextFactory::kMock_ContextType); REPORTER_ASSERT(reporter, configs[9]->asConfigGpu()->getSurfType() == SkCommandLineConfigGpu::SurfType::kBackendTexture); -#endif } DEF_TEST(ParseConfigs_ExtendedGpuConfigsIncorrect, reporter) { @@ -290,9 +284,7 @@ DEF_TEST(ParseConfigs_ExtendedGpuConfigsIncorrect, reporter) { 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 @@ DEF_TEST(ParseConfigs_ExtendedGpuConfigsSurprises, reporter) { 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 @@ DEF_TEST(ParseConfigs_ViaParsing, reporter) { } } } -#endif DEF_TEST(ParseConfigs_ViaParsingExtendedForm, reporter) { SkCommandLineFlags::StringArray config1 = make_string_array({ @@ -365,13 +351,8 @@ DEF_TEST(ParseConfigs_ViaParsingExtendedForm, reporter) { 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 @@ DEF_TEST(ParseConfigs_ViaParsingExtendedForm, reporter) { 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 fbec68340a..ee691f4a63 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 @@ DEF_TEST(TestNormal, reporter) { } // 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 1b146c2cca..44a78c51fb 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 @@ void test_copy_to_surface(skiatest::Reporter* reporter, GrProxyProvider* proxyPr } } } - -#endif diff --git a/tests/TestUtils.h b/tests/TestUtils.h index fc310be2c8..1fe96bff7c 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 @@ void test_copy_from_surface(skiatest::Reporter*, GrContext*, // 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 4d606c9550..897ba1d631 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(TextBlobAbnormal, reporter, ctxInfo) { 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 8727bef51e..0225f14cbc 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(TextureProxyTest, reporter, ctxInfo) { invalidation_test(context, reporter); invalidation_and_instantiation_test(context, reporter); } - -#endif diff --git a/tests/TextureStripAtlasManagerTest.cpp b/tests/TextureStripAtlasManagerTest.cpp index d03529f120..0511e644b5 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(TextureStripAtlasManagerColorFilterTest, repo context->abandonContext(); } - -#endif diff --git a/tests/TraceMemoryDumpTest.cpp b/tests/TraceMemoryDumpTest.cpp index 5cae99bca6..a5ec930f45 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 @@ DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(SkTraceMemoryDump_unownedGLRenderTarget, r ValidateMemoryDumps(reporter, context, rt->gpuMemorySize(), false /* isOwned */); } - -#endif diff --git a/tests/TransferPixelsTest.cpp b/tests/TransferPixelsTest.cpp index 5ff2386b01..5bb309494e 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(TransferPixelsTest, reporter, ctxInfo) { basic_transfer_test(reporter, ctxInfo.grContext(), GrColorType::kBGRA_8888, kBottomLeft_GrSurfaceOrigin, true); } - -#endif diff --git a/tests/VkBackendSurfaceTest.cpp b/tests/VkBackendSurfaceTest.cpp index 3b3a9cec14..c5d707b662 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 c8fe6f2a70..b21a0e60ce 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 27d30bda65..bd87d19cd1 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 cd0b72e0fe..2bfcd4abd6 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 ed4e4039ec..2c2531bc07 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 @@ DEF_TEST(WindowRectangles, reporter) { GrWindowRectangles::kMaxWindows * sizeof(SkIRect))); } } - -#endif diff --git a/tests/WritePixelsTest.cpp b/tests/WritePixelsTest.cpp index 1f5758184f..3fe498508b 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 @@ DEF_TEST(WritePixels, reporter) { } } -#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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(WritePixelsPendingIO, reporter, ctxInfo) { REPORTER_ASSERT(reporter, isCorrect); } - - -#endif diff --git a/tests/skbug5221.cpp b/tests/skbug5221.cpp index 356a62020b..b6989a0149 100644 --- a/tests/skbug5221.cpp +++ b/tests/skbug5221.cpp @@ -23,11 +23,9 @@ DEF_TEST(skbug5221, r) { 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 dbd288eb1b..0b88a98e42 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 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(skbug6653, reporter, ctxInfo) { REPORTER_ASSERT(reporter, match); } } - -#endif diff --git a/tests/skia_test.cpp b/tests/skia_test.cpp index 1d90cdc066..834585f024 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 1eed565331..43a2546f0e 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 @@ int DDLPromiseImageHelper::findOrDefineImage(SkImage* image) { SkASSERT(this->isValidID(newID)); return newID; } - -#endif diff --git a/tools/DDLPromiseImageHelper.h b/tools/DDLPromiseImageHelper.h index b4b51a4f5b..5bc97afc34 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 @@ private: }; #endif -#endif diff --git a/tools/DDLTileHelper.cpp b/tools/DDLTileHelper.cpp index 462915aafc..3f5482bc99 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 @@ void DDLTileHelper::resetAllTiles() { fTiles[i].reset(); } } - -#endif diff --git a/tools/DDLTileHelper.h b/tools/DDLTileHelper.h index fa6f8115bc..669eded484 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 @@ private: }; #endif -#endif diff --git a/tools/debugger/SkDebugCanvas.cpp b/tools/debugger/SkDebugCanvas.cpp index d9e9871942..8026eed479 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 @@ void SkDebugCanvas::drawTo(SkCanvas* originalCanvas, int index, int m) { 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 @@ void SkDebugCanvas::drawTo(SkCanvas* originalCanvas, int index, int m) { 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 @@ void SkDebugCanvas::drawTo(SkCanvas* originalCanvas, int index, int m) { 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 @@ void SkDebugCanvas::drawTo(SkCanvas* originalCanvas, int index, int m) { } } } -#endif this->cleanupAuditTrail(originalCanvas); } @@ -225,17 +215,14 @@ SkDrawCommand* SkDebugCanvas::getDrawCommandAt(int index) { 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 @@ void SkDebugCanvas::drawAndCollectOps(int n, SkCanvas* canvas) { 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 @@ Json::Value SkDebugCanvas::toJSON(UrlDataManager& urlDataManager, int n, SkCanva 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 @@ Json::Value SkDebugCanvas::toJSON(UrlDataManager& urlDataManager, int n, SkCanva commands[i][SKDEBUGCANVAS_ATTRIBUTE_AUDITTRAIL] = parsedFromString; } -#endif } this->cleanupAuditTrail(canvas); result[SKDEBUGCANVAS_ATTRIBUTE_COMMANDS] = commands; @@ -297,14 +277,12 @@ Json::Value SkDebugCanvas::toJSONOpList(int n, SkCanvas* canvas) { 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 42a5cdee7c..73b0eb4f12 100644 --- a/tools/flags/SkCommonFlags.cpp +++ b/tools/flags/SkCommonFlags.cpp @@ -150,8 +150,6 @@ bool CollectImages(SkCommandLineFlags::StringArray images, SkTArray<SkString>* o 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 @@ void SetCtxOptionsFromCommonFlags(GrContextOptions* ctxOptions) { ctxOptions->fGpuPathRenderers = CollectGpuPathRenderersFromFlags(); ctxOptions->fDisableDriverCorrectnessWorkarounds = FLAGS_disableDriverCorrectnessWorkarounds; } - -#endif diff --git a/tools/flags/SkCommonFlagsConfig.cpp b/tools/flags/SkCommonFlagsConfig.cpp index 7e826c6f61..ba07ec84c7 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 @@ static const struct { 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 @@ static const struct { ,{ "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* config_help_fn() { 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 @@ static const char configExtendedHelp[] = "\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 @@ static bool parse_option_bool(const SkString& value, bool* outBool) { } 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 @@ static bool parse_option_gpu_surf_type(const SkString& value, } return false; } -#endif // Extended options take form --config item[key1=value1,key2=value2,...] // Example: --config gpu[api=gl,color=8888] @@ -366,7 +356,6 @@ public: *outParseSucceeded = true; } -#if SK_SUPPORT_GPU bool get_option_gpu_color(const char* optionKey, SkColorType* outColorType, SkAlphaType* alphaType, @@ -398,7 +387,6 @@ public: } 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 @@ private: 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 @@ SkCommandLineConfigGpu* parse_command_line_config_gpu(const SkString& tag, colorType, alphaType, colorSpace, useStencils, testThreading, surfType); } -#endif SkCommandLineConfigSvg::SkCommandLineConfigSvg(const SkString& tag, const SkTArray<SkString>& viaParts, int pageIndex) @@ -570,11 +556,9 @@ void ParseConfigs(const SkCommandLineFlags::StringArray& configs, } } 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 3f1056d113..7c097ea888 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 @@ class SkCommandLineConfig { 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 @@ class SkCommandLineConfig { 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 @@ private: 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 92986e9c3e..23800ec911 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 @@ inline GpuPathRenderers CollectGpuPathRenderersFromFlags() { */ void SetCtxOptionsFromCommonFlags(struct GrContextOptions*); -#endif // SK_SUPPORT_GPU - #endif diff --git a/tools/skiaserve/Request.cpp b/tools/skiaserve/Request.cpp index 7808638c3b..61f79f1389 100644 --- a/tools/skiaserve/Request.cpp +++ b/tools/skiaserve/Request.cpp @@ -27,20 +27,14 @@ Request::Request(SkString rootUrl) , 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 @@ sk_sp<SkData> Request::writeCanvasToPng(SkCanvas* canvas) { } 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 @@ SkCanvas* Request::getCanvas() { if (gl) { gl->makeCurrent(); } -#endif SkASSERT(fDebugCanvas); // create the appropriate surface if necessary @@ -117,7 +109,6 @@ sk_sp<SkData> Request::writeOutSkp() { } GrContext* Request::getContext() { -#if SK_SUPPORT_GPU GrContext* result = fContextFactory->get(GrContextFactory::kGL_ContextType, GrContextFactory::ContextOverrides::kNone); if (!result) { @@ -125,9 +116,6 @@ GrContext* Request::getContext() { GrContextFactory::ContextOverrides::kNone); } return result; -#else - return nullptr; -#endif } SkIRect Request::getBounds() { @@ -135,11 +123,9 @@ SkIRect Request::getBounds() { 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 7f41748c02..44df83d466 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" |