Don't use glFrontFace
This is an exploratory commit to see if glFrontFace is the cause of
a recent perf regression. Instead we invert gl_FrontFacing in SkSL.
Bug: skia:
Change-Id: Ida6f6435785e814c089ad34ba2f32793c4ac23c4
Reviewed-on: https://skia-review.googlesource.com/144410
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
diff --git a/src/sksl/SkSLGLSLCodeGenerator.cpp b/src/sksl/SkSLGLSLCodeGenerator.cpp
index f0c97a3..62cfbae 100644
--- a/src/sksl/SkSLGLSLCodeGenerator.cpp
+++ b/src/sksl/SkSLGLSLCodeGenerator.cpp
@@ -690,7 +690,7 @@
this->writeFragCoord();
break;
case SK_CLOCKWISE_BUILTIN:
- this->write("gl_FrontFacing");
+ this->write(fProgram.fSettings.fFlipY ? "(!gl_FrontFacing)" : "gl_FrontFacing");
break;
case SK_VERTEXID_BUILTIN:
this->write("gl_VertexID");