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

Unified Diff: src/gpu/GrClip.cpp

Issue 2246113002: Convert GrAppliedClip interface to builder style (Closed) Base URL: https://skia.googlesource.com/skia.git@fixstencilpath
Patch Set: Convert GrAppliedClip interface to builder style Created 4 years, 4 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 | « include/gpu/GrTypesPriv.h ('k') | src/gpu/GrClipStackClip.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrClip.cpp
diff --git a/src/gpu/GrClip.cpp b/src/gpu/GrClip.cpp
index 3eccd801b5f5f7ed6810ff0e343ab73ee867f9f6..ef9c9cdfa6b275028237c754f695ef977f6a34bf 100644
--- a/src/gpu/GrClip.cpp
+++ b/src/gpu/GrClip.cpp
@@ -21,10 +21,7 @@ bool GrFixedClip::quickContains(const SkRect& rect) const {
if (fHasStencilClip) {
return false;
}
- if (!fScissorState.enabled()) {
- return true;
- }
- return fScissorState.rect().contains(rect);
+ return !fScissorState.enabled() || GrClip::IsInsideClip(fScissorState.rect(), rect);
}
void GrFixedClip::getConservativeBounds(int width, int height, SkIRect* devResult,
@@ -40,32 +37,25 @@ void GrFixedClip::getConservativeBounds(int width, int height, SkIRect* devResul
}
}
-bool GrFixedClip::apply(GrContext*,
- GrDrawContext* drawContext,
- const SkRect* devBounds,
- bool isHWAntiAlias,
- bool hasUserStencilSettings,
- GrAppliedClip* out) const {
- SkASSERT(!fDeviceBounds.isLargest());
+bool GrFixedClip::apply(GrContext*, GrDrawContext* drawContext, bool isHWAntiAlias,
+ bool hasUserStencilSettings, GrAppliedClip* out) const {
if (fScissorState.enabled()) {
SkIRect tightScissor;
if (!tightScissor.intersect(fScissorState.rect(),
SkIRect::MakeWH(drawContext->width(), drawContext->height()))) {
return false;
}
- if (devBounds && IsOutsideClip(tightScissor, *devBounds)) {
+ if (IsOutsideClip(tightScissor, out->clippedDrawBounds())) {
return false;
}
- if (!devBounds || !IsInsideClip(fScissorState.rect(), *devBounds)) {
- if (fHasStencilClip) {
- out->makeScissoredStencil(tightScissor, &fDeviceBounds);
- } else {
- out->makeScissored(tightScissor);
- }
- return true;
+ if (!IsInsideClip(fScissorState.rect(), out->clippedDrawBounds())) {
+ out->addScissor(tightScissor);
}
}
- out->makeStencil(fHasStencilClip, fDeviceBounds);
+ if (fHasStencilClip) {
+ out->addStencilClip();
+ }
+
return true;
}
« no previous file with comments | « include/gpu/GrTypesPriv.h ('k') | src/gpu/GrClipStackClip.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698