Chromium Code Reviews| Index: src/gpu/glsl/GrGLSLFragmentShaderBuilder.h |
| diff --git a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.h b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.h |
| index 614b04f54b20a3467e4fb7e8d85afed3cb6ab623..bd9ede657c10743193f5e668b1fc6c616a84e0ab 100644 |
| --- a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.h |
| +++ b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.h |
| @@ -53,6 +53,11 @@ public: |
| is in device space (e.g. 0,0 is the top left and pixel centers are at half-integers). */ |
| virtual const char* fragmentPosition() = 0; |
| + /** Returns a variable name that represents a vector to the nearest edge of the shape, in source |
| + space coordinates. */ |
| + virtual const char* distanceVectorName() const = 0; |
|
egdaniel
2016/07/12 13:46:42
with other changes mentioned in comments, I think
dvonbeck
2016/07/13 15:17:13
Done.
|
| + virtual bool hasDistanceVectorOutput() const = 0; |
| + |
| // TODO: remove this method. |
| void declAppendf(const char* fmt, ...); |
| @@ -166,6 +171,8 @@ public: |
| virtual SkString ensureFSCoords2D(const GrGLSLTransformedCoordsArray& coords, |
| int index) override; |
| const char* fragmentPosition() override; |
|
robertphillips
2016/07/11 17:55:40
same order as above ?
dvonbeck
2016/07/13 15:17:13
Done.
|
| + bool hasDistanceVectorOutput() const override; |
| + const char* distanceVectorName() const override; |
| // GrGLSLFPFragmentBuilder interface. |
| void appendOffsetToSample(const char* sampleIdx, Coordinates) override; |
| @@ -183,6 +190,7 @@ public: |
| private: |
| // Private public interface, used by GrGLProgramBuilder to build a fragment shader |
| + void enableDistanceVector(const SkString& name); |
| void enableCustomOutput(); |
| void enableSecondaryOutput(); |
| const char* getPrimaryColorOutputName() const; |
| @@ -235,6 +243,7 @@ private: |
| bool fHasSecondaryOutput; |
| uint8_t fUsedSampleOffsetArrays; |
| bool fHasInitializedSampleMask; |
| + SkString fDistanceVectorOutput; |
| #ifdef SK_DEBUG |
| // some state to verify shaders and effects are consistent, this is reset between effects by |