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

Unified Diff: include/gpu/GrClip.h

Issue 2251573002: Implement difference clip rects with window rectangles (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: return type 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 | « gyp/gpu.gypi ('k') | src/gpu/GrAppliedClip.h » ('j') | src/gpu/GrCaps.cpp » ('J')
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 a6a0a665bdca0174f5937bca753eb662a9a7ee34..6457d03051e8fc22de32cc8d6a9fa7abbe7ab42f 100644
--- a/include/gpu/GrClip.h
+++ b/include/gpu/GrClip.h
@@ -11,55 +11,10 @@
#include "GrFragmentProcessor.h"
#include "GrTypesPriv.h"
+class GrAppliedClip;
class GrDrawContext;
/**
- * 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 : public SkNoncopyable {
-public:
- GrAppliedClip(const SkRect& drawBounds)
- : fHasStencilClip(false)
- , fClippedDrawBounds(drawBounds) {
- }
-
- const GrScissorState& scissorState() const { return fScissorState; }
- GrFragmentProcessor* clipCoverageFragmentProcessor() const { return fClipCoverageFP.get(); }
- bool hasStencilClip() const { return fHasStencilClip; }
-
- /**
- * Intersects the applied clip with the provided rect. Returns false if the draw became empty.
- */
- bool addScissor(const SkIRect& irect) {
- return fScissorState.intersect(irect) && fClippedDrawBounds.intersect(SkRect::Make(irect));
- }
-
- void addCoverageFP(sk_sp<GrFragmentProcessor> fp) {
- SkASSERT(!fClipCoverageFP);
- fClipCoverageFP = fp;
- }
-
- void addStencilClip() {
- SkASSERT(!fHasStencilClip);
- fHasStencilClip = true;
- }
-
- /**
- * Returns the device bounds of the draw after clip has been applied. TODO: Ideally this would
- * consider the combined effect of all clipping techniques in play (scissor, stencil, fp, etc.).
- */
- const SkRect& clippedDrawBounds() const { return fClippedDrawBounds; }
-
-private:
- GrScissorState fScissorState;
- sk_sp<GrFragmentProcessor> fClipCoverageFP;
- bool fHasStencilClip;
- SkRect fClippedDrawBounds;
- typedef SkNoncopyable INHERITED;
-};
-
-/**
* GrClip is an abstract base class for applying a clip. It constructs a clip mask if necessary, and
* fills out a GrAppliedClip instructing the caller on how to set up the draw state.
*/
« no previous file with comments | « gyp/gpu.gypi ('k') | src/gpu/GrAppliedClip.h » ('j') | src/gpu/GrCaps.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698