Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(112)

Unified Diff: src/core/SkNormalBevelSource.cpp

Issue 2201613002: Revert of GrFP can express distance vector field req., program builder declares variable for it (Closed) Base URL: https://skia.googlesource.com/skia@dvonbeck-bevel-api-change
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/gpu/GrPaint.h ('k') | src/core/SkNormalFlatSource.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkNormalBevelSource.cpp
diff --git a/src/core/SkNormalBevelSource.cpp b/src/core/SkNormalBevelSource.cpp
index a63e434c3fb1fe7f01162735d8ac7ebbd11dc330..feccb0cce803db17a3ad7809457a5938fa006c8f 100644
--- a/src/core/SkNormalBevelSource.cpp
+++ b/src/core/SkNormalBevelSource.cpp
@@ -8,7 +8,6 @@
#include "SkNormalBevelSource.h"
#include "SkNormalSource.h"
-#include "SkNormalSourcePriv.h"
#include "SkPoint3.h"
#include "SkReadBuffer.h"
#include "SkWriteBuffer.h"
@@ -26,19 +25,17 @@
, fWidth(width)
, fHeight(height) {
this->initClassID<NormalBevelFP>();
-
- fUsesDistanceVectorField = true;
}
- class GLSLNormalBevelFP : public GLSLNormalFP {
+ class GLSLNormalBevelFP : public GrGLSLFragmentProcessor {
public:
GLSLNormalBevelFP() {
fPrevWidth = SkFloatToScalar(0.0f);
fPrevHeight = SkFloatToScalar(0.0f);
}
- void onEmitCode(EmitArgs& args) override {
- GrGLSLFPFragmentBuilder* fragBuilder = args.fFragBuilder;
+ void emitCode(EmitArgs& args) override {
+ GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder;
GrGLSLUniformHandler* uniformHandler = args.fUniformHandler;
const char* widthUniName = nullptr;
@@ -49,7 +46,7 @@
fHeightUni = uniformHandler->addUniform(kFragment_GrShaderFlag, kFloat_GrSLType,
kDefault_GrSLPrecision, "Height", &heightUniName);
- fragBuilder->codeAppendf("%s = vec4(0.0, 0.0, 1.0, 0.0);", args.fOutputColor);
+ fragBuilder->codeAppendf("%s = vec4(0, 0, 1, 0);", args.fOutputColor);
}
static void GenKey(const GrProcessor& proc, const GrGLSLCaps&,
@@ -59,8 +56,7 @@
}
protected:
- void setNormalData(const GrGLSLProgramDataManager& pdman,
- const GrProcessor& proc) override {
+ void onSetData(const GrGLSLProgramDataManager& pdman, const GrProcessor& proc) override {
const NormalBevelFP& normalBevelFP = proc.cast<NormalBevelFP>();
if (fPrevWidth != normalBevelFP.fWidth) {
« no previous file with comments | « include/gpu/GrPaint.h ('k') | src/core/SkNormalFlatSource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698