From 4da70190aadd8a346ea967a3c435d20a80a5cccd Mon Sep 17 00:00:00 2001 From: Chris Dalton Date: Mon, 18 Jun 2018 09:51:36 -0600 Subject: ccpr: Implement path mask caching Implement caching as follows: 1) Instead of deleting the mainline ccpr atlas when finished, stash it away from flush to flush. 2) On subsequent flushes, check the stashed atlas to see if we can reuse any of its cachable paths. Copy reusable paths into 8-bit literal coverage atlases and store them in the resource cache. 3) Recycle the stashed atlas texture for the remaining paths in the flush. Bug: skia: Change-Id: I9b20fbea708646df1df3a5f9c044e2299706b989 Reviewed-on: https://skia-review.googlesource.com/134703 Commit-Queue: Chris Dalton Reviewed-by: Robert Phillips --- tools/gpu/GrTest.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tools/gpu') diff --git a/tools/gpu/GrTest.cpp b/tools/gpu/GrTest.cpp index 00abd957e0..e8598868b5 100644 --- a/tools/gpu/GrTest.cpp +++ b/tools/gpu/GrTest.cpp @@ -25,6 +25,7 @@ #include "SkMathPriv.h" #include "SkString.h" #include "SkTo.h" +#include "ccpr/GrCoverageCountingPathRenderer.h" #include "ops/GrMeshDrawOp.h" #include "text/GrGlyphCache.h" #include "text/GrTextBlobCache.h" @@ -301,6 +302,12 @@ GrPixelConfig GrBackendRenderTarget::testingOnly_getPixelConfig() const { ////////////////////////////////////////////////////////////////////////////// +const GrUniqueKey& GrCoverageCountingPathRenderer::testingOnly_getStashedAtlasKey() const { + return fStashedAtlasKey; +} + +////////////////////////////////////////////////////////////////////////////// + #define DRAW_OP_TEST_EXTERN(Op) \ extern std::unique_ptr Op##__Test(GrPaint&&, SkRandom*, GrContext*, GrFSAAType) #define DRAW_OP_TEST_ENTRY(Op) Op##__Test -- cgit v1.2.3