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

Unified Diff: src/gpu/GrClipMaskManager.h

Issue 683933003: Clip mask manager moved to ClipTarget (Closed) Base URL: https://skia.googlesource.com/skia.git@clear_stencil_clip_on_drawinfo
Patch Set: rebase on master Created 6 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 | « no previous file | 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 fe1ff0efde6758e3ade70139361203b068775daf..e4d7223c7e0cdc807d795da5f40020e5b39bb2e3 100644
--- a/src/gpu/GrClipMaskManager.h
+++ b/src/gpu/GrClipMaskManager.h
@@ -22,7 +22,7 @@
#include "SkTLList.h"
#include "SkTypes.h"
-class GrGpu;
+class GrClipTarget;
class GrPathRenderer;
class GrPathRendererChain;
class GrTexture;
@@ -39,8 +39,8 @@ class SkPath;
class GrClipMaskManager : SkNoncopyable {
public:
GrClipMaskManager()
- : fGpu(NULL)
- , fCurrClipMaskType(kNone_ClipMaskType) {
+ : fCurrClipMaskType(kNone_ClipMaskType)
+ , fClipTarget(NULL) {
}
// The state of the scissor is controlled by the clip manager, no one else should set
@@ -64,7 +64,7 @@ public:
const SkRect* devBounds,
GrDrawState::AutoRestoreEffects*,
GrDrawState::AutoRestoreStencil*,
- ScissorState* scissorState);
+ ScissorState*);
/**
* Purge resources to free up memory. TODO: This class shouldn't hold any long lived refs
@@ -89,10 +89,19 @@ public:
return fAACache.getContext();
}
- void setGpu(GrGpu* gpu);
+ void setClipTarget(GrClipTarget*);
+
+ void adjustPathStencilParams(GrStencilSettings*);
- void adjustPathStencilParams(GrStencilSettings* settings);
private:
+ enum PrivateDrawStateStateBits {
+ kFirstBit = (GrDrawState::kLastPublicStateBit << 1),
+
+ kModifyStencilClip_StateBit = kFirstBit, // allows draws to modify
+ // stencil bits used for
+ // clipping.
+ };
+
/**
* Informs the helper function adjustStencilParams() about how the stencil
* buffer clip is being used.
@@ -107,21 +116,6 @@ private:
kIgnoreClip_StencilClipMode,
};
- GrGpu* fGpu;
-
- /**
- * We may represent the clip as a mask in the stencil buffer or as an alpha
- * texture. It may be neither because the scissor rect suffices or we
- * haven't yet examined the clip.
- */
- enum ClipMaskType {
- kNone_ClipMaskType,
- kStencil_ClipMaskType,
- kAlpha_ClipMaskType,
- } fCurrClipMaskType;
-
- GrClipMaskCache fAACache; // cache for the AA path
-
// 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 GrReducedClip::ElementList&,
@@ -196,6 +190,20 @@ private:
StencilClipMode mode,
int stencilBitCnt);
+ /**
+ * We may represent the clip as a mask in the stencil buffer or as an alpha
+ * texture. It may be neither because the scissor rect suffices or we
+ * haven't yet examined the clip.
+ */
+ enum ClipMaskType {
+ kNone_ClipMaskType,
+ kStencil_ClipMaskType,
+ kAlpha_ClipMaskType,
+ } fCurrClipMaskType;
+
+ GrClipMaskCache fAACache; // cache for the AA path
+ GrClipTarget* fClipTarget;
+
typedef SkNoncopyable INHERITED;
};
« no previous file with comments | « no previous file | src/gpu/GrClipMaskManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698