diff options
author | Chris Dalton <csmartdalton@google.com> | 2018-03-27 15:11:59 -0600 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-03-28 15:01:04 +0000 |
commit | a466228a616b1b02ede2d4389fefcfc839a54a25 (patch) | |
tree | e5a48f35dc33b0c4d0aeef4327a5960c3b5992e9 /src/gpu/GrClipStackClip.h | |
parent | 41964ed46e241c95cd6c91ac99271c2a232f1b65 (diff) |
Delete GPU alpha clip masks
The cost of switching render targets on each draw to make a custom
clip is enormous. There are virtually no circumstances where this will
outperform our cached, multi-threaded software mask generator. The
tried-and-true approach to clipping on-GPU is with analytic FPs. And
now that we support CCPR clip FPs, there ulitmately should be very few
clip stacks that even require a mask as long as they don't use
deprecated SkClipOps.
Bug: skia:
Change-Id: I79c5558c93c1b99179f1e933d029f69b14ad1ce3
Reviewed-on: https://skia-review.googlesource.com/116724
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'src/gpu/GrClipStackClip.h')
-rw-r--r-- | src/gpu/GrClipStackClip.h | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/src/gpu/GrClipStackClip.h b/src/gpu/GrClipStackClip.h index aeb983468c..05d9f18c88 100644 --- a/src/gpu/GrClipStackClip.h +++ b/src/gpu/GrClipStackClip.h @@ -37,31 +37,14 @@ public: static const char kMaskTestTag[]; private: - static bool PathNeedsSWRenderer(GrContext* context, - const SkIRect& scissorRect, - bool hasUserStencilSettings, - const GrRenderTargetContext*, - const SkMatrix& viewMatrix, - const SkClipStack::Element* element, - GrPathRenderer** prOut, - bool needsStencil); - bool applyClipMask(GrContext*, GrRenderTargetContext*, const GrReducedClip&, bool hasUserStencilSettings, GrAppliedClip*) const; - // Creates an alpha mask of the clip. The mask is a rasterization of elements through the - // rect specified by clipSpaceIBounds. - sk_sp<GrTextureProxy> createAlphaClipMask(GrContext*, const GrReducedClip&) const; - - // Similar to createAlphaClipMask but it rasterizes in SW and uploads to the result texture. + // Creates an alpha mask of the remaining reduced clip elements that could not be handled + // analytically on the GPU. The mask fills the reduced clip's scissor rect. sk_sp<GrTextureProxy> createSoftwareClipMask(GrContext*, const GrReducedClip&, GrRenderTargetContext*) const; - static bool UseSWOnlyPath(GrContext*, - bool hasUserStencilSettings, - const GrRenderTargetContext*, - const GrReducedClip&); - const SkClipStack* fStack; }; |