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

Unified Diff: src/gpu/GrFixedClip.h

Issue 2289363005: Improve usage of window rectangles (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_drawsinreducedclip
Patch Set: Improve usage of window rectangles Created 4 years, 3 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/GrDrawTarget.cpp ('k') | src/gpu/GrFixedClip.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrFixedClip.h
diff --git a/src/gpu/GrFixedClip.h b/src/gpu/GrFixedClip.h
index 8b3a9c1c9e9d7827f687a22be23b9f010502b0e8..6fb7d23ed1a317dc6584b838957f21ca523b553b 100644
--- a/src/gpu/GrFixedClip.h
+++ b/src/gpu/GrFixedClip.h
@@ -9,7 +9,8 @@
#define GrFixedClip_DEFINED
#include "GrClip.h"
-#include "GrTypesPriv.h"
+#include "GrScissorState.h"
+#include "GrWindowRectsState.h"
/**
* GrFixedClip is a clip that gets implemented by fixed-function hardware.
@@ -29,32 +30,26 @@ public:
return fScissorState.intersect(irect);
}
- bool quickContains(const SkRect& rect) const final {
- return !fScissorState.enabled() || GrClip::IsInsideClip(fScissorState.rect(), rect);
+ const GrWindowRectsState& windowRectsState() const { return fWindowRectsState; }
+ bool hasWindowRectangles() const { return fWindowRectsState.enabled(); }
+
+ void disableWindowRectangles() { fWindowRectsState.setDisabled(); }
+
+ void setWindowRectangles(const GrWindowRectangles& windows, const SkIPoint& origin,
+ GrWindowRectsState::Mode mode) {
+ fWindowRectsState.set(windows, origin, mode);
}
- void getConservativeBounds(int width, int height, SkIRect* devResult,
- bool* isIntersectionOfRects) const final;
-
- bool isRRect(const SkRect& rtBounds, SkRRect* rr, bool* aa) const override {
- if (fScissorState.enabled()) {
- SkRect rect = SkRect::Make(fScissorState.rect());
- if (!rect.intersects(rtBounds)) {
- return false;
- }
- rr->setRect(rect);
- *aa = false;
- return true;
- }
- return false;
- };
-
- bool apply(GrContext*, GrDrawContext*, bool useHWAA, bool hasUserStencilSettings,
- GrAppliedClip* out) const final;
+
+ bool quickContains(const SkRect&) const override;
+ void getConservativeBounds(int w, int h, SkIRect* devResult, bool* iior) const override;
+ bool isRRect(const SkRect& rtBounds, SkRRect* rr, bool* aa) const override;
+ bool apply(GrContext*, GrDrawContext*, bool, bool, GrAppliedClip* out) const override;
static const GrFixedClip& Disabled();
private:
- GrScissorState fScissorState;
+ GrScissorState fScissorState;
+ GrWindowRectsState fWindowRectsState;
};
#endif
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/GrFixedClip.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698