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 GrPipeline_DEFINED | 8 #ifndef GrPipeline_DEFINED |
9 #define GrPipeline_DEFINED | 9 #define GrPipeline_DEFINED |
10 | 10 |
11 #include "GrColor.h" | 11 #include "GrColor.h" |
12 #include "GrFragmentProcessor.h" | 12 #include "GrFragmentProcessor.h" |
13 #include "GrGpu.h" | 13 #include "GrGpu.h" |
14 #include "GrNonAtomicRef.h" | 14 #include "GrNonAtomicRef.h" |
15 #include "GrPendingProgramElement.h" | 15 #include "GrPendingProgramElement.h" |
16 #include "GrPrimitiveProcessor.h" | 16 #include "GrPrimitiveProcessor.h" |
17 #include "GrProgramDesc.h" | 17 #include "GrProgramDesc.h" |
18 #include "GrStencilSettings.h" | 18 #include "GrStencilSettings.h" |
19 #include "GrTypesPriv.h" | 19 #include "GrTypesPriv.h" |
20 #include "SkMatrix.h" | 20 #include "SkMatrix.h" |
21 #include "SkRefCnt.h" | 21 #include "SkRefCnt.h" |
22 | 22 |
23 class GrBatch; | 23 class GrBatch; |
| 24 class GrDrawContext; |
24 class GrDeviceCoordTexture; | 25 class GrDeviceCoordTexture; |
25 class GrPipelineBuilder; | 26 class GrPipelineBuilder; |
26 | 27 |
27 struct GrBatchToXPOverrides { | 28 struct GrBatchToXPOverrides { |
28 GrBatchToXPOverrides() | 29 GrBatchToXPOverrides() |
29 : fUsePLSDstRead(false) {} | 30 : fUsePLSDstRead(false) {} |
30 | 31 |
31 bool fUsePLSDstRead; | 32 bool fUsePLSDstRead; |
32 }; | 33 }; |
33 | 34 |
34 struct GrPipelineOptimizations { | 35 struct GrPipelineOptimizations { |
35 GrProcOptInfo fColorPOI; | 36 GrProcOptInfo fColorPOI; |
36 GrProcOptInfo fCoveragePOI; | 37 GrProcOptInfo fCoveragePOI; |
37 GrBatchToXPOverrides fOverrides; | 38 GrBatchToXPOverrides fOverrides; |
38 }; | 39 }; |
39 | 40 |
40 /** | 41 /** |
41 * Class that holds an optimized version of a GrPipelineBuilder. It is meant to
be an immutable | 42 * Class that holds an optimized version of a GrPipelineBuilder. It is meant to
be an immutable |
42 * class, and contains all data needed to set the state for a gpu draw. | 43 * class, and contains all data needed to set the state for a gpu draw. |
43 */ | 44 */ |
44 class GrPipeline : public GrNonAtomicRef<GrPipeline> { | 45 class GrPipeline : public GrNonAtomicRef<GrPipeline> { |
45 public: | 46 public: |
46 /////////////////////////////////////////////////////////////////////////// | 47 /////////////////////////////////////////////////////////////////////////// |
47 /// @name Creation | 48 /// @name Creation |
48 | 49 |
49 struct CreateArgs { | 50 struct CreateArgs { |
50 const GrPipelineBuilder* fPipelineBuilder; | 51 const GrPipelineBuilder* fPipelineBuilder; |
| 52 GrDrawContext* fDrawContext; |
51 const GrCaps* fCaps; | 53 const GrCaps* fCaps; |
52 GrPipelineOptimizations fOpts; | 54 GrPipelineOptimizations fOpts; |
53 const GrScissorState* fScissor; | 55 const GrScissorState* fScissor; |
54 bool fHasStencilClip; | 56 bool fHasStencilClip; |
55 GrXferProcessor::DstTexture fDstTexture; | 57 GrXferProcessor::DstTexture fDstTexture; |
56 }; | 58 }; |
57 | 59 |
58 /** Creates a pipeline into a pre-allocated buffer */ | 60 /** Creates a pipeline into a pre-allocated buffer */ |
59 static GrPipeline* CreateAt(void* memory, const CreateArgs&, GrXPOverridesFo
rBatch*); | 61 static GrPipeline* CreateAt(void* memory, const CreateArgs&, GrXPOverridesFo
rBatch*); |
60 | 62 |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 FragmentProcessorArray fFragmentProcessors; | 216 FragmentProcessorArray fFragmentProcessors; |
215 bool fIgnoresCoverage; | 217 bool fIgnoresCoverage; |
216 | 218 |
217 // This value is also the index in fFragmentProcessors where coverage proces
sors begin. | 219 // This value is also the index in fFragmentProcessors where coverage proces
sors begin. |
218 int fNumColorProcessors; | 220 int fNumColorProcessors; |
219 | 221 |
220 typedef SkRefCnt INHERITED; | 222 typedef SkRefCnt INHERITED; |
221 }; | 223 }; |
222 | 224 |
223 #endif | 225 #endif |
OLD | NEW |