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

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

Issue 1717393002: Add "sample locations" feature to GrProcessor (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_getmultisamp
Patch Set: addressed comments Created 4 years, 10 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 b9816af71a2a014ea8eb1388443078993c8fa4a5..a1e994bfce4ec4cb8bf53675999bf7ba3849980c 100644
--- a/src/gpu/glsl/GrGLSLFragmentShaderBuilder.h
+++ b/src/gpu/glsl/GrGLSLFragmentShaderBuilder.h
@@ -67,6 +67,15 @@ public:
GrGLSLFPFragmentBuilder() : GrGLSLFragmentBuilder(nullptr) {}
/**
+ * Appends the offset, in device space, from the center of the pixel to a specified sample.
+ *
+ * @param sampleIdx GLSL expression of the sample index.
+ *
+ * Requires a pipeline with sample locations enabled.
+ */
+ virtual void appendSampleOffset(const char* sampleIdx) = 0;
+
+ /**
* Subtracts sample coverage from the fragment. Any sample whose corresponding bit is not found
* in the mask will not be written out to the framebuffer.
*
@@ -152,6 +161,7 @@ public:
const char* fragmentPosition() override;
// GrGLSLFPFragmentBuilder interface.
+ void appendSampleOffset(const char* sampleIdx) override;
void maskSampleCoverage(const char* mask, bool invert = false) override;
void overrideSampleCoverage(const char* mask) override;
const SkString& getMangleString() const override { return fMangleString; }

Powered by Google App Engine
This is Rietveld 408576698