diff options
author | 2018-02-26 14:32:39 -0500 | |
---|---|---|
committer | 2018-02-26 20:43:18 +0000 | |
commit | 5f33a8ccac141dfaddddc7b9fc39a8428cc233fe (patch) | |
tree | bc01188bd6ffbce272ce0bccb8f13da1163f26a8 /include | |
parent | 5ba448c21aa002055aa68942f1f50fd4cdfd8033 (diff) |
Start on new GPU pixel ops implementation.
The new ops attempt to be less optimal by falling back to CPU conversions
rather than relying on intermediate draws and complex coordination between
GrContext and GrGpu to determine how conversions are performed.
This adds the new writePixels implementation.
Change-Id: I7496d86d5a40277ed2ca63668881c160e54d80d3
Reviewed-on: https://skia-review.googlesource.com/109880
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/gpu/GrCaps.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/gpu/GrCaps.h b/include/gpu/GrCaps.h index e8449bbcb4..de9bc73cf5 100644 --- a/include/gpu/GrCaps.h +++ b/include/gpu/GrCaps.h @@ -185,6 +185,23 @@ public: return this->getRenderTargetSampleCount(requestedCount, config); } + /** + * Some backends have restrictions on what types of render targets for which + * GrGpu::writePixels() will succeed. 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 render target. + */ + virtual bool renderTargetWritePixelsSupported(bool isAlsoTexture, int sampleCnt) const = 0; + + /** + * Given a dst pixel config and a src color type what color type must the caller coax the + * the data into in order to use GrGpu::writePixels(). + */ + virtual GrColorType supportedWritePixelsColorType(GrPixelConfig config, + GrColorType /*srcColorType*/) const { + return GrPixelConfigToColorType(config); + } + bool suppressPrints() const { return fSuppressPrints; } size_t bufferMapThreshold() const { |