Reland "Move ExternalFormat and Type to FormatInfo."
This reverts commit e2c5e8c7eeb07a7c2de566851956027cf6c12b07.
Reason for revert: relanding with fix
Original change's description:
> Revert "Move ExternalFormat and Type to FormatInfo."
>
> This reverts commit 80140518ef7627d103e7d80fec599c052280053a.
>
> Reason for revert: probably breaking angle
>
> Original change's description:
> > Move ExternalFormat and Type to FormatInfo.
> >
> > This also deletes the ConfigInfoTable in GrGLCaps as there is no more use
> > of it.
> >
> > Additionally with the rework of storing External Io info on the format table
> > I rewrote the implimination of supportedReadPixels and supportedWritePixels
> > for GL to loop over the supported types looking for a match instead of
> > simply defaulting to a base value.
> >
> > Finally transferFromOffsetAlignment has been rolled into the SupportedRead
> > instead of being its own query.
> >
> > Bug: skia:6718
> > Change-Id: I39f77adf6c0b5b38245e55e8a7e18c0b428862d0
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229381
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
>
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
>
> Change-Id: Ifef2e7308fdb4d91d649f08488b798815e0aa5fa
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia:6718
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229896
> Reviewed-by: Greg Daniel <egdaniel@google.com>
> Commit-Queue: Greg Daniel <egdaniel@google.com>
TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
Change-Id: Ida09be706b461cf89467fc0082744177e71e8985
Bug: skia:6718
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/229918
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/GrGpu.cpp b/src/gpu/GrGpu.cpp
index b202391..34d32d4 100644
--- a/src/gpu/GrGpu.cpp
+++ b/src/gpu/GrGpu.cpp
@@ -465,8 +465,14 @@
TRACE_EVENT0("skia.gpu", TRACE_FUNC);
SkASSERT(surface);
SkASSERT(transferBuffer);
- SkASSERT(this->caps()->transferFromOffsetAlignment(bufferColorType));
- SkASSERT(offset % this->caps()->transferFromOffsetAlignment(bufferColorType) == 0);
+#ifdef SK_DEBUG
+ GrColorType surfCT = GrPixelConfigToColorType(surface->config());
+ auto supportedRead = this->caps()->supportedReadPixelsColorType(surfCT,
+ surface->backendFormat(),
+ bufferColorType);
+ SkASSERT(supportedRead.fOffsetAlignmentForTransferBuffer);
+ SkASSERT(offset % supportedRead.fOffsetAlignmentForTransferBuffer == 0);
+#endif
// We require that the write region is contained in the texture
SkIRect subRect = SkIRect::MakeXYWH(left, top, width, height);