Make asDirectContext public
External clients will eventually have to call this to get access
to a direct context from an SkCanvas or SkSurface (which will
only have 'recordingContext' accessors).
Bug: skia:10441
Change-Id: I10e34081277b685fa59d03e1fce1887f3524e0fa
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/300178
Reviewed-by: Adlai Holler <adlai@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrOnFlushResourceProvider.cpp b/src/gpu/GrOnFlushResourceProvider.cpp
index 538b0f4..f09acfa 100644
--- a/src/gpu/GrOnFlushResourceProvider.cpp
+++ b/src/gpu/GrOnFlushResourceProvider.cpp
@@ -90,7 +90,7 @@
SkASSERT(proxy->canSkipResourceAllocator());
// TODO: this class should probably just get a GrDirectContext
- auto direct = fDrawingMgr->getContext()->priv().asDirectContext();
+ auto direct = fDrawingMgr->getContext()->asDirectContext();
if (!direct) {
return false;
}
@@ -107,7 +107,7 @@
sk_sp<GrGpuBuffer> GrOnFlushResourceProvider::makeBuffer(GrGpuBufferType intendedType, size_t size,
const void* data) {
// TODO: this class should probably just get a GrDirectContext
- auto direct = fDrawingMgr->getContext()->priv().asDirectContext();
+ auto direct = fDrawingMgr->getContext()->asDirectContext();
if (!direct) {
return nullptr;
}
@@ -121,7 +121,7 @@
sk_sp<const GrGpuBuffer> GrOnFlushResourceProvider::findOrMakeStaticBuffer(
GrGpuBufferType intendedType, size_t size, const void* data, const GrUniqueKey& key) {
// TODO: class should probably just get a GrDirectContext
- auto direct = fDrawingMgr->getContext()->priv().asDirectContext();
+ auto direct = fDrawingMgr->getContext()->asDirectContext();
if (!direct) {
return nullptr;
}