Add methods to access the top device's render target proxy

While the SDC-accessing versions have to stick around due to their
usage in unit tests, they will return null when exercising the NGA.
The render-target-proxy versions will work in both the OGA and NGA
and should, thus, be prefered.

Bug: skia:11837
Change-Id: I36213472e46e9da3ae6561f80d413090ceb6ad3e
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/415058
Commit-Queue: Robert Phillips <[email protected]>
Reviewed-by: Brian Salomon <[email protected]>
diff --git a/tests/WrappedSurfaceCopyOnWriteTest.cpp b/tests/WrappedSurfaceCopyOnWriteTest.cpp
index 1a91568..6ec2988 100644
--- a/tests/WrappedSurfaceCopyOnWriteTest.cpp
+++ b/tests/WrappedSurfaceCopyOnWriteTest.cpp
@@ -36,8 +36,8 @@
     };
 
     auto surfaceProxyID = [&](const sk_sp<SkSurface>& surf) {
-        GrSurfaceDrawContext* sdc = SkCanvasPriv::TopDeviceSurfaceDrawContext(surf->getCanvas());
-        return sdc->asSurfaceProxy()->uniqueID();
+        GrRenderTargetProxy* rtp = SkCanvasPriv::TopDeviceTargetProxy(surf->getCanvas());
+        return rtp->uniqueID();
     };
 
     sk_sp<SkSurface> surf = makeDirectBackendSurface();