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

Unified Diff: include/gpu/GrClip.h

Issue 1993263002: Make GrAppliedClip friendless (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Make GrAppliedClip friendless 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 | « no previous file | src/gpu/GrClip.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 68a4eb92241df7286f212c507f72ea38fbe0d2ce..751db4dac8531893c0c2ad71937529332624e4e5 100644
--- a/include/gpu/GrClip.h
+++ b/include/gpu/GrClip.h
@@ -19,20 +19,43 @@ class GrPipelineBuilder;
* Produced by GrClip. It provides a set of modifications to the drawing state that are used to
* create the final GrPipeline for a GrBatch.
*/
-class GrAppliedClip {
+class GrAppliedClip : public SkNoncopyable {
public:
GrAppliedClip() : fHasStencilClip(false) {}
- const GrFragmentProcessor* clipCoverageFragmentProcessor() const { return fClipCoverageFP; }
+ const GrFragmentProcessor* clipCoverageFragmentProcessor() const {
+ return fClipCoverageFP.get();
+ }
const GrScissorState& scissorState() const { return fScissorState; }
bool hasStencilClip() const { return fHasStencilClip; }
-private:
- SkAutoTUnref<const GrFragmentProcessor> fClipCoverageFP;
- GrScissorState fScissorState;
- bool fHasStencilClip;
+ void makeStencil(bool hasStencil) {
+ fClipCoverageFP = nullptr;
+ fScissorState.setDisabled();
+ fHasStencilClip = hasStencil;
+ }
+
+ void makeScissoredStencil(bool hasStencil, const SkIRect& scissor) {
+ fClipCoverageFP = nullptr;
+ fScissorState.set(scissor);
+ fHasStencilClip = hasStencil;
+ }
+
+ void makeFPBased(sk_sp<const GrFragmentProcessor> fp) {
+ fClipCoverageFP = fp;
+ fScissorState.setDisabled();
+ fHasStencilClip = false;
+ }
- friend class GrFixedClip;
- friend class GrClipMaskManager;
+ void makeScissoredFPBased(sk_sp<const GrFragmentProcessor> fp, SkIRect& scissor) {
+ fClipCoverageFP = fp;
+ fScissorState.set(scissor);
+ fHasStencilClip = false;
+ }
+
+private:
+ sk_sp<const GrFragmentProcessor> fClipCoverageFP;
+ GrScissorState fScissorState;
+ bool fHasStencilClip;
typedef SkNoncopyable INHERITED;
};
« no previous file with comments | « no previous file | src/gpu/GrClip.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698