Index: src/core/SkNormalBevelSource.cpp |
diff --git a/src/core/SkNormalBevelSource.cpp b/src/core/SkNormalBevelSource.cpp |
index feccb0cce803db17a3ad7809457a5938fa006c8f..a63e434c3fb1fe7f01162735d8ac7ebbd11dc330 100644 |
--- a/src/core/SkNormalBevelSource.cpp |
+++ b/src/core/SkNormalBevelSource.cpp |
@@ -8,6 +8,7 @@ |
#include "SkNormalBevelSource.h" |
#include "SkNormalSource.h" |
+#include "SkNormalSourcePriv.h" |
#include "SkPoint3.h" |
#include "SkReadBuffer.h" |
#include "SkWriteBuffer.h" |
@@ -25,17 +26,19 @@ public: |
, fWidth(width) |
, fHeight(height) { |
this->initClassID<NormalBevelFP>(); |
+ |
+ fUsesDistanceVectorField = true; |
} |
- class GLSLNormalBevelFP : public GrGLSLFragmentProcessor { |
+ class GLSLNormalBevelFP : public GLSLNormalFP { |
public: |
GLSLNormalBevelFP() { |
fPrevWidth = SkFloatToScalar(0.0f); |
fPrevHeight = SkFloatToScalar(0.0f); |
} |
- void emitCode(EmitArgs& args) override { |
- GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder; |
+ void onEmitCode(EmitArgs& args) override { |
+ GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder; |
GrGLSLUniformHandler* uniformHandler = args.fUniformHandler; |
const char* widthUniName = nullptr; |
@@ -46,7 +49,7 @@ public: |
fHeightUni = uniformHandler->addUniform(kFragment_GrShaderFlag, kFloat_GrSLType, |
kDefault_GrSLPrecision, "Height", &heightUniName); |
- fragBuilder->codeAppendf("%s = vec4(0, 0, 1, 0);", args.fOutputColor); |
+ fragBuilder->codeAppendf("%s = vec4(0.0, 0.0, 1.0, 0.0);", args.fOutputColor); |
} |
static void GenKey(const GrProcessor& proc, const GrGLSLCaps&, |
@@ -56,7 +59,8 @@ public: |
} |
protected: |
- void onSetData(const GrGLSLProgramDataManager& pdman, const GrProcessor& proc) override { |
+ void setNormalData(const GrGLSLProgramDataManager& pdman, |
+ const GrProcessor& proc) override { |
const NormalBevelFP& normalBevelFP = proc.cast<NormalBevelFP>(); |
if (fPrevWidth != normalBevelFP.fWidth) { |