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

Unified Diff: src/gpu/gl/GrGLGpu.cpp

Issue 1812223002: added support for glMinSampleShading (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: updated for Jim's change Created 4 years, 9 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 | « src/gpu/gl/GrGLGpu.h ('k') | src/gpu/gl/GrGLInterface.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLGpu.cpp
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 3bbc77aa9b128529bb66e27804466b64bf8eb4b5..349ef9ab93bd52e2ced208ba455c1d0b635b9ab2 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -233,6 +233,7 @@ GrGLGpu::GrGLGpu(GrGLContext* ctx, GrContext* context)
}
fHWPLSEnabled = false;
fPLSHasBeenUsed = false;
+ fHWMinSampleShading = 0.0;
}
GrGLGpu::~GrGLGpu() {
@@ -2070,12 +2071,26 @@ void GrGLGpu::flushScissor(const GrScissorState& scissorState,
this->disableScissor();
}
+void GrGLGpu::flushMinSampleShading(float minSampleShading) {
+ if (fHWMinSampleShading != minSampleShading) {
+ if (minSampleShading > 0.0) {
+ GL_CALL(Enable(GR_GL_SAMPLE_SHADING));
+ GL_CALL(MinSampleShading(minSampleShading));
+ }
+ else {
+ GL_CALL(Disable(GR_GL_SAMPLE_SHADING));
+ }
+ fHWMinSampleShading = minSampleShading;
+ }
+}
+
bool GrGLGpu::flushGLState(const GrPipeline& pipeline, const GrPrimitiveProcessor& primProc) {
GrXferProcessor::BlendInfo blendInfo;
pipeline.getXferProcessor().getBlendInfo(&blendInfo);
this->flushColorWrite(blendInfo.fWriteColor);
this->flushDrawFace(pipeline.getDrawFace());
+ this->flushMinSampleShading(primProc.getSampleShading());
SkAutoTUnref<GrGLProgram> program(fProgramCache->refProgram(this, pipeline, primProc));
if (!program) {
« no previous file with comments | « src/gpu/gl/GrGLGpu.h ('k') | src/gpu/gl/GrGLInterface.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698