diff options
author | Brian Salomon <bsalomon@google.com> | 2018-03-09 09:01:53 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-03-09 16:32:10 +0000 |
commit | f865b05fe50ca2c094b9c60e4405c6094415b4f6 (patch) | |
tree | a00eab7c3787b5b977b3ae7c15aa1732f5a42c97 /src/gpu/GrGpu.h | |
parent | ad06544cc6ac4b403a24adda4ee36b9f35b3071f (diff) |
Add GM configs that test rendering to a GL backend texture and render target
This also adds GrGpu::create/deleteTestingOnlyBackendRenderTarget. Implemented in GL only for now.
Change-Id: I9e5fdc953c4a249959af89e08332f520cefe9d90
Reviewed-on: https://skia-review.googlesource.com/113305
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/GrGpu.h')
-rw-r--r-- | src/gpu/GrGpu.h | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h index 0c794e2eff..d63a38b758 100644 --- a/src/gpu/GrGpu.h +++ b/src/gpu/GrGpu.h @@ -448,12 +448,12 @@ public: Stats* stats() { return &fStats; } void dumpJSON(SkJSONWriter*) const; +#if GR_TEST_UTILS /** Creates a texture directly in the backend API without wrapping it in a GrTexture. This is only to be used for testing (particularly for testing the methods that import an externally created texture into Skia. Must be matched with a call to deleteTestingOnlyTexture(). */ GrBackendTexture createTestingOnlyBackendTexture(void* pixels, int w, int h, SkColorType, bool isRenderTarget, GrMipMapped); - /** Older version based on GrPixelConfig. Currently the preferred one above devolves to this. */ virtual GrBackendTexture createTestingOnlyBackendTexture( void* pixels, int w, int h, @@ -468,11 +468,23 @@ public: */ virtual void deleteTestingOnlyBackendTexture(GrBackendTexture*) = 0; + virtual GrBackendRenderTarget createTestingOnlyBackendRenderTarget(int w, int h, GrColorType, + GrSRGBEncoded) = 0; + + virtual void deleteTestingOnlyBackendRenderTarget(const GrBackendRenderTarget&) = 0; + + // This is only to be used in GL-specific tests. + virtual const GrGLContext* glContextForTesting() const { return nullptr; } + + // This is only to be used by testing code + virtual void resetShaderCacheForTesting() const {} + /** * Flushes all work to the gpu and forces the GPU to wait until all the gpu work has completed. * This is for testing purposes only. */ virtual void testingOnly_flushGpuAndSync() = 0; +#endif // width and height may be larger than rt (if underlying API allows it). // Returns nullptr if compatible sb could not be created, otherwise the caller owns the ref on @@ -504,12 +516,6 @@ public: return this->onIsACopyNeededForTextureParams(proxy, params, copyParams, scaleAdjust); } - // This is only to be used in GL-specific tests. - virtual const GrGLContext* glContextForTesting() const { return nullptr; } - - // This is only to be used by testing code - virtual void resetShaderCacheForTesting() const {} - void handleDirtyContext() { if (fResetBits) { this->resetContext(); |