From 00a5eb8c12536f7843ccb137f94df88583813128 Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Wed, 11 Jul 2018 15:32:05 -0400 Subject: Add gltestpersistentcache config that tests GrContextOption's cache. Uses a new GPU sink that runs each test twice, once to populate the cache and then again with a new GrContext but a warmed cache. It verifies that the two generated images are the same. Change-Id: Iaba195a69751f14ea946afe7174228a813b83a63 Reviewed-on: https://skia-review.googlesource.com/140567 Commit-Queue: Brian Salomon Reviewed-by: Brian Osman --- dm/DMSrcSink.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'dm/DMSrcSink.h') diff --git a/dm/DMSrcSink.h b/dm/DMSrcSink.h index 9c31c0ab22..86c2279439 100644 --- a/dm/DMSrcSink.h +++ b/dm/DMSrcSink.h @@ -386,6 +386,26 @@ private: typedef GPUSink INHERITED; }; +class GPUPersistentCacheTestingSink : public GPUSink { +public: + GPUPersistentCacheTestingSink(sk_gpu_test::GrContextFactory::ContextType, + sk_gpu_test::GrContextFactory::ContextOverrides, + SkCommandLineConfigGpu::SurfType surfType, int samples, + bool diText, SkColorType colorType, SkAlphaType alphaType, + sk_sp colorSpace, bool threaded, + const GrContextOptions& grCtxOptions); + + Error draw(const Src&, SkBitmap*, SkWStream*, SkString*) const override; + + const char* fileExtension() const override { + // Suppress writing out results from this config - we just want to do our matching test + return nullptr; + } + +private: + typedef GPUSink INHERITED; +}; + class PDFSink : public Sink { public: PDFSink(bool pdfa, SkScalar rasterDpi) : fPDFA(pdfa), fRasterDpi(rasterDpi) {} -- cgit v1.2.3