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

Unified Diff: src/gpu/GrClipMaskManager.h

Issue 1971343002: Convert GrClip to an abstract base class (Closed) Base URL: https://skia.googlesource.com/skia.git@upload2_clipout
Patch Set: fix crash Created 4 years, 7 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/GrClip.cpp ('k') | src/gpu/GrClipMaskManager.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrClipMaskManager.h
diff --git a/src/gpu/GrClipMaskManager.h b/src/gpu/GrClipMaskManager.h
index 2b70f02e38689504749ab7096169c146262035d6..ef5fbc14d0ecc5ad7558d336a1493b9011d6070c 100644
--- a/src/gpu/GrClipMaskManager.h
+++ b/src/gpu/GrClipMaskManager.h
@@ -17,7 +17,8 @@
#include "SkTLList.h"
#include "SkTypes.h"
-class GrClip;
+class GrAppliedClip;
+class GrClipStackClip;
class GrDrawTarget;
class GrPathRenderer;
class GrPathRendererChain;
@@ -26,28 +27,6 @@ class GrTexture;
class SkPath;
/**
- * Produced by GrClipMaskManager. It provides a set of modifications to the drawing state that
- * are used to create the final GrPipeline for a GrBatch. This is a work in progress. It will
- * eventually encapsulate all mechanisms for modifying the scissor, shaders, and stencil state
- * to implement clipping.
- */
-class GrAppliedClip : public SkNoncopyable {
-public:
- GrAppliedClip() : fHasStencilClip(false) {}
- const GrFragmentProcessor* clipCoverageFragmentProcessor() const { return fClipCoverageFP; }
- const GrScissorState& scissorState() const { return fScissorState; }
- bool hasStencilClip() const { return fHasStencilClip; }
-
-private:
- SkAutoTUnref<const GrFragmentProcessor> fClipCoverageFP;
- GrScissorState fScissorState;
- bool fHasStencilClip;
- friend class GrClipMaskManager;
-
- typedef SkNoncopyable INHERITED;
-};
-
-/**
* The clip mask creator handles the generation of the clip mask. If anti
* aliasing is requested it will (in the future) generate a single channel
* (8bit) mask. If no anti aliasing is requested it will generate a 1-bit
@@ -57,7 +36,7 @@ private:
*/
class GrClipMaskManager : SkNoncopyable {
public:
- GrClipMaskManager(GrDrawTarget* owner);
+ GrClipMaskManager(GrDrawTarget* owner) : fDrawTarget(owner) {}
/**
* Creates a clip mask if necessary as a stencil buffer or alpha texture
@@ -65,7 +44,7 @@ public:
* then the draw can be skipped. devBounds is optional but can help optimize
* clipping.
*/
- bool setupClipping(const GrPipelineBuilder&, const GrClip&, const SkRect* devBounds,
+ bool setupClipping(const GrPipelineBuilder&, const GrClipStackClip&, const SkRect* devBounds,
GrAppliedClip*);
private:
@@ -85,20 +64,6 @@ private:
const SkMatrix& viewMatrix,
const SkClipStack::Element* element);
- /**
- * Informs the helper function adjustStencilParams() about how the stencil
- * buffer clip is being used.
- */
- enum StencilClipMode {
- // Draw to the clip bit of the stencil buffer
- kModifyClip_StencilClipMode,
- // Clip against the existing representation of the clip in the high bit
- // of the stencil buffer.
- kRespectClip_StencilClipMode,
- // Neither writing to nor clipping against the clip bit.
- kIgnoreClip_StencilClipMode,
- };
-
// Attempts to install a series of coverage effects to implement the clip. Return indicates
// whether the element list was successfully converted to processors. *fp may be nullptr even
// when the function succeeds because all the elements were ignored. TODO: Make clip reduction
@@ -146,7 +111,6 @@ private:
static const int kMaxAnalyticElements = 4;
GrDrawTarget* fDrawTarget; // This is our owning draw target.
- StencilClipMode fClipMode;
typedef SkNoncopyable INHERITED;
};
« no previous file with comments | « src/gpu/GrClip.cpp ('k') | src/gpu/GrClipMaskManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698