| 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 "GrStencil.h" | 18 #include "GrStencil.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 GrDeviceCoordTexture; | 24 class GrDeviceCoordTexture; |
| 25 class GrPipelineBuilder; | 25 class GrPipelineBuilder; |
| 26 | 26 |
| 27 struct GrBatchToXPOverrides { |
| 28 bool fUsePLSDstRead; |
| 29 }; |
| 30 |
| 31 struct GrPipelineOptimizations { |
| 32 GrProcOptInfo fColorPOI; |
| 33 GrProcOptInfo fCoveragePOI; |
| 34 GrBatchToXPOverrides fOverrides; |
| 35 }; |
| 36 |
| 27 /** | 37 /** |
| 28 * Class that holds an optimized version of a GrPipelineBuilder. It is meant to
be an immutable | 38 * Class that holds an optimized version of a GrPipelineBuilder. It is meant to
be an immutable |
| 29 * class, and contains all data needed to set the state for a gpu draw. | 39 * class, and contains all data needed to set the state for a gpu draw. |
| 30 */ | 40 */ |
| 31 class GrPipeline : public GrNonAtomicRef { | 41 class GrPipeline : public GrNonAtomicRef { |
| 32 public: | 42 public: |
| 33 /////////////////////////////////////////////////////////////////////////// | 43 /////////////////////////////////////////////////////////////////////////// |
| 34 /// @name Creation | 44 /// @name Creation |
| 35 | 45 |
| 36 struct CreateArgs { | 46 struct CreateArgs { |
| 37 const GrPipelineBuilder* fPipelineBuilder; | 47 const GrPipelineBuilder* fPipelineBuilder; |
| 38 const GrCaps* fCaps; | 48 const GrCaps* fCaps; |
| 39 GrProcOptInfo fColorPOI; | 49 GrPipelineOptimizations fOpts; |
| 40 GrProcOptInfo fCoveragePOI; | |
| 41 const GrScissorState* fScissor; | 50 const GrScissorState* fScissor; |
| 42 GrXferProcessor::DstTexture fDstTexture; | 51 GrXferProcessor::DstTexture fDstTexture; |
| 43 }; | 52 }; |
| 44 | 53 |
| 45 /** Creates a pipeline into a pre-allocated buffer */ | 54 /** Creates a pipeline into a pre-allocated buffer */ |
| 46 static GrPipeline* CreateAt(void* memory, const CreateArgs&, GrPipelineOptim
izations*); | 55 static GrPipeline* CreateAt(void* memory, const CreateArgs&, GrXPOverridesFo
rBatch*); |
| 47 | 56 |
| 48 /// @} | 57 /// @} |
| 49 | 58 |
| 50 /////////////////////////////////////////////////////////////////////////// | 59 /////////////////////////////////////////////////////////////////////////// |
| 51 /// @name Comparisons | 60 /// @name Comparisons |
| 52 | 61 |
| 53 /** | 62 /** |
| 54 * Returns true if these pipelines are equivalent. Coord transforms may be
applied either on | 63 * Returns true if these pipelines are equivalent. Coord transforms may be
applied either on |
| 55 * the GPU or the CPU. When we apply them on the CPU then the matrices need
not agree in order | 64 * the GPU or the CPU. When we apply them on the CPU then the matrices need
not agree in order |
| 56 * to combine draws. Therefore we take a param that indicates whether coord
transforms should be | 65 * to combine draws. Therefore we take a param that indicates whether coord
transforms should be |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 FragmentProcessorArray fFragmentProcessors; | 190 FragmentProcessorArray fFragmentProcessors; |
| 182 bool fReadsFragPosition; | 191 bool fReadsFragPosition; |
| 183 | 192 |
| 184 // This value is also the index in fFragmentProcessors where coverage proces
sors begin. | 193 // This value is also the index in fFragmentProcessors where coverage proces
sors begin. |
| 185 int fNumColorProcessors; | 194 int fNumColorProcessors; |
| 186 | 195 |
| 187 typedef SkRefCnt INHERITED; | 196 typedef SkRefCnt INHERITED; |
| 188 }; | 197 }; |
| 189 | 198 |
| 190 #endif | 199 #endif |
| OLD | NEW |