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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 const GrScissorState& scissor, | 43 const GrScissorState& scissor, |
44 GrRenderTarget* renderTarget, | 44 GrRenderTarget* renderTarget, |
45 const GrPath* path) | 45 const GrPath* path) |
46 : fViewMatrix(viewMatrix) | 46 : fViewMatrix(viewMatrix) |
47 , fUseHWAA(useHWAA) | 47 , fUseHWAA(useHWAA) |
48 , fStencil(stencil) | 48 , fStencil(stencil) |
49 , fScissor(scissor) | 49 , fScissor(scissor) |
50 , fRenderTarget(renderTarget) | 50 , fRenderTarget(renderTarget) |
51 , fPath(path) { | 51 , fPath(path) { |
52 this->initClassID<GrStencilPathBatch>(); | 52 this->initClassID<GrStencilPathBatch>(); |
| 53 fBounds = path->getBounds(); |
53 } | 54 } |
54 | 55 |
55 bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override { return f
alse; } | 56 bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override { return f
alse; } |
56 | 57 |
57 void onPrepare(GrBatchFlushState*) override {} | 58 void onPrepare(GrBatchFlushState*) override {} |
58 | 59 |
59 void onDraw(GrBatchFlushState* state) override { | 60 void onDraw(GrBatchFlushState* state) override { |
60 GrPathRendering::StencilPathArgs args(fUseHWAA, fRenderTarget.get(), &fV
iewMatrix, | 61 GrPathRendering::StencilPathArgs args(fUseHWAA, fRenderTarget.get(), &fV
iewMatrix, |
61 &fScissor, &fStencil); | 62 &fScissor, &fStencil); |
62 state->gpu()->pathRendering()->stencilPath(args, fPath.get()); | 63 state->gpu()->pathRendering()->stencilPath(args, fPath.get()); |
63 } | 64 } |
64 | 65 |
65 SkMatrix fViewMatrix; | 66 SkMatrix fViewMatrix; |
66 bool fUseHWAA; | 67 bool fUseHWAA; |
67 GrStencilSettings fStencil; | 68 GrStencilSettings fStencil; |
68 GrScissorState fScissor; | 69 GrScissorState fScissor; |
69 GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget; | 70 GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> fRenderTarget; |
70 GrPendingIOResource<const GrPath, kRead_GrIOType> fPath; | 71 GrPendingIOResource<const GrPath, kRead_GrIOType> fPath; |
71 }; | 72 }; |
72 | 73 |
73 #endif | 74 #endif |
OLD | NEW |