Reland "Allow swapping out of GrBackendTexture used by SkSurface"

This reverts commit f73b8db50ba147179099debeb8a418718fbf61dc.

Reason for revert: Fixed SK_GL issue

Original change's description:
> Revert "Allow swapping out of GrBackendTexture used by SkSurface"
>
> This reverts commit 9456f7aba5ccc8dff81b5bbcbcfec5f593195083.
>
> Reason for revert: Breaking layout tests
>
> Original change's description:
> > Allow swapping out of GrBackendTexture used by SkSurface
> >
> > Change-Id: I67f26efaee87536f3faf51ca164bf003013c7c8a
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215428
> > Commit-Queue: Brian Salomon <bsalomon@google.com>
> > Reviewed-by: Robert Phillips <robertphillips@google.com>
>
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
>
> Change-Id: I0ff5e63d47cd3e536f9fe656503d74965ce6dbfd
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215822
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>

TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com

Change-Id: Ie87d84ac4c08d67bcd276330f1af087bc532aad2
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/215825
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/include/gpu/GrBackendSurface.h b/include/gpu/GrBackendSurface.h
index 20f217d..c42f7bc 100644
--- a/include/gpu/GrBackendSurface.h
+++ b/include/gpu/GrBackendSurface.h
@@ -196,6 +196,9 @@
     // Returns true if the backend texture has been initialized.
     bool isValid() const { return fIsValid; }
 
+    // Returns true if both textures are valid and refer to the same API texture.
+    bool isSameTexture(const GrBackendTexture&);
+
 #if GR_TEST_UTILS
     // We can remove the pixelConfig getter and setter once we remove the GrPixelConfig from the
     // GrBackendTexture and plumb the GrPixelconfig manually throughout our code (or remove all use
@@ -214,6 +217,7 @@
     friend class SkImage_GpuYUVA;
     friend class SkPromiseImageHelper;
     friend class SkSurface;
+    friend class SkSurface_Gpu;
     friend class GrAHardwareBufferImageGenerator;
     friend class GrBackendTextureImageGenerator;
     friend class GrProxyProvider;