diff options
author | Chris Dalton <csmartdalton@google.com> | 2018-03-30 15:59:38 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-03-30 17:03:16 +0000 |
commit | c534808ba21e61507fe3ebf9f23d230a71e5ada7 (patch) | |
tree | 3ff1d39feb8fe4c464950178c3bc1ecfaf403b11 /src/gpu/GrClipStackClip.h | |
parent | 7a002c36ce3faed3b3201453770b8f18eecc8f2f (diff) |
Revert "Delete GPU alpha clip masks"
This reverts commit a466228a616b1b02ede2d4389fefcfc839a54a25.
Reason for revert: Turned up a vulkan driver bug
Original change's description:
> 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>
TBR=robertphillips@google.com,brianosman@google.com,csmartdalton@google.com
# Not skipping CQ checks because original CL landed > 1 day ago.
Bug: skia:
Change-Id: Iba289e00ba2eca7084dc8517491cfb5f6ab6266f
Reviewed-on: https://skia-review.googlesource.com/117420
Reviewed-by: Chris Dalton <csmartdalton@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, 19 insertions, 2 deletions
diff --git a/src/gpu/GrClipStackClip.h b/src/gpu/GrClipStackClip.h index 05d9f18c88..aeb983468c 100644 --- a/src/gpu/GrClipStackClip.h +++ b/src/gpu/GrClipStackClip.h @@ -37,14 +37,31 @@ 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 remaining reduced clip elements that could not be handled - // analytically on the GPU. The mask fills the reduced clip's scissor rect. + // 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. sk_sp<GrTextureProxy> createSoftwareClipMask(GrContext*, const GrReducedClip&, GrRenderTargetContext*) const; + static bool UseSWOnlyPath(GrContext*, + bool hasUserStencilSettings, + const GrRenderTargetContext*, + const GrReducedClip&); + const SkClipStack* fStack; }; |