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 1393553002: Insert clip fragment processor outside GrCMM (Closed) Base URL: https://skia.googlesource.com/skia.git@byebye
Patch Set: add class to friends Created 5 years, 2 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/effects/SkXfermodeImageFilter.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 0c0c10cf30a6eceacf595925e6c4ec6c1d0d4838..5c336e0596df7ed57bea403c7d60a1a0cd66a872 100644
--- a/src/gpu/GrClipMaskManager.h
+++ b/src/gpu/GrClipMaskManager.h
@@ -23,6 +23,25 @@ class GrPathRenderer;
class GrPathRendererChain;
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() {}
+ const GrFragmentProcessor* clipCoverageFragmentProcessor() const { return fClipCoverageFP; }
+
+private:
+ SkAutoTUnref<const GrFragmentProcessor> fClipCoverageFP;
+ 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
@@ -43,10 +62,10 @@ public:
* clip. devBounds is optional but can help optimize clipping.
*/
bool setupClipping(const GrPipelineBuilder&,
- GrPipelineBuilder::AutoRestoreFragmentProcessorState*,
GrPipelineBuilder::AutoRestoreStencil*,
GrScissorState*,
- const SkRect* devBounds);
+ const SkRect* devBounds,
+ GrAppliedClip*);
bool isClipInStencil() const {
return kStencil_ClipMaskType == fCurrClipMaskType;
@@ -77,11 +96,9 @@ private:
// Attempts to install a series of coverage effects to implement the clip. Return indicates
// whether the element list was successfully converted to effects.
- bool installClipEffects(const GrPipelineBuilder&,
- GrPipelineBuilder::AutoRestoreFragmentProcessorState*,
- const GrReducedClip::ElementList&,
- const SkVector& clipOffset,
- const SkRect* devBounds);
+ const GrFragmentProcessor* getAnalyticClipProcessor(const GrReducedClip::ElementList&,
+ const SkVector& clipOffset,
+ const SkRect* devBounds);
// Draws the clip into the stencil buffer
bool createStencilClipMask(GrRenderTarget*,
@@ -164,6 +181,8 @@ private:
kAlpha_ClipMaskType,
} fCurrClipMaskType;
+ static const int kMaxAnalyticElements = 4;
+
GrDrawTarget* fDrawTarget; // This is our owning draw target.
StencilClipMode fClipMode;
« no previous file with comments | « src/effects/SkXfermodeImageFilter.cpp ('k') | src/gpu/GrClipMaskManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698