Remove all internal uses of (and deprecate) SkSurface::getContext
We are replacing GrContext with the GrDirectContext/GrRecordingContext
pair. This starts making that change visible to clients (and weaning
Skia off of GrContext).
Change-Id: I00cc9bf208499984de855a1646229bd7557fc925
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/300706
Reviewed-by: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/tools/gpu/vk/VkTestHelper.cpp b/tools/gpu/vk/VkTestHelper.cpp
index f1a02a4..d7e3616 100644
--- a/tools/gpu/vk/VkTestHelper.cpp
+++ b/tools/gpu/vk/VkTestHelper.cpp
@@ -10,7 +10,7 @@
#ifdef SK_VULKAN
#include "include/core/SkSurface.h"
-#include "include/gpu/GrContext.h"
+#include "include/gpu/GrDirectContext.h"
#include "tools/gpu/vk/VkTestUtils.h"
#define ACQUIRE_INST_VK_PROC(name) \
@@ -77,8 +77,12 @@
ACQUIRE_DEVICE_VK_PROC(FlushMappedMemoryRanges)
ACQUIRE_DEVICE_VK_PROC(GetImageSubresourceLayout)
- fGrContext = GrContext::MakeVulkan(fBackendContext);
- if (!fGrContext) {
+ // CONTEXT TODO: MakeVulkan should return an sk_sp<GrDirectContext>
+ auto tmp = GrContext::MakeVulkan(fBackendContext);
+ if (tmp) {
+ fDirectContext = sk_ref_sp<GrDirectContext>(tmp->asDirectContext());
+ }
+ if (!fDirectContext) {
return false;
}
@@ -86,7 +90,7 @@
}
void VkTestHelper::cleanup() {
- fGrContext.reset();
+ fDirectContext.reset();
fBackendContext.fMemoryAllocator.reset();
if (fDevice != VK_NULL_HANDLE) {