aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrClipMaskManager.cpp
diff options
context:
space:
mode:
authorGravatar msarett <msarett@google.com>2016-07-12 18:48:21 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-07-12 18:48:21 -0700
commitba3880fa6d47d467bfcf4db80c553f051336e406 (patch)
tree18e18ae8c72e79807aef9eb5cece8befd49ef770 /src/gpu/GrClipMaskManager.cpp
parent634b43008025d039f3f2f1f6c01e8044ffbb901f (diff)
Revert of Pre-crop filled rects to avoid scissor (patchset #6 id:100001 of https://codereview.chromium.org/2132073002/ )
Reason for revert: I think this is still causing a test failure on Chrome windows bots. https://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_x64_rel_ng/builds/243928/steps/cc_unittests%20%28with%20patch%29%20on%20Windows-7-SP1/logs/stdio Original issue's description: > Pre-crop filled rects to avoid scissor > > Updates GrDrawContext to crop filled rects to the clip bounds before > creating batches for them. Also adds clipping logic to ignore scissor > when the draw falls completely inside. These two changes combined > reduce API traffic and improve batching. > > In the future this can and should be improved by switching to floating > point clip boundaries, thus allowing us to throw out non pixel aligned > rectangle clips as well. > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2132073002 > > Committed: https://skia.googlesource.com/skia/+/7969838702135b9f127bd738728da61bc49b050a > Committed: https://skia.googlesource.com/skia/+/86de59f4a99b5f54be0483c60ff0335be55b2bdf TBR=bsalomon@google.com,robertphillips@google.com,csmartdalton@google.com # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review-Url: https://codereview.chromium.org/2140253004
Diffstat (limited to 'src/gpu/GrClipMaskManager.cpp')
-rw-r--r--src/gpu/GrClipMaskManager.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp
index d710fef9b3..c591bf1182 100644
--- a/src/gpu/GrClipMaskManager.cpp
+++ b/src/gpu/GrClipMaskManager.cpp
@@ -268,7 +268,7 @@ bool GrClipMaskManager::SetupClipping(GrContext* context,
} else {
SkIRect scissorSpaceIBounds(clipSpaceIBounds);
scissorSpaceIBounds.offset(-clip.origin());
- if (!GrClip::CanIgnoreScissor(scissorSpaceIBounds, devBounds)) {
+ if (!SkRect::Make(scissorSpaceIBounds).contains(devBounds)) {
out->makeScissored(scissorSpaceIBounds);
}
return true;
@@ -302,11 +302,11 @@ bool GrClipMaskManager::SetupClipping(GrContext* context,
&clipFP)) {
SkIRect scissorSpaceIBounds(clipSpaceIBounds);
scissorSpaceIBounds.offset(-clip.origin());
- if (GrClip::CanIgnoreScissor(scissorSpaceIBounds, devBounds)) {
- out->makeFPBased(std::move(clipFP), SkRect::Make(scissorSpaceIBounds));
- } else {
+ if (!SkRect::Make(scissorSpaceIBounds).contains(devBounds)) {
out->makeScissoredFPBased(std::move(clipFP), scissorSpaceIBounds);
+ return true;
}
+ out->makeFPBased(std::move(clipFP), SkRect::Make(scissorSpaceIBounds));
return true;
}
}
@@ -369,11 +369,7 @@ bool GrClipMaskManager::SetupClipping(GrContext* context,
// use both stencil and scissor test to the bounds for the final draw.
SkIRect scissorSpaceIBounds(clipSpaceIBounds);
scissorSpaceIBounds.offset(clipSpaceToStencilSpaceOffset);
- if (GrClip::CanIgnoreScissor(scissorSpaceIBounds, devBounds)) {
- out->makeStencil(true, devBounds);
- } else {
- out->makeScissoredStencil(scissorSpaceIBounds);
- }
+ out->makeScissoredStencil(scissorSpaceIBounds);
return true;
}