Have GrSurfaceProxys and GrGpuResources draw from the same pool of unique ids

The idea here is that, for wrapped Proxy objects, we want the uniqueID to reflect that of the wrapped object. For this to work the IDs for the non-wrapped versions can't conflict with GrGpuResource's pool of IDs.

Split off of: https://codereview.chromium.org/2215323003/ (Start using RenderTargetProxy (omnibus))

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2301523003

Review-Url: https://codereview.chromium.org/2301523003
diff --git a/tests/ProxyTest.cpp b/tests/ProxyTest.cpp
index 45d3945..016ce5e 100644
--- a/tests/ProxyTest.cpp
+++ b/tests/ProxyTest.cpp
@@ -15,15 +15,20 @@
 #include "GrTextureProxy.h"
 #include "GrRenderTargetProxy.h"
 
+// Check that the surface proxy's member vars are set as expected
 static void check_surface(skiatest::Reporter* reporter,
                           GrSurfaceProxy* proxy,
                           GrSurfaceOrigin origin,
                           int width, int height, 
-                          GrPixelConfig config) {
+                          GrPixelConfig config,
+                          uint32_t uniqueID) {
     REPORTER_ASSERT(reporter, proxy->origin() == origin);
     REPORTER_ASSERT(reporter, proxy->width() == width);
     REPORTER_ASSERT(reporter, proxy->height() == height);
     REPORTER_ASSERT(reporter, proxy->config() == config);
+    if (SK_InvalidUniqueID != uniqueID) {
+        REPORTER_ASSERT(reporter, proxy->uniqueID() == uniqueID);    
+    }
 }
 
 static void check_rendertarget(skiatest::Reporter* reporter,
@@ -77,7 +82,7 @@
 }
 
 
-DEF_GPUTEST_FOR_RENDERING_CONTEXTS(AllocedProxyTest, reporter, ctxInfo) {
+DEF_GPUTEST_FOR_RENDERING_CONTEXTS(DeferredProxyTest, reporter, ctxInfo) {
     GrTextureProvider* provider = ctxInfo.grContext()->textureProvider();
 
     for (auto origin : { kBottomLeft_GrSurfaceOrigin, kTopLeft_GrSurfaceOrigin }) {
@@ -104,7 +109,7 @@
                                                                     fit,
                                                                     budgeted));
                                 check_surface(reporter, rtProxy.get(), origin,
-                                              widthHeight, widthHeight, config);
+                                              widthHeight, widthHeight, config, SK_InvalidUniqueID);
                                 check_rendertarget(reporter, provider, rtProxy.get(), fit);
                             }
 
@@ -114,7 +119,7 @@
                                                                                 fit,
                                                                                 budgeted));
                             check_surface(reporter, texProxy.get(), origin,
-                                          widthHeight, widthHeight, config);
+                                          widthHeight, widthHeight, config, SK_InvalidUniqueID);
                             check_texture(reporter, provider, texProxy.get(), fit);
                         }
                     }
@@ -162,7 +167,7 @@
                         sk_sp<GrRenderTargetProxy> rtProxy(
                             GrRenderTargetProxy::Make(caps, defaultFBO));
                         check_surface(reporter, rtProxy.get(), origin,
-                                      kWidthHeight, kWidthHeight, config);
+                                      kWidthHeight, kWidthHeight, config, defaultFBO->uniqueID());
                         check_rendertarget(reporter, provider, rtProxy.get(), SkBackingFit::kExact);
                     }
 
@@ -178,7 +183,7 @@
 
                         sk_sp<GrRenderTargetProxy> rtProxy(GrRenderTargetProxy::Make(caps, rt));
                         check_surface(reporter, rtProxy.get(), origin,
-                                      kWidthHeight, kWidthHeight, config);
+                                      kWidthHeight, kWidthHeight, config, rt->uniqueID());
                         check_rendertarget(reporter, provider, rtProxy.get(), SkBackingFit::kExact);
                     }
 
@@ -190,7 +195,7 @@
 
                     sk_sp<GrTextureProxy> texProxy(GrTextureProxy::Make(tex));
                     check_surface(reporter, texProxy.get(), origin,
-                                  kWidthHeight, kWidthHeight, config);
+                                  kWidthHeight, kWidthHeight, config, tex->uniqueID());
                     check_texture(reporter, provider, texProxy.get(), SkBackingFit::kExact);
                 }
             }