Compare textureType separately from backend format

Prior CL had assumed GrBackendFormat == incorporated the texture type,
since it currently owns that, but that is not the case. So when the
texture type comparison was dropped, textures could be batched when they
shouldn't have, particularly external vs. 2D.

Bug: b/145261411
Change-Id: I9497fc17c7f82b4016cbf1a752f93946615de2dc
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/257390
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Auto-Submit: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrTextureProxy.cpp b/src/gpu/GrTextureProxy.cpp
index 26d95ab..2d2f766 100644
--- a/src/gpu/GrTextureProxy.cpp
+++ b/src/gpu/GrTextureProxy.cpp
@@ -149,9 +149,10 @@
 
 bool GrTextureProxy::ProxiesAreCompatibleAsDynamicState(const GrSurfaceProxy* first,
                                                         const GrSurfaceProxy* second) {
-    // In order to be compatible, the proxies should also have the same texture type, but since
-    // that is owned by the backend format, the formats being equal is sufficient.
+    // In order to be compatible, the proxies should also have the same texture type. This is
+    // checked explicitly since the GrBackendFormat == operator does not compare texture type
     return first->config() == second->config() &&
+           first->backendFormat().textureType() == second->backendFormat().textureType() &&
            first->backendFormat() == second->backendFormat();
 }