diff options
author | Mike Klein <mtklein@google.com> | 2018-05-22 12:23:12 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-05-22 12:23:15 +0000 |
commit | edf8449d2c3663350b6b6e30d2fa4c70da02deef (patch) | |
tree | 27c3c1db61a355bd64f7118e7653d741588d2b31 | |
parent | 8afa554414b3fed2cd970249946e3986473b5580 (diff) |
Revert "IWYU for tests starting with 'D'."
This reverts commit b5f2897ab5be37e86ccce4ed474a2e02001a9040.
Reason for revert: looks like this broke the build for DM in Google3. Need more include dirs there?
Original change's description:
> IWYU for tests starting with 'D'.
>
> Change-Id: I9189e4b56ce1635b627119733447c2ed4220753d
> Reviewed-on: https://skia-review.googlesource.com/129319
> Reviewed-by: Herb Derby <herb@google.com>
> Commit-Queue: Ben Wagner <bungeman@google.com>
TBR=bsalomon@google.com,bungeman@google.com,herb@google.com
Change-Id: I01aac7dae6114685a0652cbde3defccc8a42caea
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/129443
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
-rw-r--r-- | gn/tests.gni | 1 | ||||
-rw-r--r-- | include/gpu/vk/GrVkDefines.h | 4 | ||||
-rw-r--r-- | platform_tools/android/vulkan/Skia_Vulkan_Android.h | 4 | ||||
-rw-r--r-- | tests/DFPathRendererTest.cpp | 84 | ||||
-rw-r--r-- | tests/DashPathEffectTest.cpp | 16 | ||||
-rw-r--r-- | tests/DataRefTest.cpp | 16 | ||||
-rw-r--r-- | tests/DefaultPathRendererTest.cpp | 23 | ||||
-rw-r--r-- | tests/DeferredDisplayListTest.cpp | 24 | ||||
-rw-r--r-- | tests/DetermineDomainModeTest.cpp | 14 | ||||
-rw-r--r-- | tests/DeviceTest.cpp | 14 | ||||
-rw-r--r-- | tests/DiscardableMemoryPoolTest.cpp | 6 | ||||
-rw-r--r-- | tests/DiscardableMemoryTest.cpp | 6 | ||||
-rw-r--r-- | tests/DrawBitmapRectTest.cpp | 11 | ||||
-rw-r--r-- | tests/DrawFilterTest.cpp | 2 | ||||
-rw-r--r-- | tests/DrawOpAtlasTest.cpp | 41 | ||||
-rw-r--r-- | tests/DrawPathTest.cpp | 12 | ||||
-rw-r--r-- | tests/DrawTextTest.cpp | 2 | ||||
-rw-r--r-- | tests/DynamicHashTest.cpp | 3 | ||||
-rw-r--r-- | tools/gpu/vk/GrVulkanDefines.h | 4 |
19 files changed, 129 insertions, 158 deletions
diff --git a/gn/tests.gni b/gn/tests.gni index 4eef06e20f..19017c45e6 100644 --- a/gn/tests.gni +++ b/gn/tests.gni @@ -55,6 +55,7 @@ tests_sources = [ "$_tests/DequeTest.cpp", "$_tests/DetermineDomainModeTest.cpp", "$_tests/DeviceTest.cpp", + "$_tests/DFPathRendererTest.cpp", "$_tests/DiscardableMemoryPoolTest.cpp", "$_tests/DiscardableMemoryTest.cpp", "$_tests/DrawBitmapRectTest.cpp", diff --git a/include/gpu/vk/GrVkDefines.h b/include/gpu/vk/GrVkDefines.h index d17300a550..8f697c02b4 100644 --- a/include/gpu/vk/GrVkDefines.h +++ b/include/gpu/vk/GrVkDefines.h @@ -12,7 +12,7 @@ #ifdef SK_VULKAN #ifdef SK_VULKAN_HEADER -#include SK_VULKAN_HEADER // IWYU pragma: export +#include SK_VULKAN_HEADER #else // This is deprecated and all clients should define their own custum header shim that sets up // defines and includes the vulkan.h header. Then they should define SK_VULKAN_HEADER or set the @@ -43,7 +43,7 @@ # define VK_NO_PROTOTYPES # endif -# include <vulkan/vulkan.h> // IWYU pragma: export +# include <vulkan/vulkan.h> #endif // SK_VULKAN_HEADER #define SKIA_REQUIRED_VULKAN_HEADER_VERSION 17 diff --git a/platform_tools/android/vulkan/Skia_Vulkan_Android.h b/platform_tools/android/vulkan/Skia_Vulkan_Android.h index 65ff4aa582..b0749810f0 100644 --- a/platform_tools/android/vulkan/Skia_Vulkan_Android.h +++ b/platform_tools/android/vulkan/Skia_Vulkan_Android.h @@ -8,8 +8,6 @@ #ifndef Skia_Vulkan_Android_DEFINED #define Skia_Vulkan_Android_DEFINED -#include "SkTypes.h" - #if !defined(SK_BUILD_FOR_ANDROID) #error "Must be building for android to use this header" #endif @@ -17,7 +15,7 @@ # define VK_USE_PLATFORM_ANDROID_KHR #endif -#include <vulkan/vulkan.h> // IWYU pragma: export +#include <vulkan/vulkan.h> #endif diff --git a/tests/DFPathRendererTest.cpp b/tests/DFPathRendererTest.cpp new file mode 100644 index 0000000000..653db822f9 --- /dev/null +++ b/tests/DFPathRendererTest.cpp @@ -0,0 +1,84 @@ +/* + * Copyright 2016 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +#include "Test.h" + +#include "SkPath.h" + +#if SK_SUPPORT_GPU +#include "GrContext.h" +#include "ops/GrSmallPathRenderer.h" + +#if 0 +// This test case including path coords and matrix taken from crbug.com/627443. +// Because of inaccuracies in large floating point values this causes the +// the path renderer to attempt to add a path DF to its atlas that is larger +// than the plot size which used to crash rather than fail gracefully. +static void test_far_from_origin(GrContext* ctx, GrRenderTargetContext* renderTargetContext, + GrPathRenderer* pr) { + SkPath path; + path.lineTo(49.0255089839f, 0.473541f); + // This extra line wasn't in the original bug but was added to fake out GrShape's special + // handling of single line segments. + path.rLineTo(0.015f, 0.015f); + static constexpr SkScalar mvals[] = {14.0348252854f, 2.13026182736f, + 13.6122547187f, 118.309922702f, + 1912337682.09f, 2105391889.87f}; + SkMatrix matrix; + matrix.setAffine(mvals); + SkMatrix inverse; + SkAssertResult(matrix.invert(&inverse)); + path.transform(inverse); + + SkStrokeRec rec(SkStrokeRec::kFill_InitStyle); + rec.setStrokeStyle(1.f); + rec.setStrokeParams(SkPaint::kRound_Cap, SkPaint::kRound_Join, 1.f); + GrStyle style(rec, nullptr); + + GrShape shape(path, style); + shape = shape.applyStyle(GrStyle::Apply::kPathEffectAndStrokeRec, 1.f); + + GrPaint paint; + paint.setXPFactory(GrPorterDuffXPFactory::Get(SkBlendMode::kSrc)); + + GrNoClip noClip; + GrPathRenderer::DrawPathArgs args{ctx, + std::move(paint), + &GrUserStencilSettings::kUnused, + renderTargetContext, + &noClip, + &matrix, + &shape, + GrAAType::kCoverage, + false}; + pr->drawPath(args); +} + +DEF_GPUTEST_FOR_ALL_GL_CONTEXTS(SmallPathRenderer, reporter, ctxInfo) { + GrContext* ctx = ctxInfo.grContext(); + // The DF PR only works with contexts that support derivatives + if (!ctx->caps()->shaderCaps()->shaderDerivativeSupport()) { + return; + } + sk_sp<GrRenderTargetContext> rtc(ctx->makeRenderTargetContext(SkBackingFit::kApprox, + 800, 800, + kRGBA_8888_GrPixelConfig, + nullptr, + 0, + kTopLeft_GrSurfaceOrigin)); + if (!rtc) { + return; + } + + GrSmallPathRenderer spr; + + ctx->flush(); + test_far_from_origin(ctx, rtc.get(), &spr); + ctx->flush(); +} +#endif +#endif diff --git a/tests/DashPathEffectTest.cpp b/tests/DashPathEffectTest.cpp index f165207a4b..e3a380411d 100644 --- a/tests/DashPathEffectTest.cpp +++ b/tests/DashPathEffectTest.cpp @@ -5,21 +5,13 @@ * found in the LICENSE file. */ -#include "SkCanvas.h" +#include "Test.h" + #include "SkDashPathEffect.h" -#include "SkImageInfo.h" -#include "SkMatrix.h" -#include "SkPaint.h" -#include "SkPath.h" -#include "SkPathEffect.h" -#include "SkPoint.h" -#include "SkRect.h" -#include "SkRefCnt.h" -#include "SkScalar.h" +#include "SkWriteBuffer.h" #include "SkStrokeRec.h" +#include "SkCanvas.h" #include "SkSurface.h" -#include "SkTypes.h" -#include "Test.h" // crbug.com/348821 was rooted in SkDashPathEffect refusing to flatten and unflatten itself when // the effect is nonsense. Here we test that it fails when passed nonsense parameters. diff --git a/tests/DataRefTest.cpp b/tests/DataRefTest.cpp index e7ada5f09d..74d511cc28 100644 --- a/tests/DataRefTest.cpp +++ b/tests/DataRefTest.cpp @@ -9,21 +9,12 @@ #include "SkDataTable.h" #include "SkOSFile.h" #include "SkOSPath.h" -#include "SkRWBuffer.h" -#include "SkRefCnt.h" +#include "SkReadBuffer.h" +#include "SkWriteBuffer.h" #include "SkStream.h" -#include "SkString.h" #include "SkTArray.h" -#include "SkTaskGroup.h" -#include "SkTemplates.h" -#include "SkTypes.h" #include "Test.h" -#include <cstdio> -#include <cstring> -#include <memory> -#include <utility> - static void test_is_equal(skiatest::Reporter* reporter, const SkDataTable* a, const SkDataTable* b) { REPORTER_ASSERT(reporter, a->count() == b->count()); @@ -210,6 +201,7 @@ DEF_TEST(Data, reporter) { } /////////////////////////////////////////////////////////////////////////////////////////////////// +#include "SkRWBuffer.h" const char gABC[] = "abcdefghijklmnopqrstuvwxyz"; @@ -259,6 +251,8 @@ static void check_alphabet_buffer(skiatest::Reporter* reporter, const SkROBuffer check_abcs(reporter, storage.get(), size); } +#include "SkTaskGroup.h" + DEF_TEST(RWBuffer, reporter) { // Knowing that the default capacity is 4096, choose N large enough so we force it to use // multiple buffers internally. diff --git a/tests/DefaultPathRendererTest.cpp b/tests/DefaultPathRendererTest.cpp index 8619f5ce32..054708d14f 100644 --- a/tests/DefaultPathRendererTest.cpp +++ b/tests/DefaultPathRendererTest.cpp @@ -5,33 +5,16 @@ * found in the LICENSE file. */ -#include "SkTypes.h" +#include "Test.h" +#include "SkBitmap.h" #if SK_SUPPORT_GPU #include "GrClip.h" -#include "GrColor.h" -#include "GrContext.h" -#include "GrContextFactory.h" -#include "GrContextOptions.h" -#include "GrContextPriv.h" -#include "GrFragmentProcessor.h" -#include "GrPaint.h" #include "GrRenderTargetContext.h" #include "GrStyle.h" #include "GrTypesPriv.h" -#include "SkBitmap.h" -#include "SkColor.h" -#include "SkColorSpace.h" -#include "SkImageInfo.h" -#include "SkMatrix.h" -#include "SkPath.h" -#include "SkRect.h" -#include "SkRefCnt.h" -#include "SkStrokeRec.h" -#include "Test.h" -#include "effects/GrConstColorProcessor.h" -#include <utility> +#include "effects/GrConstColorProcessor.h" static void only_allow_default(GrContextOptions* options) { options->fGpuPathRenderers = GpuPathRenderers::kNone; diff --git a/tests/DeferredDisplayListTest.cpp b/tests/DeferredDisplayListTest.cpp index 85f34f1005..d033f890d8 100644 --- a/tests/DeferredDisplayListTest.cpp +++ b/tests/DeferredDisplayListTest.cpp @@ -8,31 +8,16 @@ #include "SkTypes.h" #if SK_SUPPORT_GPU + #include "GrBackendSurface.h" -#include "GrCaps.h" -#include "GrContext.h" -#include "GrContextFactory.h" #include "GrContextPriv.h" -#include "GrGLTypes.h" #include "GrGpu.h" -#include "GrRenderTargetContext.h" -#include "GrRenderTargetProxy.h" -#include "GrTextureProxy.h" #include "GrTextureProxyPriv.h" -#include "GrTypes.h" -#include "GrTypesPriv.h" -#include "SkBitmap.h" #include "SkCanvas.h" -#include "SkColorSpace.h" -#include "SkDeferredDisplayList.h" +#include "SkColorSpacePriv.h" #include "SkDeferredDisplayListRecorder.h" #include "SkGpuDevice.h" -#include "SkImage.h" -#include "SkImageInfo.h" #include "SkImage_Gpu.h" -#include "SkPaint.h" -#include "SkRect.h" -#include "SkRefCnt.h" #include "SkSurface.h" #include "SkSurfaceCharacterization.h" #include "SkSurfaceProps.h" @@ -40,15 +25,10 @@ #include "Test.h" #include "gl/GrGLCaps.h" #include "gl/GrGLDefines.h" - #ifdef SK_VULKAN #include "vk/GrVkDefines.h" #endif -#include <initializer_list> -#include <memory> -#include <utility> - // Try to create a backend format from the provided colorType and config. Return an invalid // backend format if the combination is infeasible. static GrBackendFormat create_backend_format(GrContext* context, diff --git a/tests/DetermineDomainModeTest.cpp b/tests/DetermineDomainModeTest.cpp index 4310cbe2fe..9c9e198123 100644 --- a/tests/DetermineDomainModeTest.cpp +++ b/tests/DetermineDomainModeTest.cpp @@ -5,23 +5,15 @@ * found in the LICENSE file. */ -#include "SkTypes.h" +#include "Test.h" #if SK_SUPPORT_GPU -#include "GrContext.h" -#include "GrContextFactory.h" + #include "GrContextPriv.h" #include "GrProxyProvider.h" -#include "GrSamplerState.h" +#include "GrSurfaceProxy.h" #include "GrTextureProducer.h" #include "GrTextureProxy.h" -#include "GrTypes.h" -#include "GrTypesPriv.h" -#include "SkRect.h" -#include "SkRefCnt.h" -#include "Test.h" - -#include <initializer_list> // For DetermineDomainMode (in the MDB world) we have 3 rects: // 1) the final instantiated backing storage (i.e., the actual GrTexture's extent) diff --git a/tests/DeviceTest.cpp b/tests/DeviceTest.cpp index 184da92fb7..58369cc149 100644 --- a/tests/DeviceTest.cpp +++ b/tests/DeviceTest.cpp @@ -5,24 +5,16 @@ * found in the LICENSE file. */ -#include "SkBitmap.h" +#include "SkBitmapDevice.h" #include "SkDevice.h" -#include "SkImage.h" -#include "SkImageInfo.h" -#include "SkRect.h" -#include "SkRefCnt.h" #include "SkSpecialImage.h" -#include "SkTypes.h" -#include "Test.h" -class SkColorSpace; #if SK_SUPPORT_GPU -#include "GrContextFactory.h" -#include "GrTypes.h" #include "SkGpuDevice.h" -class GrContext; #endif +#include "Test.h" + class DeviceTestingAccess { public: static sk_sp<SkSpecialImage> MakeSpecial(SkBaseDevice* dev, const SkBitmap& bm) { diff --git a/tests/DiscardableMemoryPoolTest.cpp b/tests/DiscardableMemoryPoolTest.cpp index 6ea0e9bb75..c91e827eb3 100644 --- a/tests/DiscardableMemoryPoolTest.cpp +++ b/tests/DiscardableMemoryPoolTest.cpp @@ -4,13 +4,9 @@ * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file. */ - -#include "SkDiscardableMemory.h" #include "SkDiscardableMemoryPool.h" -#include "SkRefCnt.h" -#include "Test.h" -#include <memory> +#include "Test.h" DEF_TEST(DiscardableMemoryPool, reporter) { sk_sp<SkDiscardableMemoryPool> pool(SkDiscardableMemoryPool::Make(1)); diff --git a/tests/DiscardableMemoryTest.cpp b/tests/DiscardableMemoryTest.cpp index 8447e4d45c..2b09533b0c 100644 --- a/tests/DiscardableMemoryTest.cpp +++ b/tests/DiscardableMemoryTest.cpp @@ -5,13 +5,9 @@ * found in the LICENSE file. */ -#include "SkDiscardableMemory.h" #include "SkDiscardableMemoryPool.h" -#include "SkRefCnt.h" -#include "Test.h" -#include <cstring> -#include <memory> +#include "Test.h" namespace { constexpr char kTestString[] = "HELLO, WORLD!"; diff --git a/tests/DrawBitmapRectTest.cpp b/tests/DrawBitmapRectTest.cpp index 43132e92f4..8ad177f5c1 100644 --- a/tests/DrawBitmapRectTest.cpp +++ b/tests/DrawBitmapRectTest.cpp @@ -7,17 +7,16 @@ #include "SkBitmap.h" #include "SkCanvas.h" -#include "SkColor.h" -#include "SkMatrix.h" +#include "SkData.h" +#include "SkDiscardableMemoryPool.h" +#include "SkImageGenerator.h" #include "SkMatrixUtils.h" #include "SkPaint.h" #include "SkPath.h" +#include "SkPixelRef.h" #include "SkRandom.h" -#include "SkRect.h" -#include "SkScalar.h" #include "SkShader.h" -#include "SkSize.h" -#include "SkTypes.h" +#include "SkSurface.h" #include "Test.h" /////////////////////////////////////////////////////////////////////////////// diff --git a/tests/DrawFilterTest.cpp b/tests/DrawFilterTest.cpp index ff8fae0316..27c9659e43 100644 --- a/tests/DrawFilterTest.cpp +++ b/tests/DrawFilterTest.cpp @@ -7,10 +7,8 @@ #include "SkCanvas.h" #include "SkDrawFilter.h" -#include "SkRefCnt.h" #include "SkSurface.h" #include "Test.h" -class SkPaint; #ifdef SK_SUPPORT_LEGACY_DRAWFILTER diff --git a/tests/DrawOpAtlasTest.cpp b/tests/DrawOpAtlasTest.cpp index 9388248c2f..584ae64825 100644 --- a/tests/DrawOpAtlasTest.cpp +++ b/tests/DrawOpAtlasTest.cpp @@ -8,37 +8,10 @@ #include "SkTypes.h" #if SK_SUPPORT_GPU -#include "GrContext.h" -#include "GrContextFactory.h" + #include "GrContextPriv.h" -#include "GrDeferredUpload.h" -#include "GrDrawOpAtlas.h" -#include "GrDrawingManager.h" -#include "GrOnFlushResourceProvider.h" -#include "GrOpFlushState.h" -#include "GrRenderTargetContext.h" -#include "GrSurfaceProxyPriv.h" -#include "GrTextureProxy.h" -#include "GrTypesPriv.h" -#include "GrXferProcessor.h" -#include "SkBitmap.h" -#include "SkColor.h" -#include "SkColorSpace.h" -#include "SkIPoint16.h" -#include "SkImageInfo.h" -#include "SkMatrix.h" -#include "SkPaint.h" -#include "SkPoint.h" -#include "SkRefCnt.h" #include "Test.h" -#include "ops/GrDrawOp.h" -#include "text/GrAtlasManager.h" -#include "text/GrAtlasTextContext.h" -#include "text/GrTextUtils.h" - -#include <memory> - -class GrResourceProvider; +#include "text/GrGlyphCache.h" static const int kNumPlots = 2; static const int kPlotSize = 32; @@ -172,6 +145,16 @@ DEF_GPUTEST_FOR_RENDERING_CONTEXTS(BasicDrawOpAtlas, reporter, ctxInfo) { check(reporter, atlas.get(), 1, 4, 1); } +#include "GrTest.h" + +#include "GrDrawingManager.h" +#include "GrOpFlushState.h" +#include "GrProxyProvider.h" + +#include "effects/GrConstColorProcessor.h" +#include "ops/GrAtlasTextOp.h" +#include "text/GrAtlasTextContext.h" + // This test verifies that the GrAtlasTextOp::onPrepare method correctly handles a failure // when allocating an atlas page. DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrAtlasTextOpPreparation, reporter, ctxInfo) { diff --git a/tests/DrawPathTest.cpp b/tests/DrawPathTest.cpp index 5a692149b1..0682319a01 100644 --- a/tests/DrawPathTest.cpp +++ b/tests/DrawPathTest.cpp @@ -7,21 +7,9 @@ #include "SkBitmap.h" #include "SkCanvas.h" -#include "SkColor.h" #include "SkDashPathEffect.h" -#include "SkImageInfo.h" -#include "SkMatrix.h" -#include "SkPaint.h" -#include "SkPath.h" -#include "SkPathEffect.h" -#include "SkPoint.h" -#include "SkRRect.h" -#include "SkRect.h" -#include "SkRefCnt.h" -#include "SkScalar.h" #include "SkStrokeRec.h" #include "SkSurface.h" -#include "SkTypes.h" #include "Test.h" // test that we can draw an aa-rect at coordinates > 32K (bigger than fixedpoint) diff --git a/tests/DrawTextTest.cpp b/tests/DrawTextTest.cpp index ac13140507..062d935d67 100644 --- a/tests/DrawTextTest.cpp +++ b/tests/DrawTextTest.cpp @@ -20,7 +20,7 @@ #include "SkTypes.h" #include "Test.h" -#include <cmath> +#include <math.h> static const SkColor bgColor = SK_ColorWHITE; diff --git a/tests/DynamicHashTest.cpp b/tests/DynamicHashTest.cpp index 62c070aca1..a857506fd0 100644 --- a/tests/DynamicHashTest.cpp +++ b/tests/DynamicHashTest.cpp @@ -6,11 +6,8 @@ */ #include "SkTDynamicHash.h" -#include "SkTypes.h" #include "Test.h" -#include <cstring> - namespace { struct Entry { diff --git a/tools/gpu/vk/GrVulkanDefines.h b/tools/gpu/vk/GrVulkanDefines.h index 2052341dbb..2eb49208fa 100644 --- a/tools/gpu/vk/GrVulkanDefines.h +++ b/tools/gpu/vk/GrVulkanDefines.h @@ -8,8 +8,6 @@ #ifndef GrVulkanDefines_DEFINED #define GrVulkanDefines_DEFINED -#include "SkTypes.h" - #if defined(SK_BUILD_FOR_WIN) # if !defined(VK_USE_PLATFORM_WIN32_KHR) # define VK_USE_PLATFORM_WIN32_KHR @@ -30,6 +28,6 @@ #define VK_NO_PROTOTYPES #endif -#include <vulkan/vulkan.h> // IWYU pragma: export +#include <vulkan/vulkan.h> #endif |