| 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 14 matching lines...) Expand all Loading... |
| 25 * Class that holds an optimized version of a GrPipelineBuilder. It is meant to
be an immutable | 25 * Class that holds an optimized version of a GrPipelineBuilder. It is meant to
be an immutable |
| 26 * class, and contains all data needed to set the state for a gpu draw. | 26 * class, and contains all data needed to set the state for a gpu draw. |
| 27 */ | 27 */ |
| 28 class GrPipeline { | 28 class GrPipeline { |
| 29 public: | 29 public: |
| 30 SK_DECLARE_INST_COUNT(GrPipeline) | 30 SK_DECLARE_INST_COUNT(GrPipeline) |
| 31 | 31 |
| 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 GrDrawTargetCaps&, | 35 const GrCaps&, |
| 36 const GrScissorState&, | 36 const GrScissorState&, |
| 37 const GrDeviceCoordTexture* dstCopy); | 37 const GrDeviceCoordTexture* dstCopy); |
| 38 | 38 |
| 39 /* | 39 /* |
| 40 * Returns true if these pipelines are equivalent. | 40 * Returns true if these pipelines are equivalent. |
| 41 */ | 41 */ |
| 42 bool isEqual(const GrPipeline& that) const; | 42 bool isEqual(const GrPipeline& that) const; |
| 43 | 43 |
| 44 /// @} | 44 /// @} |
| 45 | 45 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 const GrProcOptInfo& coveragePOI, | 108 const GrProcOptInfo& coveragePOI, |
| 109 int* firstColorStageIdx, | 109 int* firstColorStageIdx, |
| 110 int* firstCoverageStageIdx); | 110 int* firstCoverageStageIdx); |
| 111 | 111 |
| 112 /** | 112 /** |
| 113 * Calculates the primary and secondary output types of the shader. For cert
ain output types | 113 * Calculates the primary and secondary output types of the shader. For cert
ain output types |
| 114 * the function may adjust the blend coefficients. After this function is ca
lled the src and dst | 114 * the function may adjust the blend coefficients. After this function is ca
lled the src and dst |
| 115 * blend coeffs will represent those used by backend API. | 115 * blend coeffs will represent those used by backend API. |
| 116 */ | 116 */ |
| 117 void setOutputStateInfo(const GrPipelineBuilder& ds, GrXferProcessor::OptFla
gs, | 117 void setOutputStateInfo(const GrPipelineBuilder& ds, GrXferProcessor::OptFla
gs, |
| 118 const GrDrawTargetCaps&); | 118 const GrCaps&); |
| 119 | 119 |
| 120 enum Flags { | 120 enum Flags { |
| 121 kDither_Flag = 0x1, | 121 kDither_Flag = 0x1, |
| 122 kHWAA_Flag = 0x2, | 122 kHWAA_Flag = 0x2, |
| 123 kSnapVertices_Flag = 0x4, | 123 kSnapVertices_Flag = 0x4, |
| 124 }; | 124 }; |
| 125 | 125 |
| 126 typedef GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> RenderTarget; | 126 typedef GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> RenderTarget; |
| 127 typedef SkSTArray<8, GrPendingFragmentStage> FragmentStageArray; | 127 typedef SkSTArray<8, GrPendingFragmentStage> FragmentStageArray; |
| 128 typedef GrPendingProgramElement<const GrXferProcessor> ProgramXferProcessor; | 128 typedef GrPendingProgramElement<const GrXferProcessor> ProgramXferProcessor; |
| 129 RenderTarget fRenderTarget; | 129 RenderTarget fRenderTarget; |
| 130 GrScissorState fScissorState; | 130 GrScissorState fScissorState; |
| 131 GrStencilSettings fStencilSettings; | 131 GrStencilSettings fStencilSettings; |
| 132 GrPipelineBuilder::DrawFace fDrawFace; | 132 GrPipelineBuilder::DrawFace fDrawFace; |
| 133 uint32_t fFlags; | 133 uint32_t fFlags; |
| 134 ProgramXferProcessor fXferProcessor; | 134 ProgramXferProcessor fXferProcessor; |
| 135 FragmentStageArray fFragmentStages; | 135 FragmentStageArray fFragmentStages; |
| 136 bool fReadsFragPosition; | 136 bool fReadsFragPosition; |
| 137 GrPipelineInfo fInitBT; | 137 GrPipelineInfo fInitBT; |
| 138 | 138 |
| 139 // This function is equivalent to the offset into fFragmentStages where cove
rage stages begin. | 139 // This function is equivalent to the offset into fFragmentStages where cove
rage stages begin. |
| 140 int fNumColorStages; | 140 int fNumColorStages; |
| 141 | 141 |
| 142 GrProgramDesc fDesc; | 142 GrProgramDesc fDesc; |
| 143 | 143 |
| 144 typedef SkRefCnt INHERITED; | 144 typedef SkRefCnt INHERITED; |
| 145 }; | 145 }; |
| 146 | 146 |
| 147 #endif | 147 #endif |
| OLD | NEW |