diff options
author | Chris Dalton <csmartdalton@google.com> | 2017-11-07 18:24:06 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-11-07 18:24:15 +0000 |
commit | 428e568fd8b0555688f8520c0b57291fbbbb3b69 (patch) | |
tree | 639ffe4f6597b00b6cbee0d93eaec672f49cce6e /src/gpu/GrClip.h | |
parent | 777dc2ef81282883e05d71efb4f4a1b93eec29b0 (diff) |
Revert "Don't use analytic clip FPs when drawing to stencil"
This reverts commit 4c92d4aa3ed653afdff9996b90a1139ed1dc9420.
Reason for revert: Chromecast bot failure
Original change's description:
> Don't use analytic clip FPs when drawing to stencil
>
> It doesn't make sense to multiply by coverage when drawing to stencil.
> This could theoretically work with FPs that discard and/or modify
> the sample mask, but for the time being an analytic FP means one that
> calculates a coverage value.
>
> Bug: skia:7190
> Change-Id: Ic40cf6c19c377cba80bad458993582f5cc07022a
> Reviewed-on: https://skia-review.googlesource.com/67423
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
TBR=bsalomon@google.com,robertphillips@google.com,csmartdalton@google.com
Change-Id: Ie5bd4852c201e47daee0920f5644141bee2d8a46
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:7190
Reviewed-on: https://skia-review.googlesource.com/68400
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'src/gpu/GrClip.h')
-rw-r--r-- | src/gpu/GrClip.h | 37 |
1 files changed, 10 insertions, 27 deletions
diff --git a/src/gpu/GrClip.h b/src/gpu/GrClip.h index 7358e67cb3..bd7d8a1d96 100644 --- a/src/gpu/GrClip.h +++ b/src/gpu/GrClip.h @@ -8,12 +8,13 @@ #ifndef GrClip_DEFINED #define GrClip_DEFINED -#include "GrAppliedClip.h" -#include "GrRenderTargetContext.h" +#include "GrTypes.h" #include "SkRRect.h" #include "SkRect.h" +class GrAppliedClip; class GrContext; +class GrRenderTargetContext; /** * GrClip is an abstract base class for applying a clip. It constructs a clip mask if necessary, and @@ -36,7 +37,8 @@ public: * skipped as it is fully clipped out. */ virtual bool apply(GrContext*, GrRenderTargetContext*, bool useHWAA, - bool hasUserStencilSettings, GrAppliedClip*, SkRect* bounds) const = 0; + bool hasUserStencilSettings, GrAppliedClip* result, + SkRect* bounds) const = 0; virtual ~GrClip() {} @@ -131,32 +133,10 @@ public: } }; - -/** - * GrHardClip never uses coverage FPs. It can only enforce the clip using the already-existing - * stencil buffer contents and/or fixed-function state like scissor. Always aliased if MSAA is off. - */ -class GrHardClip : public GrClip { -public: - /** - * Sets the appropriate hardware state modifications on GrAppliedHardClip that will implement - * the clip. On input 'bounds' is a conservative bounds of the draw that is to be clipped. After - * return 'bounds' has been intersected with a conservative bounds of the clip. A return value - * of false indicates that the draw can be skipped as it is fully clipped out. - */ - virtual bool apply(int rtWidth, int rtHeight, GrAppliedHardClip* out, SkRect* bounds) const = 0; - -private: - bool apply(GrContext*, GrRenderTargetContext* rtc, bool useHWAA, bool hasUserStencilSettings, - GrAppliedClip* out, SkRect* bounds) const final { - return this->apply(rtc->width(), rtc->height(), &out->hardClip(), bounds); - } -}; - /** * Specialized implementation for no clip. */ -class GrNoClip final : public GrHardClip { +class GrNoClip final : public GrClip { private: bool quickContains(const SkRect&) const final { return true; } bool quickContains(const SkRRect&) const final { return true; } @@ -167,7 +147,10 @@ private: *isIntersectionOfRects = true; } } - bool apply(int rtWidth, int rtHeight, GrAppliedHardClip*, SkRect*) const final { return true; } + bool apply(GrContext*, GrRenderTargetContext*, bool, bool, GrAppliedClip*, + SkRect*) const final { + return true; + } bool isRRect(const SkRect&, SkRRect*, GrAA*) const override { return false; } }; |