Index: include/gpu/GrTypesPriv.h |
diff --git a/include/gpu/GrTypesPriv.h b/include/gpu/GrTypesPriv.h |
index abbfdfca064548e0f1f4480e916a275827cc7cb7..8c42d648d08f2a20f52104f8953f58a2c3f38cdb 100644 |
--- a/include/gpu/GrTypesPriv.h |
+++ b/include/gpu/GrTypesPriv.h |
@@ -425,6 +425,13 @@ struct GrScissorState { |
GrScissorState(const SkIRect& rect) : fEnabled(true), fRect(rect) {} |
void setDisabled() { fEnabled = false; } |
void set(const SkIRect& rect) { fRect = rect; fEnabled = true; } |
+ bool SK_WARN_UNUSED_RESULT intersect(const SkIRect& rect) { |
+ if (!fEnabled) { |
+ this->set(rect); |
+ return true; |
+ } |
+ return fRect.intersect(rect); |
+ } |
bool operator==(const GrScissorState& other) const { |
return fEnabled == other.fEnabled && |
(false == fEnabled || fRect == other.fRect); |