Start adding D3D backend

Bug: skia:
Change-Id: Id24ed653adb80fe9b2ad597a34e459eb91ca53ec
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271057
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/tools/gpu/GrContextFactory.cpp b/tools/gpu/GrContextFactory.cpp
index 4432c87..d89314e 100644
--- a/tools/gpu/GrContextFactory.cpp
+++ b/tools/gpu/GrContextFactory.cpp
@@ -13,7 +13,7 @@
 #endif
 
 #if SK_ANGLE
-    #include "tools/gpu/gl/angle/GLTestContext_angle.h"
+#include "tools/gpu/gl/angle/GLTestContext_angle.h"
 #endif
 #include "tools/gpu/gl/command_buffer/GLTestContext_command_buffer.h"
 #ifdef SK_VULKAN
@@ -22,6 +22,9 @@
 #ifdef SK_METAL
 #include "tools/gpu/mtl/MtlTestContext.h"
 #endif
+#ifdef SK_DIRECT3D
+#include "tools/gpu/d3d/D3DTestContext.h"
+#endif
 #ifdef SK_DAWN
 #include "tools/gpu/dawn/DawnTestContext.h"
 #endif
@@ -247,6 +250,18 @@
             break;
         }
 #endif
+#ifdef SK_DIRECT3D
+        case GrBackendApi::kDirect3D: {
+            D3DTestContext* d3dSharedContext = masterContext
+                    ? static_cast<D3DTestContext*>(masterContext->fTestContext) : nullptr;
+            SkASSERT(kDirect3D_ContextType == type);
+            testCtx.reset(CreatePlatformD3DTestContext(d3dSharedContext));
+            if (!testCtx) {
+                return ContextInfo();
+            }
+            break;
+        }
+#endif
 #ifdef SK_DAWN
         case GrBackendApi::kDawn: {
             DawnTestContext* dawnSharedContext = masterContext