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

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

Issue 1293973003: Path stenciling in GrBatch (Closed) Base URL: https://skia.googlesource.com/skia.git@rmcode
Patch Set: header order tweak 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/GrStencilPathBatch.h
diff --git a/src/gpu/batches/GrStencilPathBatch.h b/src/gpu/batches/GrStencilPathBatch.h
new file mode 100644
index 0000000000000000000000000000000000000000..908dd1f59324d078c496dd7d92073504bf564e5e
--- /dev/null
+++ b/src/gpu/batches/GrStencilPathBatch.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright 2015 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef GrStencilPathBatch_DEFINED
+#define GrStencilPathBatch_DEFINED
+
+#include "GrBatch.h"
+#include "GrBatchFlushState.h"
+#include "GrGpu.h"
+#include "GrPath.h"
+#include "GrPathRendering.h"
+#include "GrRenderTarget.h"
+
+class GrStencilPathBatch final : public GrBatch {
+public:
+ static GrBatch* Create(const SkMatrix& viewMatrix,
+ bool useHWAA,
+ const GrStencilSettings& stencil,
+ const GrScissorState& scissor,
+ GrRenderTarget* renderTarget,
+ const GrPath* path) {
+ return SkNEW_ARGS(GrStencilPathBatch, (viewMatrix, useHWAA, stencil, scissor, renderTarget,
+ path));
+ }
+
+ const char* name() const override { return "StencilPath"; }
+
+ uint32_t renderTargetUniqueID() const { return fRenderTarget.get()->getUniqueID(); }
+
+ SkString dumpInfo() const override {
+ SkString string;
+ string.printf("PATH: 0x%p, AA:%d", fPath.get(), fUseHWAA);
+ return string;
+ }
+
+private:
+ GrStencilPathBatch(const SkMatrix& viewMatrix,
+ bool useHWAA,
+ const GrStencilSettings& stencil,
+ const GrScissorState& scissor,
+ GrRenderTarget* renderTarget,
+ const GrPath* path)
+ : fViewMatrix(viewMatrix)
+ , fUseHWAA(useHWAA)
+ , fStencil(stencil)
+ , fScissor(scissor)
+ , fRenderTarget(renderTarget)
+ , fPath(path) {}
+
+ bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override { return false; }
+
+ void onPrepare(GrBatchFlushState*) override {}
+
+ void onDraw(GrBatchFlushState* state) override {
+ GrPathRendering::StencilPathArgs args(fUseHWAA, fRenderTarget.get(), &fViewMatrix,
+ &fScissor, &fStencil);
+ state->gpu()->pathRendering()->stencilPath(args, fPath.get());
+ }
+
+ SkMatrix fViewMatrix;
+ bool fUseHWAA;
+ GrStencilSettings fStencil;
+ GrScissorState fScissor;
+ GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget;
+ GrPendingIOResource<const GrPath, kRead_GrIOType> fPath;
+};
+
+#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