| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 * @return The currently set render target. | 73 * @return The currently set render target. |
| 74 */ | 74 */ |
| 75 GrRenderTarget* getRenderTarget() const { return fRenderTarget.get(); } | 75 GrRenderTarget* getRenderTarget() const { return fRenderTarget.get(); } |
| 76 | 76 |
| 77 const GrStencilSettings& getStencil() const { return fStencilSettings; } | 77 const GrStencilSettings& getStencil() const { return fStencilSettings; } |
| 78 | 78 |
| 79 const GrScissorState& getScissorState() const { return fScissorState; } | 79 const GrScissorState& getScissorState() const { return fScissorState; } |
| 80 | 80 |
| 81 bool isDitherState() const { return SkToBool(fFlags & kDither_Flag); } | 81 bool isDitherState() const { return SkToBool(fFlags & kDither_Flag); } |
| 82 bool isHWAntialiasState() const { return SkToBool(fFlags & kHWAA_Flag); } | 82 bool isHWAntialiasState() const { return SkToBool(fFlags & kHWAA_Flag); } |
| 83 bool snapVerticesToPixelCenters() const { return SkToBool(fFlags & kSnapVert
ices_Flag); } |
| 83 // Skip any draws that refer to this pipeline (they should be a no-op). | 84 // Skip any draws that refer to this pipeline (they should be a no-op). |
| 84 bool mustSkip() const { return NULL == this->getRenderTarget(); } | 85 bool mustSkip() const { return NULL == this->getRenderTarget(); } |
| 85 | 86 |
| 86 /** | 87 /** |
| 87 * Gets whether the target is drawing clockwise, counterclockwise, | 88 * Gets whether the target is drawing clockwise, counterclockwise, |
| 88 * or both faces. | 89 * or both faces. |
| 89 * @return the current draw face(s). | 90 * @return the current draw face(s). |
| 90 */ | 91 */ |
| 91 GrPipelineBuilder::DrawFace getDrawFace() const { return fDrawFace; } | 92 GrPipelineBuilder::DrawFace getDrawFace() const { return fDrawFace; } |
| 92 | 93 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 112 * 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 |
| 113 * 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 |
| 114 * blend coeffs will represent those used by backend API. | 115 * blend coeffs will represent those used by backend API. |
| 115 */ | 116 */ |
| 116 void setOutputStateInfo(const GrPipelineBuilder& ds, GrXferProcessor::OptFla
gs, | 117 void setOutputStateInfo(const GrPipelineBuilder& ds, GrXferProcessor::OptFla
gs, |
| 117 const GrDrawTargetCaps&); | 118 const GrDrawTargetCaps&); |
| 118 | 119 |
| 119 enum Flags { | 120 enum Flags { |
| 120 kDither_Flag = 0x1, | 121 kDither_Flag = 0x1, |
| 121 kHWAA_Flag = 0x2, | 122 kHWAA_Flag = 0x2, |
| 123 kSnapVertices_Flag = 0x4, |
| 122 }; | 124 }; |
| 123 | 125 |
| 124 typedef GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> RenderTarget; | 126 typedef GrPendingIOResource<GrRenderTarget, kWrite_GrIOType> RenderTarget; |
| 125 typedef SkSTArray<8, GrPendingFragmentStage> FragmentStageArray; | 127 typedef SkSTArray<8, GrPendingFragmentStage> FragmentStageArray; |
| 126 typedef GrPendingProgramElement<const GrXferProcessor> ProgramXferProcessor; | 128 typedef GrPendingProgramElement<const GrXferProcessor> ProgramXferProcessor; |
| 127 RenderTarget fRenderTarget; | 129 RenderTarget fRenderTarget; |
| 128 GrScissorState fScissorState; | 130 GrScissorState fScissorState; |
| 129 GrStencilSettings fStencilSettings; | 131 GrStencilSettings fStencilSettings; |
| 130 GrPipelineBuilder::DrawFace fDrawFace; | 132 GrPipelineBuilder::DrawFace fDrawFace; |
| 131 uint32_t fFlags; | 133 uint32_t fFlags; |
| 132 ProgramXferProcessor fXferProcessor; | 134 ProgramXferProcessor fXferProcessor; |
| 133 FragmentStageArray fFragmentStages; | 135 FragmentStageArray fFragmentStages; |
| 134 bool fReadsFragPosition; | 136 bool fReadsFragPosition; |
| 135 GrPipelineInfo fInitBT; | 137 GrPipelineInfo fInitBT; |
| 136 | 138 |
| 137 // 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. |
| 138 int fNumColorStages; | 140 int fNumColorStages; |
| 139 | 141 |
| 140 GrProgramDesc fDesc; | 142 GrProgramDesc fDesc; |
| 141 | 143 |
| 142 typedef SkRefCnt INHERITED; | 144 typedef SkRefCnt INHERITED; |
| 143 }; | 145 }; |
| 144 | 146 |
| 145 #endif | 147 #endif |
| OLD | NEW |