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>
This commit is contained in:
Michael Ludwig 2019-12-02 14:27:21 -05:00 committed by Skia Commit-Bot
parent cdf1bc3bd3
commit 08bd1f7300

View File

@ -149,9 +149,10 @@ GrSamplerState::Filter GrTextureProxy::HighestFilterMode(GrTextureType textureTy
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();
}