Index: src/gpu/GrFixedClip.cpp |
diff --git a/src/gpu/GrFixedClip.cpp b/src/gpu/GrFixedClip.cpp |
index ebdd49bbf80f1ea789c8d1a5b61a94337ecf035a..7385028bafb0197e61baae0f8bac1372259368d4 100644 |
--- a/src/gpu/GrFixedClip.cpp |
+++ b/src/gpu/GrFixedClip.cpp |
@@ -10,25 +10,45 @@ |
#include "GrAppliedClip.h" |
#include "GrDrawContext.h" |
-void GrFixedClip::getConservativeBounds(int width, int height, SkIRect* devResult, |
- bool* isIntersectionOfRects) const { |
- devResult->setXYWH(0, 0, width, height); |
+bool GrFixedClip::quickContains(const SkRect& rect) const { |
+ if (fWindowRectsState.enabled()) { |
+ return false; |
+ } |
+ return !fScissorState.enabled() || GrClip::IsInsideClip(fScissorState.rect(), rect); |
+} |
+ |
+void GrFixedClip::getConservativeBounds(int w, int h, SkIRect* devResult, bool* iior) const { |
+ devResult->setXYWH(0, 0, w, h); |
if (fScissorState.enabled()) { |
if (!devResult->intersect(fScissorState.rect())) { |
devResult->setEmpty(); |
} |
} |
- if (isIntersectionOfRects) { |
- *isIntersectionOfRects = true; |
+ if (iior) { |
+ *iior = true; |
} |
} |
-bool GrFixedClip::apply(GrContext*, GrDrawContext* drawContext, bool isHWAntiAlias, |
- bool hasUserStencilSettings, GrAppliedClip* out) const { |
+bool GrFixedClip::isRRect(const SkRect& rtBounds, SkRRect* rr, bool* aa) const { |
+ if (fWindowRectsState.enabled()) { |
+ return false; |
+ } |
if (fScissorState.enabled()) { |
- SkIRect tightScissor; |
- if (!tightScissor.intersect(fScissorState.rect(), |
- SkIRect::MakeWH(drawContext->width(), drawContext->height()))) { |
+ SkRect rect = SkRect::Make(fScissorState.rect()); |
+ if (!rect.intersects(rtBounds)) { |
+ return false; |
+ } |
+ rr->setRect(rect); |
+ *aa = false; |
+ return true; |
+ } |
+ return false; |
+}; |
+ |
+bool GrFixedClip::apply(GrContext*, GrDrawContext* dc, bool, bool, GrAppliedClip* out) const { |
+ if (fScissorState.enabled()) { |
+ SkIRect tightScissor = SkIRect::MakeWH(dc->width(), dc->height()); |
+ if (!tightScissor.intersect(fScissorState.rect())) { |
return false; |
} |
if (IsOutsideClip(tightScissor, out->clippedDrawBounds())) { |
@@ -39,6 +59,10 @@ bool GrFixedClip::apply(GrContext*, GrDrawContext* drawContext, bool isHWAntiAli |
} |
} |
+ if (fWindowRectsState.enabled()) { |
+ out->addWindowRectangles(fWindowRectsState); |
+ } |
+ |
return true; |
} |