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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « src/gpu/GrTargetCommands.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2015 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 #ifndef GrStencilPathBatch_DEFINED
9 #define GrStencilPathBatch_DEFINED
10
11 #include "GrBatch.h"
12 #include "GrBatchFlushState.h"
13 #include "GrGpu.h"
14 #include "GrPath.h"
15 #include "GrPathRendering.h"
16 #include "GrRenderTarget.h"
17
18 class GrStencilPathBatch final : public GrBatch {
19 public:
20 static GrBatch* Create(const SkMatrix& viewMatrix,
21 bool useHWAA,
22 const GrStencilSettings& stencil,
23 const GrScissorState& scissor,
24 GrRenderTarget* renderTarget,
25 const GrPath* path) {
26 return SkNEW_ARGS(GrStencilPathBatch, (viewMatrix, useHWAA, stencil, sci ssor, renderTarget,
27 path));
28 }
29
30 const char* name() const override { return "StencilPath"; }
31
32 uint32_t renderTargetUniqueID() const { return fRenderTarget.get()->getUniqu eID(); }
33
34 SkString dumpInfo() const override {
35 SkString string;
36 string.printf("PATH: 0x%p, AA:%d", fPath.get(), fUseHWAA);
37 return string;
38 }
39
40 private:
41 GrStencilPathBatch(const SkMatrix& viewMatrix,
42 bool useHWAA,
43 const GrStencilSettings& stencil,
44 const GrScissorState& scissor,
45 GrRenderTarget* renderTarget,
46 const GrPath* path)
47 : fViewMatrix(viewMatrix)
48 , fUseHWAA(useHWAA)
49 , fStencil(stencil)
50 , fScissor(scissor)
51 , fRenderTarget(renderTarget)
52 , fPath(path) {}
53
54 bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override { return f alse; }
55
56 void onPrepare(GrBatchFlushState*) override {}
57
58 void onDraw(GrBatchFlushState* state) override {
59 GrPathRendering::StencilPathArgs args(fUseHWAA, fRenderTarget.get(), &fV iewMatrix,
60 &fScissor, &fStencil);
61 state->gpu()->pathRendering()->stencilPath(args, fPath.get());
62 }
63
64 SkMatrix fViewMatrix;
65 bool fUseHWAA;
66 GrStencilSettings fStencil;
67 GrScissorState fScissor;
68 GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget;
69 GrPendingIOResource<const GrPath, kRead_GrIOType> fPath;
70 };
71
72 #endif
OLDNEW
« 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