Add option to switch between OGA and NGA SkGpuDevices
Bug: skia:11837
Change-Id: Id52f05a055c97cd2644bc70d600e9313766f6730
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/415796
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrDirectContextPriv.cpp b/src/gpu/GrDirectContextPriv.cpp
index 9f0712f..66917a1 100644
--- a/src/gpu/GrDirectContextPriv.cpp
+++ b/src/gpu/GrDirectContextPriv.cpp
@@ -14,6 +14,7 @@
#include "src/gpu/GrDrawingManager.h"
#include "src/gpu/GrGpu.h"
#include "src/gpu/GrMemoryPool.h"
+#include "src/gpu/GrRecordingContextPriv.h"
#include "src/gpu/GrSurfaceContext.h"
#include "src/gpu/GrSurfaceDrawContext.h"
#include "src/gpu/GrTexture.h"
@@ -229,3 +230,28 @@
return GrConfigConversionEffect::Make(std::move(fp), PMConversion::kToPremul);
}
+
+sk_sp<SkBaseGpuDevice> GrDirectContextPriv::createDevice(GrColorType colorType,
+ sk_sp<GrSurfaceProxy> proxy,
+ sk_sp<SkColorSpace> colorSpace,
+ GrSurfaceOrigin origin,
+ const SkSurfaceProps& props,
+ SkBaseGpuDevice::InitContents init) {
+ return fContext->GrRecordingContext::priv().createDevice(colorType, std::move(proxy),
+ std::move(colorSpace),
+ origin, props, init);
+}
+
+sk_sp<SkBaseGpuDevice> GrDirectContextPriv::createDevice(SkBudgeted budgeted,
+ const SkImageInfo& ii,
+ SkBackingFit fit,
+ int sampleCount,
+ GrMipmapped mipmapped,
+ GrProtected isProtected,
+ GrSurfaceOrigin origin,
+ const SkSurfaceProps& props,
+ SkBaseGpuDevice::InitContents init) {
+ return fContext->GrRecordingContext::priv().createDevice(budgeted, ii, fit, sampleCount,
+ mipmapped, isProtected,
+ origin, props, init);
+}