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>
diff --git a/gn/tests.gni b/gn/tests.gni
index 19017c4..4eef06e 100644
--- a/gn/tests.gni
+++ b/gn/tests.gni
@@ -55,7 +55,6 @@
   "$_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 8f697c0..d17300a 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
+#include SK_VULKAN_HEADER // IWYU pragma: export
 #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>
+#  include <vulkan/vulkan.h> // IWYU pragma: export
 #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 b074981..65ff4aa 100644
--- a/platform_tools/android/vulkan/Skia_Vulkan_Android.h
+++ b/platform_tools/android/vulkan/Skia_Vulkan_Android.h
@@ -8,6 +8,8 @@
 #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
@@ -15,7 +17,7 @@
 #  define VK_USE_PLATFORM_ANDROID_KHR
 #endif
 
-#include <vulkan/vulkan.h>
+#include <vulkan/vulkan.h> // IWYU pragma: export
 
 #endif
 
diff --git a/tests/DFPathRendererTest.cpp b/tests/DFPathRendererTest.cpp
deleted file mode 100644
index 653db82..0000000
--- a/tests/DFPathRendererTest.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * 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 e3a3804..f165207 100644
--- a/tests/DashPathEffectTest.cpp
+++ b/tests/DashPathEffectTest.cpp
@@ -5,13 +5,21 @@
  * found in the LICENSE file.
  */
 
-#include "Test.h"
-
-#include "SkDashPathEffect.h"
-#include "SkWriteBuffer.h"
-#include "SkStrokeRec.h"
 #include "SkCanvas.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 "SkStrokeRec.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 74d511c..e7ada5f 100644
--- a/tests/DataRefTest.cpp
+++ b/tests/DataRefTest.cpp
@@ -9,12 +9,21 @@
 #include "SkDataTable.h"
 #include "SkOSFile.h"
 #include "SkOSPath.h"
-#include "SkReadBuffer.h"
-#include "SkWriteBuffer.h"
+#include "SkRWBuffer.h"
+#include "SkRefCnt.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());
@@ -201,7 +210,6 @@
 }
 
 ///////////////////////////////////////////////////////////////////////////////////////////////////
-#include "SkRWBuffer.h"
 
 const char gABC[] = "abcdefghijklmnopqrstuvwxyz";
 
@@ -251,8 +259,6 @@
     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 054708d..8619f5c 100644
--- a/tests/DefaultPathRendererTest.cpp
+++ b/tests/DefaultPathRendererTest.cpp
@@ -5,17 +5,34 @@
  * found in the LICENSE file.
  */
 
-#include "Test.h"
-#include "SkBitmap.h"
+#include "SkTypes.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>
+
 static void only_allow_default(GrContextOptions* options) {
     options->fGpuPathRenderers = GpuPathRenderers::kNone;
 }
diff --git a/tests/DeferredDisplayListTest.cpp b/tests/DeferredDisplayListTest.cpp
index d033f89..85f34f1 100644
--- a/tests/DeferredDisplayListTest.cpp
+++ b/tests/DeferredDisplayListTest.cpp
@@ -8,16 +8,31 @@
 #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 "SkColorSpacePriv.h"
+#include "SkColorSpace.h"
+#include "SkDeferredDisplayList.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"
@@ -25,10 +40,15 @@
 #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 9c9e198..4310cbe 100644
--- a/tests/DetermineDomainModeTest.cpp
+++ b/tests/DetermineDomainModeTest.cpp
@@ -5,15 +5,23 @@
  * found in the LICENSE file.
  */
 
-#include "Test.h"
+#include "SkTypes.h"
 
 #if SK_SUPPORT_GPU
-
+#include "GrContext.h"
+#include "GrContextFactory.h"
 #include "GrContextPriv.h"
 #include "GrProxyProvider.h"
-#include "GrSurfaceProxy.h"
+#include "GrSamplerState.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 58369cc..184da92 100644
--- a/tests/DeviceTest.cpp
+++ b/tests/DeviceTest.cpp
@@ -5,16 +5,24 @@
  * found in the LICENSE file.
  */
 
-#include "SkBitmapDevice.h"
+#include "SkBitmap.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 c91e827..6ea0e9b 100644
--- a/tests/DiscardableMemoryPoolTest.cpp
+++ b/tests/DiscardableMemoryPoolTest.cpp
@@ -4,10 +4,14 @@
  * Use of this source code is governed by a BSD-style license that can be
  * found in the LICENSE file.
  */
-#include "SkDiscardableMemoryPool.h"
 
+#include "SkDiscardableMemory.h"
+#include "SkDiscardableMemoryPool.h"
+#include "SkRefCnt.h"
 #include "Test.h"
 
+#include <memory>
+
 DEF_TEST(DiscardableMemoryPool, reporter) {
     sk_sp<SkDiscardableMemoryPool> pool(SkDiscardableMemoryPool::Make(1));
     pool->setRAMBudget(3);
diff --git a/tests/DiscardableMemoryTest.cpp b/tests/DiscardableMemoryTest.cpp
index 2b09533..8447e4d 100644
--- a/tests/DiscardableMemoryTest.cpp
+++ b/tests/DiscardableMemoryTest.cpp
@@ -5,10 +5,14 @@
  * found in the LICENSE file.
  */
 
+#include "SkDiscardableMemory.h"
 #include "SkDiscardableMemoryPool.h"
-
+#include "SkRefCnt.h"
 #include "Test.h"
 
+#include <cstring>
+#include <memory>
+
 namespace {
 constexpr char kTestString[] = "HELLO, WORLD!";
 constexpr size_t kTestStringLength = sizeof(kTestString);
diff --git a/tests/DrawBitmapRectTest.cpp b/tests/DrawBitmapRectTest.cpp
index 8ad177f..43132e9 100644
--- a/tests/DrawBitmapRectTest.cpp
+++ b/tests/DrawBitmapRectTest.cpp
@@ -7,16 +7,17 @@
 
 #include "SkBitmap.h"
 #include "SkCanvas.h"
-#include "SkData.h"
-#include "SkDiscardableMemoryPool.h"
-#include "SkImageGenerator.h"
+#include "SkColor.h"
+#include "SkMatrix.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 "SkSurface.h"
+#include "SkSize.h"
+#include "SkTypes.h"
 #include "Test.h"
 
 ///////////////////////////////////////////////////////////////////////////////
diff --git a/tests/DrawFilterTest.cpp b/tests/DrawFilterTest.cpp
index 27c9659..ff8fae0 100644
--- a/tests/DrawFilterTest.cpp
+++ b/tests/DrawFilterTest.cpp
@@ -7,8 +7,10 @@
 
 #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 584ae64..9388248 100644
--- a/tests/DrawOpAtlasTest.cpp
+++ b/tests/DrawOpAtlasTest.cpp
@@ -8,10 +8,37 @@
 #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 "text/GrGlyphCache.h"
+#include "ops/GrDrawOp.h"
+#include "text/GrAtlasManager.h"
+#include "text/GrAtlasTextContext.h"
+#include "text/GrTextUtils.h"
+
+#include <memory>
+
+class GrResourceProvider;
 
 static const int kNumPlots = 2;
 static const int kPlotSize = 32;
@@ -145,16 +172,6 @@
     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 0682319..5a69214 100644
--- a/tests/DrawPathTest.cpp
+++ b/tests/DrawPathTest.cpp
@@ -7,9 +7,21 @@
 
 #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 6ec0a65..8dd5917 100644
--- a/tests/DrawTextTest.cpp
+++ b/tests/DrawTextTest.cpp
@@ -20,7 +20,7 @@
 #include "SkTypes.h"
 #include "Test.h"
 
-#include <math.h>
+#include <cmath>
 
 static const SkColor bgColor = SK_ColorWHITE;
 
diff --git a/tests/DynamicHashTest.cpp b/tests/DynamicHashTest.cpp
index a857506..62c070a 100644
--- a/tests/DynamicHashTest.cpp
+++ b/tests/DynamicHashTest.cpp
@@ -6,8 +6,11 @@
  */
 
 #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 2eb4920..2052341 100644
--- a/tools/gpu/vk/GrVulkanDefines.h
+++ b/tools/gpu/vk/GrVulkanDefines.h
@@ -8,6 +8,8 @@
 #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
@@ -28,6 +30,6 @@
 #define VK_NO_PROTOTYPES
 #endif
 
-#include <vulkan/vulkan.h>
+#include <vulkan/vulkan.h> // IWYU pragma: export
 
 #endif