Index: src/gpu/effects/GrDisableColorXP.cpp |
diff --git a/src/gpu/effects/GrDisableColorXP.cpp b/src/gpu/effects/GrDisableColorXP.cpp |
index ba6a45b7809735164c3f922d7e16194699762b6a..93833851921d3c6eadfa77825b635e4cb5317dc8 100644 |
--- a/src/gpu/effects/GrDisableColorXP.cpp |
+++ b/src/gpu/effects/GrDisableColorXP.cpp |
@@ -8,6 +8,8 @@ |
#include "effects/GrDisableColorXP.h" |
#include "GrProcessor.h" |
#include "gl/GrGLXferProcessor.h" |
+#include "gl/builders/GrGLFragmentShaderBuilder.h" |
+#include "gl/builders/GrGLProgramBuilder.h" |
class GrGLDisableColorXP : public GrGLXferProcessor { |
public: |
@@ -15,7 +17,13 @@ public: |
~GrGLDisableColorXP() SK_OVERRIDE {} |
- void emitCode(const EmitArgs& args) SK_OVERRIDE {} |
+ void emitCode(const EmitArgs& args) SK_OVERRIDE { |
+ // This emit code should be empty. However, on the nexus 6 there is a driver bug where if |
+ // you do not give gl_FragColor a value, the gl context is lost and we end up drawing |
+ // nothing. So this fix just sets the gl_FragColor arbitrarily to 0. |
+ GrGLFPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder(); |
+ fsBuilder->codeAppendf("%s = vec4(0);", args.fOutputPrimary); |
+ } |
void setData(const GrGLProgramDataManager&, const GrXferProcessor&) SK_OVERRIDE {} |