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

Unified Diff: include/gpu/GrClip.h

Issue 2254343003: Move GrFixedClip into src directory (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 | « gyp/gpu.gypi ('k') | src/core/SkImageFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrClip.h
diff --git a/include/gpu/GrClip.h b/include/gpu/GrClip.h
index 6457d03051e8fc22de32cc8d6a9fa7abbe7ab42f..168827b9f8aab5d9451228aa0bdee719580bf0ba 100644
--- a/include/gpu/GrClip.h
+++ b/include/gpu/GrClip.h
@@ -8,10 +8,11 @@
#ifndef GrClip_DEFINED
#define GrClip_DEFINED
-#include "GrFragmentProcessor.h"
-#include "GrTypesPriv.h"
+#include "SkRect.h"
+#include "SkRRect.h"
class GrAppliedClip;
+class GrContext;
class GrDrawContext;
/**
@@ -108,46 +109,19 @@ public:
*/
class GrNoClip final : public GrClip {
private:
- bool quickContains(const SkRect&) const final { return true; }
+ bool quickContains(const SkRect&) const final {
+ return true;
+ }
void getConservativeBounds(int width, int height, SkIRect* devResult,
- bool* isIntersectionOfRects) const final;
- bool apply(GrContext*, GrDrawContext*, bool, bool, GrAppliedClip*) const final { return true; }
-};
-
-/**
- * GrFixedClip is a clip that can be represented by fixed-function hardware. It never modifies the
- * stencil buffer itself, but can be configured to use whatever clip is already there.
- */
-class GrFixedClip final : public GrClip {
-public:
- GrFixedClip() : fHasStencilClip(false) {}
- GrFixedClip(const SkIRect& scissorRect)
- : fScissorState(scissorRect)
- , fHasStencilClip(false) {}
-
- void reset() {
- fScissorState.setDisabled();
- fHasStencilClip = false;
+ bool* isIntersectionOfRects) const final {
+ devResult->setXYWH(0, 0, width, height);
+ if (isIntersectionOfRects) {
+ *isIntersectionOfRects = true;
+ }
}
-
- void reset(const SkIRect& scissorRect) {
- fScissorState.set(scissorRect);
- fHasStencilClip = false;
+ bool apply(GrContext*, GrDrawContext*, bool, bool, GrAppliedClip*) const final {
+ return true;
}
-
- void enableStencilClip() { fHasStencilClip = true; }
- void disableStencilClip() { fHasStencilClip = false; }
-
- bool quickContains(const SkRect&) const final;
- void getConservativeBounds(int width, int height, SkIRect* devResult,
- bool* isIntersectionOfRects) const final;
-
-private:
- bool apply(GrContext*, GrDrawContext*, bool useHWAA, bool hasUserStencilSettings,
- GrAppliedClip* out) const final;
-
- GrScissorState fScissorState;
- bool fHasStencilClip;
};
#endif
« no previous file with comments | « gyp/gpu.gypi ('k') | src/core/SkImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698