Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(736)

Unified Diff: src/gpu/GrClipMaskManager.cpp

Issue 2132073002: Pre-crop filled rects to avoid scissor (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nearest filtering for the gm Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrClip.cpp ('k') | src/gpu/GrDrawContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrClipMaskManager.cpp
diff --git a/src/gpu/GrClipMaskManager.cpp b/src/gpu/GrClipMaskManager.cpp
index c591bf11826babd6fdfe9861994a1a8bc8da9e7b..d710fef9b341cb088656eb3511444aea7cbccdb6 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 (!SkRect::Make(scissorSpaceIBounds).contains(devBounds)) {
+ if (!GrClip::CanIgnoreScissor(scissorSpaceIBounds, devBounds)) {
out->makeScissored(scissorSpaceIBounds);
}
return true;
@@ -302,11 +302,11 @@ bool GrClipMaskManager::SetupClipping(GrContext* context,
&clipFP)) {
SkIRect scissorSpaceIBounds(clipSpaceIBounds);
scissorSpaceIBounds.offset(-clip.origin());
- if (!SkRect::Make(scissorSpaceIBounds).contains(devBounds)) {
+ if (GrClip::CanIgnoreScissor(scissorSpaceIBounds, devBounds)) {
+ out->makeFPBased(std::move(clipFP), SkRect::Make(scissorSpaceIBounds));
+ } else {
out->makeScissoredFPBased(std::move(clipFP), scissorSpaceIBounds);
- return true;
}
- out->makeFPBased(std::move(clipFP), SkRect::Make(scissorSpaceIBounds));
return true;
}
}
@@ -369,7 +369,11 @@ bool GrClipMaskManager::SetupClipping(GrContext* context,
// use both stencil and scissor test to the bounds for the final draw.
SkIRect scissorSpaceIBounds(clipSpaceIBounds);
scissorSpaceIBounds.offset(clipSpaceToStencilSpaceOffset);
- out->makeScissoredStencil(scissorSpaceIBounds);
+ if (GrClip::CanIgnoreScissor(scissorSpaceIBounds, devBounds)) {
+ out->makeStencil(true, devBounds);
+ } else {
+ out->makeScissoredStencil(scissorSpaceIBounds);
+ }
return true;
}
« no previous file with comments | « src/gpu/GrClip.cpp ('k') | src/gpu/GrDrawContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698