diff options
author | Brian Salomon <bsalomon@google.com> | 2018-03-19 16:06:44 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-03-19 21:17:15 +0000 |
commit | 19eaf2dbe785a06b76f11c2066c302f0aa89d5d2 (patch) | |
tree | 9bf1bcf8fe794da174ba19b1c5cfed84f0f274e5 /include | |
parent | 56dc04bdc160b71a1e77fdb9e30fde4e860077ae (diff) |
Revert "Revert "New read pixels implementation that is simpler but does all conversions on CPU.""
This reverts commit be5947c2f38a79b7c709accfb1047d8fd06a0227.
Bug: skia:
Change-Id: I06dc15b31042d7827511d0ac2a7f4262c3f09622
Reviewed-on: https://skia-review.googlesource.com/115079
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/gpu/GrCaps.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/include/gpu/GrCaps.h b/include/gpu/GrCaps.h index 27ad6a164d..02a51a092d 100644 --- a/include/gpu/GrCaps.h +++ b/include/gpu/GrCaps.h @@ -186,7 +186,15 @@ public: * If this returns false then the caller should implement a fallback where a temporary texture * is created, pixels are written to it, and then that is copied or drawn into the the surface. */ - virtual bool surfaceSupportsWritePixels(const GrSurface* surface) const = 0; + virtual bool surfaceSupportsWritePixels(const GrSurface*) const = 0; + + /** + * Backends may have restrictions on what types of surfaces support GrGpu::readPixels(). + * If this returns false then the caller should implement a fallback where a temporary texture + * is created, the surface is drawn or copied into the temporary, and pixels are read from the + * temporary. + */ + virtual bool surfaceSupportsReadPixels(const GrSurface*) const = 0; /** * Given a dst pixel config and a src color type what color type must the caller coax the @@ -197,6 +205,15 @@ public: return GrPixelConfigToColorType(config); } + /** + * Given a src pixel config and a dst color type what color type must the caller read to using + * GrGpu::readPixels() and then coax into dstColorType. + */ + virtual GrColorType supportedReadPixelsColorType(GrPixelConfig config, + GrColorType /*dstColorType*/) const { + return GrPixelConfigToColorType(config); + } + bool suppressPrints() const { return fSuppressPrints; } size_t bufferMapThreshold() const { |