| 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 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 class GrPipeline : public GrNonAtomicRef { | 30 class GrPipeline : public GrNonAtomicRef { |
| 31 public: | 31 public: |
| 32 GrPipeline(const GrPipelineBuilder&, | 32 GrPipeline(const GrPipelineBuilder&, |
| 33 const GrProcOptInfo& colorPOI, | 33 const GrProcOptInfo& colorPOI, |
| 34 const GrProcOptInfo& coveragePOI, | 34 const GrProcOptInfo& coveragePOI, |
| 35 const GrCaps&, | 35 const GrCaps&, |
| 36 const GrScissorState&, | 36 const GrScissorState&, |
| 37 const GrXferProcessor::DstTexture*); | 37 const GrXferProcessor::DstTexture*); |
| 38 | 38 |
| 39 /* | 39 /* |
| 40 * Returns true if these pipelines are equivalent. | 40 * Returns true if these pipelines are equivalent. Coord transforms may be
applied either on |
| 41 * the GPU or the CPU. When we apply them on the CPU then the matrices need
not agree in order |
| 42 * to combine draws. Therefore we take a param that indicates whether coord
transforms should be |
| 43 * compared." |
| 41 */ | 44 */ |
| 42 bool isEqual(const GrPipeline& that) const; | 45 bool isEqual(const GrPipeline& that, bool ignoreCoordTransforms = false) con
st; |
| 43 | 46 |
| 44 /// @} | 47 /// @} |
| 45 | 48 |
| 46 /////////////////////////////////////////////////////////////////////////// | 49 /////////////////////////////////////////////////////////////////////////// |
| 47 /// @name GrFragmentProcessors | 50 /// @name GrFragmentProcessors |
| 48 | 51 |
| 49 | 52 |
| 50 int numColorFragmentStages() const { return fNumColorStages; } | 53 int numColorFragmentStages() const { return fNumColorStages; } |
| 51 int numCoverageFragmentStages() const { return fFragmentStages.count() - fNu
mColorStages; } | 54 int numCoverageFragmentStages() const { return fFragmentStages.count() - fNu
mColorStages; } |
| 52 int numFragmentStages() const { return fFragmentStages.count(); } | 55 int numFragmentStages() const { return fFragmentStages.count(); } |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 96 |
| 94 | 97 |
| 95 /////////////////////////////////////////////////////////////////////////// | 98 /////////////////////////////////////////////////////////////////////////// |
| 96 | 99 |
| 97 bool readsFragPosition() const { return fReadsFragPosition; } | 100 bool readsFragPosition() const { return fReadsFragPosition; } |
| 98 | 101 |
| 99 const GrPipelineInfo& infoForPrimitiveProcessor() const { | 102 const GrPipelineInfo& infoForPrimitiveProcessor() const { |
| 100 return fInfoForPrimitiveProcessor; | 103 return fInfoForPrimitiveProcessor; |
| 101 } | 104 } |
| 102 | 105 |
| 106 const SkTArray<const GrCoordTransform*, true>& coordTransforms() const { |
| 107 return fCoordTransforms; |
| 108 } |
| 109 |
| 103 private: | 110 private: |
| 104 /** | 111 /** |
| 105 * Alter the program desc and inputs (attribs and processors) based on the b
lend optimization. | 112 * Alter the program desc and inputs (attribs and processors) based on the b
lend optimization. |
| 106 */ | 113 */ |
| 107 void adjustProgramFromOptimizations(const GrPipelineBuilder& ds, | 114 void adjustProgramFromOptimizations(const GrPipelineBuilder& ds, |
| 108 GrXferProcessor::OptFlags, | 115 GrXferProcessor::OptFlags, |
| 109 const GrProcOptInfo& colorPOI, | 116 const GrProcOptInfo& colorPOI, |
| 110 const GrProcOptInfo& coveragePOI, | 117 const GrProcOptInfo& coveragePOI, |
| 111 int* firstColorStageIdx, | 118 int* firstColorStageIdx, |
| 112 int* firstCoverageStageIdx); | 119 int* firstCoverageStageIdx); |
| (...skipping 21 matching lines...) Expand all Loading... |
| 134 GrPipelineBuilder::DrawFace fDrawFace; | 141 GrPipelineBuilder::DrawFace fDrawFace; |
| 135 uint32_t fFlags; | 142 uint32_t fFlags; |
| 136 ProgramXferProcessor fXferProcessor; | 143 ProgramXferProcessor fXferProcessor; |
| 137 FragmentStageArray fFragmentStages; | 144 FragmentStageArray fFragmentStages; |
| 138 bool fReadsFragPosition; | 145 bool fReadsFragPosition; |
| 139 GrPipelineInfo fInfoForPrimitiveProcessor; | 146 GrPipelineInfo fInfoForPrimitiveProcessor; |
| 140 | 147 |
| 141 // This function is equivalent to the offset into fFragmentStages where cove
rage stages begin. | 148 // This function is equivalent to the offset into fFragmentStages where cove
rage stages begin. |
| 142 int fNumColorStages; | 149 int fNumColorStages; |
| 143 | 150 |
| 144 GrProgramDesc fDesc; | 151 SkSTArray<8, const GrCoordTransform*, true> fCoordTransforms; |
| 152 int fNumCoordTransforms; |
| 153 GrProgramDesc fDesc; |
| 145 | 154 |
| 146 typedef SkRefCnt INHERITED; | 155 typedef SkRefCnt INHERITED; |
| 147 }; | 156 }; |
| 148 | 157 |
| 149 #endif | 158 #endif |
| OLD | NEW |