diff options
author | Brian Salomon <bsalomon@google.com> | 2017-01-06 13:54:58 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-01-06 19:42:08 +0000 |
commit | 19f0ed5b83a6ddf163a78bcb1c701f6020e6a17c (patch) | |
tree | 1f95cbab5eae57a734aeee489099b9b9f97f2331 /src/gpu/GrClipStackClip.h | |
parent | 9953737bcf885a52c08ade6c503f2202e4dd9aa5 (diff) |
Purge clip masks when they are no longer findable.
This improves memory usage when the content contains frequently changing clips implemented as masks.
BUG=chromium:676459
Change-Id: I06ea5f9fe1cff9564ea136bad9fe97f6ecd77ad9
Reviewed-on: https://skia-review.googlesource.com/6629
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrClipStackClip.h')
-rw-r--r-- | src/gpu/GrClipStackClip.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/gpu/GrClipStackClip.h b/src/gpu/GrClipStackClip.h index f5b8411169..1c4d40b173 100644 --- a/src/gpu/GrClipStackClip.h +++ b/src/gpu/GrClipStackClip.h @@ -40,6 +40,9 @@ public: bool isRRect(const SkRect& rtBounds, SkRRect* rr, GrAA* aa) const override; + sk_sp<GrTexture> testingOnly_createClipMask(GrContext*) const; + static const char kMaskTestTag[]; + private: static bool PathNeedsSWRenderer(GrContext* context, bool hasUserStencilSettings, @@ -51,18 +54,15 @@ private: // Creates an alpha mask of the clip. The mask is a rasterization of elements through the // rect specified by clipSpaceIBounds. - static sk_sp<GrTexture> CreateAlphaClipMask(GrContext*, const GrReducedClip&); + sk_sp<GrTexture> createAlphaClipMask(GrContext*, const GrReducedClip&) const; // Similar to createAlphaClipMask but it rasterizes in SW and uploads to the result texture. - static sk_sp<GrTexture> CreateSoftwareClipMask(GrContext*, const GrReducedClip&); - - static bool UseSWOnlyPath(GrContext*, - bool hasUserStencilSettings, - const GrRenderTargetContext*, - const GrReducedClip&); + sk_sp<GrTexture> createSoftwareClipMask(GrContext*, const GrReducedClip&) const; - static GrTexture* CreateCachedMask(int width, int height, const GrUniqueKey& key, - bool renderTarget); + static bool UseSWOnlyPath(GrContext*, + bool hasUserStencilSettings, + const GrRenderTargetContext*, + const GrReducedClip&); SkIPoint fOrigin; sk_sp<const SkClipStack> fStack; |