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) { |