Add GrD3DGpu and GrD3DCaps.
With this, can specify d3d config for dm and it will create a GrContext
with GrD3DGpu (stubbed in).
Bug: skia:9935
Change-Id: I0b8635bc541c61833b08b60a9f6e1341d1373090
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/271743
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
diff --git a/src/gpu/GrLegacyDirectContext.cpp b/src/gpu/GrLegacyDirectContext.cpp
index 76a0607..6b23633 100644
--- a/src/gpu/GrLegacyDirectContext.cpp
+++ b/src/gpu/GrLegacyDirectContext.cpp
@@ -23,6 +23,9 @@
#ifdef SK_VULKAN
#include "src/gpu/vk/GrVkGpu.h"
#endif
+#ifdef SK_DIRECT3D
+#include "src/gpu/d3d/GrD3DGpu.h"
+#endif
#ifdef SK_DAWN
#include "src/gpu/dawn/GrDawnGpu.h"
#endif
@@ -230,18 +233,17 @@
sk_sp<GrContext> GrContext::MakeDirect3D(const GrD3DBackendContext& backendContext,
const GrContextOptions& options) {
- return nullptr;
- //sk_sp<GrContext> context(new GrLegacyDirectContext(GrBackendApi::kDirect3D, options));
+ sk_sp<GrContext> context(new GrLegacyDirectContext(GrBackendApi::kDirect3D, options));
- //context->fGpu = GrD3DGpu::Make(backendContext, options, context.get());
- //if (!context->fGpu) {
- // return nullptr;
- //}
+ context->fGpu = GrD3DGpu::Make(backendContext, options, context.get());
+ if (!context->fGpu) {
+ return nullptr;
+ }
- //if (!context->init(context->fGpu->refCaps())) {
- // return nullptr;
- //}
- //return context;
+ if (!context->init(context->fGpu->refCaps())) {
+ return nullptr;
+ }
+ return context;
}
#endif