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

Unified Diff: src/gpu/glsl/GrGLSLFragmentShaderBuilder.h

Issue 2114993002: 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: Addressed patch 9 comments, guarded onSetData from invalid calls 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
Index: src/gpu/glsl/GrGLSLFragmentShaderBuilder.h
diff --git a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.h b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.h
index 614b04f54b20a3467e4fb7e8d85afed3cb6ab623..9e6eec2004472d879b09cffaeb7ef16f2abe48d4 100644
--- a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.h
+++ b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.h
@@ -53,6 +53,10 @@ 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/14 02:47:47 I think we can drop this down one level to grglslf
dvonbeck 2016/07/14 13:40:34 Done.
+
// TODO: remove this method.
void declAppendf(const char* fmt, ...);
@@ -166,6 +170,7 @@ public:
virtual SkString ensureFSCoords2D(const GrGLSLTransformedCoordsArray& coords,
int index) override;
const char* fragmentPosition() override;
+ const char* distanceVectorName() const override;
// GrGLSLFPFragmentBuilder interface.
void appendOffsetToSample(const char* sampleIdx, Coordinates) override;
@@ -235,6 +240,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

Powered by Google App Engine
This is Rietveld 408576698