OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef GrStencilPathBatch_DEFINED | 8 #ifndef GrStencilPathBatch_DEFINED |
9 #define GrStencilPathBatch_DEFINED | 9 #define GrStencilPathBatch_DEFINED |
10 | 10 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 bool useHWAA, | 42 bool useHWAA, |
43 const GrStencilSettings& stencil, | 43 const GrStencilSettings& stencil, |
44 const GrScissorState& scissor, | 44 const GrScissorState& scissor, |
45 GrRenderTarget* renderTarget, | 45 GrRenderTarget* renderTarget, |
46 const GrPath* path) | 46 const GrPath* path) |
47 : fViewMatrix(viewMatrix) | 47 : fViewMatrix(viewMatrix) |
48 , fUseHWAA(useHWAA) | 48 , fUseHWAA(useHWAA) |
49 , fStencil(stencil) | 49 , fStencil(stencil) |
50 , fScissor(scissor) | 50 , fScissor(scissor) |
51 , fRenderTarget(renderTarget) | 51 , fRenderTarget(renderTarget) |
52 , fPath(path) {} | 52 , fPath(path) { |
| 53 this->initClassID<GrStencilPathBatch>(); |
| 54 } |
53 | 55 |
54 bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override { return f
alse; } | 56 bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override { return f
alse; } |
55 | 57 |
56 void onPrepare(GrBatchFlushState*) override {} | 58 void onPrepare(GrBatchFlushState*) override {} |
57 | 59 |
58 void onDraw(GrBatchFlushState* state) override { | 60 void onDraw(GrBatchFlushState* state) override { |
59 GrPathRendering::StencilPathArgs args(fUseHWAA, fRenderTarget.get(), &fV
iewMatrix, | 61 GrPathRendering::StencilPathArgs args(fUseHWAA, fRenderTarget.get(), &fV
iewMatrix, |
60 &fScissor, &fStencil); | 62 &fScissor, &fStencil); |
61 state->gpu()->pathRendering()->stencilPath(args, fPath.get()); | 63 state->gpu()->pathRendering()->stencilPath(args, fPath.get()); |
62 } | 64 } |
63 | 65 |
64 SkMatrix fViewMatrix; | 66 SkMatrix fViewMatrix; |
65 bool fUseHWAA; | 67 bool fUseHWAA; |
66 GrStencilSettings fStencil; | 68 GrStencilSettings fStencil; |
67 GrScissorState fScissor; | 69 GrScissorState fScissor; |
68 GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget; | 70 GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget; |
69 GrPendingIOResource<const GrPath, kRead_GrIOType> fPath; | 71 GrPendingIOResource<const GrPath, kRead_GrIOType> fPath; |
70 }; | 72 }; |
71 | 73 |
72 #endif | 74 #endif |
OLD | NEW |