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

Unified Diff: src/gpu/GrFixedClip.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 | « src/gpu/GrDrawContext.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
new file mode 100644
index 0000000000000000000000000000000000000000..01498c11613429330606e833ce29cfb9ee6ac9dd
--- /dev/null
+++ b/src/gpu/GrFixedClip.h
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2016 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef GrFixedClip_DEFINED
+#define GrFixedClip_DEFINED
+
+#include "GrClip.h"
+#include "GrTypesPriv.h"
+
+/**
+ * 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;
+ }
+
+ void reset(const SkIRect& scissorRect) {
+ fScissorState.set(scissorRect);
+ fHasStencilClip = false;
+ }
+
+ 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 | « src/gpu/GrDrawContext.cpp ('k') | src/gpu/GrFixedClip.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698