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/DM.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'dm/DM.cpp') diff --git a/dm/DM.cpp b/dm/DM.cpp index b8714d3fd9..5b3642ac84 100644 --- a/dm/DM.cpp +++ b/dm/DM.cpp @@ -862,11 +862,18 @@ static Sink* create_sink(const GrContextOptions& grCtxOptions, const SkCommandLi return nullptr; } if (gpuConfig->getTestThreading()) { + SkASSERT(!gpuConfig->getTestPersistentCache()); return new GPUThreadTestingSink( contextType, contextOverrides, gpuConfig->getSurfType(), gpuConfig->getSamples(), gpuConfig->getUseDIText(), gpuConfig->getColorType(), gpuConfig->getAlphaType(), sk_ref_sp(gpuConfig->getColorSpace()), FLAGS_gpu_threading, grCtxOptions); + } else if (gpuConfig->getTestPersistentCache()) { + return new GPUPersistentCacheTestingSink( + contextType, contextOverrides, gpuConfig->getSurfType(), + gpuConfig->getSamples(), gpuConfig->getUseDIText(), + gpuConfig->getColorType(), gpuConfig->getAlphaType(), + sk_ref_sp(gpuConfig->getColorSpace()), FLAGS_gpu_threading, grCtxOptions); } else { return new GPUSink(contextType, contextOverrides, gpuConfig->getSurfType(), gpuConfig->getSamples(), gpuConfig->getUseDIText(), -- cgit v1.2.3