aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2018-05-31 14:27:17 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-31 18:59:44 +0000
commitc7ad40f76f6f23b3acd73b53e989220fd71f2da2 (patch)
tree3a2372730179f1bd0dd2486b6e576ec308f1327b /tests
parent8103bb960933359f6536cbfd40d760e54b079e94 (diff)
Remove SK_SUPPORT_GPU checks in tool-only code
Most of this is (obviously) not necessary to do, but once I started, I figured I'd just get it all. Tools (nanobench, DM, skiaserve), all GMs, benches, and unit tests, plus support code (command line parsing and config stuff). This is almost entirely mechanical. Bug: skia: Change-Id: I209500f8df8c5bd43f8298ff26440d1c4d7425fb Reviewed-on: https://skia-review.googlesource.com/131153 Reviewed-by: Mike Klein <mtklein@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/ApplyGammaTest.cpp3
-rw-r--r--tests/BlendTest.cpp4
-rw-r--r--tests/BlurTest.cpp13
-rw-r--r--tests/ClearTest.cpp3
-rw-r--r--tests/ClipBoundsTest.cpp4
-rw-r--r--tests/ClipStackTest.cpp10
-rw-r--r--tests/CopySurfaceTest.cpp2
-rw-r--r--tests/DefaultPathRendererTest.cpp3
-rw-r--r--tests/DeferredDisplayListTest.cpp3
-rw-r--r--tests/DetermineDomainModeTest.cpp3
-rw-r--r--tests/DeviceTest.cpp6
-rw-r--r--tests/DrawOpAtlasTest.cpp4
-rw-r--r--tests/EGLImageTest.cpp3
-rw-r--r--tests/FloatingPointTextureTest.cpp3
-rw-r--r--tests/GLProgramsTest.cpp2
-rw-r--r--tests/GpuDrawPathTest.cpp4
-rw-r--r--tests/GpuLayerCacheTest.cpp3
-rw-r--r--tests/GpuRectanizerTest.cpp4
-rw-r--r--tests/GrAllocatorTest.cpp4
-rw-r--r--tests/GrCCPRTest.cpp4
-rw-r--r--tests/GrContextAbandonTest.cpp4
-rw-r--r--tests/GrContextFactoryTest.cpp4
-rw-r--r--tests/GrGLExtensionsTest.cpp5
-rw-r--r--tests/GrMemoryPoolTest.cpp4
-rw-r--r--tests/GrMeshTest.cpp4
-rw-r--r--tests/GrMipMappedTest.cpp4
-rw-r--r--tests/GrPipelineDynamicStateTest.cpp4
-rw-r--r--tests/GrPorterDuffTest.cpp4
-rw-r--r--tests/GrSKSLPrettyPrintTest.cpp3
-rw-r--r--tests/GrShapeTest.cpp3
-rw-r--r--tests/GrSurfaceTest.cpp3
-rw-r--r--tests/GrTRecorderTest.cpp4
-rw-r--r--tests/GrTextureMipMapInvalidationTest.cpp4
-rw-r--r--tests/ImageFilterCacheTest.cpp2
-rw-r--r--tests/ImageFilterTest.cpp39
-rw-r--r--tests/ImageIsOpaqueTest.cpp6
-rw-r--r--tests/ImageNewShaderTest.cpp6
-rw-r--r--tests/ImageTest.cpp21
-rw-r--r--tests/LazyProxyTest.cpp4
-rw-r--r--tests/OnFlushCallbackTest.cpp4
-rw-r--r--tests/PackedConfigsTextureTest.cpp3
-rw-r--r--tests/PathRendererCacheTests.cpp3
-rw-r--r--tests/PinnedImageTest.cpp4
-rw-r--r--tests/PremulAlphaRoundTripTest.cpp4
-rw-r--r--tests/PrimitiveProcessorTest.cpp2
-rw-r--r--tests/ProcessorTest.cpp2
-rw-r--r--tests/PromiseImageTest.cpp4
-rw-r--r--tests/ProxyConversionTest.cpp2
-rw-r--r--tests/ProxyRefTest.cpp3
-rw-r--r--tests/ProxyTest.cpp4
-rw-r--r--tests/ReadPixelsTest.cpp6
-rw-r--r--tests/ReadWriteAlphaTest.cpp3
-rw-r--r--tests/RectangleTextureTest.cpp3
-rw-r--r--tests/RenderTargetContextTest.cpp2
-rw-r--r--tests/ResourceAllocatorTest.cpp4
-rw-r--r--tests/ResourceCacheTest.cpp4
-rw-r--r--tests/SRGBMipMapTest.cpp2
-rw-r--r--tests/SRGBReadWritePixelsTest.cpp2
-rw-r--r--tests/SkRemoteGlyphCacheTest.cpp10
-rw-r--r--tests/SkSLErrorTest.cpp3
-rw-r--r--tests/SkSLFPTest.cpp4
-rw-r--r--tests/SkSLGLSLTest.cpp4
-rw-r--r--tests/SkSLMemoryLayoutTest.cpp3
-rw-r--r--tests/SkSLSPIRVTest.cpp4
-rw-r--r--tests/SpecialImageTest.cpp10
-rw-r--r--tests/SpecialSurfaceTest.cpp6
-rw-r--r--tests/SurfaceSemaphoreTest.cpp3
-rw-r--r--tests/SurfaceTest.cpp59
-rw-r--r--tests/TessellatingPathRendererTests.cpp2
-rw-r--r--tests/Test.h15
-rw-r--r--tests/TestConfigParsing.cpp21
-rw-r--r--tests/TestTest.cpp11
-rw-r--r--tests/TestUtils.cpp4
-rw-r--r--tests/TestUtils.h3
-rw-r--r--tests/TextBlobCacheTest.cpp2
-rw-r--r--tests/TextureProxyTest.cpp4
-rw-r--r--tests/TextureStripAtlasManagerTest.cpp5
-rw-r--r--tests/TraceMemoryDumpTest.cpp4
-rwxr-xr-xtests/TransferPixelsTest.cpp4
-rw-r--r--tests/VkBackendSurfaceTest.cpp2
-rw-r--r--tests/VkMakeCopyPipelineTest.cpp2
-rw-r--r--tests/VkUploadPixelsTests.cpp2
-rw-r--r--tests/VkWrapTests.cpp2
-rw-r--r--tests/WindowRectanglesTest.cpp4
-rw-r--r--tests/WritePixelsTest.cpp6
-rw-r--r--tests/skbug5221.cpp2
-rw-r--r--tests/skbug6653.cpp4
-rw-r--r--tests/skia_test.cpp4
88 files changed, 20 insertions, 463 deletions
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;