diff options
author | Brian Salomon <bsalomon@google.com> | 2017-03-14 13:42:58 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-03-14 18:51:49 +0000 |
commit | 97180af7f5e577a451367aa0c15cfaff1b6076f5 (patch) | |
tree | cd1f78c7a03f0b38306a15a819a25fe7df3aa6f1 /src/gpu/GrFixedClip.cpp | |
parent | 1619c2241ab9d00b0615ef6a63a553e9fe04962c (diff) |
Compute clipped draw bounds outside GrAppliedClip.
We will be storing GrAppliedClips alongside ops. The op already stores the
clipped bounds. If GrAppliedClip has draw bounds then as ops combine the
GrAppliedClip's bounds should be merged to be consistent. However, we won't
actually ever use those bounds again so it would be wasteful to merge them.
Change-Id: I4ef3010dc04761e256120a2e0e074bc3c6ff6ca1
Reviewed-on: https://skia-review.googlesource.com/9642
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'src/gpu/GrFixedClip.cpp')
-rw-r--r-- | src/gpu/GrFixedClip.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gpu/GrFixedClip.cpp b/src/gpu/GrFixedClip.cpp index d584ee119e..e551f9b966 100644 --- a/src/gpu/GrFixedClip.cpp +++ b/src/gpu/GrFixedClip.cpp @@ -45,18 +45,18 @@ bool GrFixedClip::isRRect(const SkRect& rtBounds, SkRRect* rr, GrAA* aa) const { return false; }; -bool GrFixedClip::apply(GrContext*, GrRenderTargetContext* rtc, - bool, bool, GrAppliedClip* out) const { +bool GrFixedClip::apply(GrContext*, GrRenderTargetContext* rtc, bool, bool, GrAppliedClip* out, + SkRect* bounds) const { if (fScissorState.enabled()) { SkIRect tightScissor = SkIRect::MakeWH(rtc->width(), rtc->height()); if (!tightScissor.intersect(fScissorState.rect())) { return false; } - if (IsOutsideClip(tightScissor, out->clippedDrawBounds())) { + if (IsOutsideClip(tightScissor, *bounds)) { return false; } - if (!IsInsideClip(fScissorState.rect(), out->clippedDrawBounds())) { - out->addScissor(tightScissor); + if (!IsInsideClip(fScissorState.rect(), *bounds)) { + out->addScissor(tightScissor, bounds); } } |