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

Unified Diff: src/gpu/batches/GrClearBatch.h

Issue 1288963004: ClearStencilClip in GrBatch (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tiny Created 5 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 | « src/gpu/GrTargetCommands.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrClearBatch.h
diff --git a/src/gpu/batches/GrClearBatch.h b/src/gpu/batches/GrClearBatch.h
index 0a2153fbf3e97d7fbcf8c0c0728f9a7fdf2631b4..f13b073d754b1762781e7b7b91f4314fa9711af5 100644
--- a/src/gpu/batches/GrClearBatch.h
+++ b/src/gpu/batches/GrClearBatch.h
@@ -52,4 +52,40 @@ private:
GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget;
};
+class GrClearStencilClipBatch final : public GrBatch {
+public:
+ GrClearStencilClipBatch(const SkIRect& rect, bool insideClip, GrRenderTarget* rt)
+ : fRect(rect)
+ , fInsideClip(insideClip)
+ , fRenderTarget(rt) {
+ this->initClassID<GrClearStencilClipBatch>();
+ fBounds = SkRect::Make(rect);
+ }
+
+ const char* name() const override { return "ClearStencilClip"; }
+
+ uint32_t renderTargetUniqueID() const override { return fRenderTarget.get()->getUniqueID(); }
+
+ SkString dumpInfo() const override {
+ SkString string;
+ string.printf("Rect [L: %d, T: %d, R: %d, B: %d], IC: %d, RT: 0x%p",
+ fRect.fLeft, fRect.fTop, fRect.fRight, fRect.fBottom, fInsideClip,
+ fRenderTarget.get());
+ return string;
+ }
+
+private:
+ bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override { return false; }
+
+ void onPrepare(GrBatchFlushState*) override {}
+
+ void onDraw(GrBatchFlushState* state) override {
+ state->gpu()->clearStencilClip(fRect, fInsideClip, fRenderTarget.get());
+ }
+
+ SkIRect fRect;
+ bool fInsideClip;
+ GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget;
+};
+
#endif
« no previous file with comments | « src/gpu/GrTargetCommands.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698