| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 GrBezierEffect_DEFINED | 8 #ifndef GrBezierEffect_DEFINED |
| 9 #define GrBezierEffect_DEFINED | 9 #define GrBezierEffect_DEFINED |
| 10 | 10 |
| 11 #include "GrDrawTargetCaps.h" | 11 #include "GrDrawTargetCaps.h" |
| 12 #include "GrProcessor.h" | 12 #include "GrProcessor.h" |
| 13 #include "GrGeometryProcessor.h" | 13 #include "GrGeometryProcessor.h" |
| 14 #include "GrInvariantOutput.h" |
| 14 #include "GrTypesPriv.h" | 15 #include "GrTypesPriv.h" |
| 15 | 16 |
| 16 /** | 17 /** |
| 17 * Shader is based off of Loop-Blinn Quadratic GPU Rendering | 18 * Shader is based off of Loop-Blinn Quadratic GPU Rendering |
| 18 * The output of this effect is a hairline edge for conics. | 19 * The output of this effect is a hairline edge for conics. |
| 19 * Conics specified by implicit equation K^2 - LM. | 20 * Conics specified by implicit equation K^2 - LM. |
| 20 * K, L, and M, are the first three values of the vertex attribute, | 21 * K, L, and M, are the first three values of the vertex attribute, |
| 21 * the fourth value is not used. Distance is calculated using a | 22 * the fourth value is not used. Distance is calculated using a |
| 22 * first order approximation from the taylor series. | 23 * first order approximation from the taylor series. |
| 23 * Coverage for AA is max(0, 1-distance). | 24 * Coverage for AA is max(0, 1-distance). |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 95 |
| 95 typedef GrGLConicEffect GLProcessor; | 96 typedef GrGLConicEffect GLProcessor; |
| 96 | 97 |
| 97 virtual const GrBackendGeometryProcessorFactory& getFactory() const SK_OVERR
IDE; | 98 virtual const GrBackendGeometryProcessorFactory& getFactory() const SK_OVERR
IDE; |
| 98 | 99 |
| 99 private: | 100 private: |
| 100 GrConicEffect(GrPrimitiveEdgeType); | 101 GrConicEffect(GrPrimitiveEdgeType); |
| 101 | 102 |
| 102 virtual bool onIsEqual(const GrGeometryProcessor& other) const SK_OVERRIDE; | 103 virtual bool onIsEqual(const GrGeometryProcessor& other) const SK_OVERRIDE; |
| 103 | 104 |
| 104 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR
IDE { | 105 virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const SK_OVE
RRIDE { |
| 105 inout->mulByUnknownAlpha(); | 106 inout->mulByUnknownAlpha(); |
| 106 } | 107 } |
| 107 | 108 |
| 108 GrPrimitiveEdgeType fEdgeType; | 109 GrPrimitiveEdgeType fEdgeType; |
| 109 const GrShaderVar& fInConicCoeffs; | 110 const GrShaderVar& fInConicCoeffs; |
| 110 | 111 |
| 111 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; | 112 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; |
| 112 | 113 |
| 113 typedef GrGeometryProcessor INHERITED; | 114 typedef GrGeometryProcessor INHERITED; |
| 114 }; | 115 }; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 | 164 |
| 164 typedef GrGLQuadEffect GLProcessor; | 165 typedef GrGLQuadEffect GLProcessor; |
| 165 | 166 |
| 166 virtual const GrBackendGeometryProcessorFactory& getFactory() const SK_OVERR
IDE; | 167 virtual const GrBackendGeometryProcessorFactory& getFactory() const SK_OVERR
IDE; |
| 167 | 168 |
| 168 private: | 169 private: |
| 169 GrQuadEffect(GrPrimitiveEdgeType); | 170 GrQuadEffect(GrPrimitiveEdgeType); |
| 170 | 171 |
| 171 virtual bool onIsEqual(const GrGeometryProcessor& other) const SK_OVERRIDE; | 172 virtual bool onIsEqual(const GrGeometryProcessor& other) const SK_OVERRIDE; |
| 172 | 173 |
| 173 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR
IDE { | 174 virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const SK_OVE
RRIDE { |
| 174 inout->mulByUnknownAlpha(); | 175 inout->mulByUnknownAlpha(); |
| 175 } | 176 } |
| 176 | 177 |
| 177 GrPrimitiveEdgeType fEdgeType; | 178 GrPrimitiveEdgeType fEdgeType; |
| 178 const GrShaderVar& fInHairQuadEdge; | 179 const GrShaderVar& fInHairQuadEdge; |
| 179 | 180 |
| 180 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; | 181 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; |
| 181 | 182 |
| 182 typedef GrGeometryProcessor INHERITED; | 183 typedef GrGeometryProcessor INHERITED; |
| 183 }; | 184 }; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 | 235 |
| 235 typedef GrGLCubicEffect GLProcessor; | 236 typedef GrGLCubicEffect GLProcessor; |
| 236 | 237 |
| 237 virtual const GrBackendGeometryProcessorFactory& getFactory() const SK_OVERR
IDE; | 238 virtual const GrBackendGeometryProcessorFactory& getFactory() const SK_OVERR
IDE; |
| 238 | 239 |
| 239 private: | 240 private: |
| 240 GrCubicEffect(GrPrimitiveEdgeType); | 241 GrCubicEffect(GrPrimitiveEdgeType); |
| 241 | 242 |
| 242 virtual bool onIsEqual(const GrGeometryProcessor& other) const SK_OVERRIDE; | 243 virtual bool onIsEqual(const GrGeometryProcessor& other) const SK_OVERRIDE; |
| 243 | 244 |
| 244 virtual void onComputeInvariantOutput(InvariantOutput* inout) const SK_OVERR
IDE { | 245 virtual void onComputeInvariantOutput(GrInvariantOutput* inout) const SK_OVE
RRIDE { |
| 245 inout->mulByUnknownAlpha(); | 246 inout->mulByUnknownAlpha(); |
| 246 } | 247 } |
| 247 | 248 |
| 248 GrPrimitiveEdgeType fEdgeType; | 249 GrPrimitiveEdgeType fEdgeType; |
| 249 const GrShaderVar& fInCubicCoeffs; | 250 const GrShaderVar& fInCubicCoeffs; |
| 250 | 251 |
| 251 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; | 252 GR_DECLARE_GEOMETRY_PROCESSOR_TEST; |
| 252 | 253 |
| 253 typedef GrGeometryProcessor INHERITED; | 254 typedef GrGeometryProcessor INHERITED; |
| 254 }; | 255 }; |
| 255 | 256 |
| 256 #endif | 257 #endif |
| OLD | NEW |