| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "effects/GrDisableColorXP.h" | 8 #include "effects/GrDisableColorXP.h" |
| 9 #include "GrProcessor.h" | 9 #include "GrProcessor.h" |
| 10 #include "glsl/GrGLSLFragmentShaderBuilder.h" | 10 #include "glsl/GrGLSLFragmentShaderBuilder.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 | 56 |
| 57 ~GLDisableColorXP() override {} | 57 ~GLDisableColorXP() override {} |
| 58 | 58 |
| 59 static void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuil
der*) {} | 59 static void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuil
der*) {} |
| 60 | 60 |
| 61 private: | 61 private: |
| 62 void emitOutputsForBlendState(const EmitArgs& args) override { | 62 void emitOutputsForBlendState(const EmitArgs& args) override { |
| 63 // This emit code should be empty. However, on the nexus 6 there is a dr
iver bug where if | 63 // This emit code should be empty. However, on the nexus 6 there is a dr
iver bug where if |
| 64 // you do not give gl_FragColor a value, the gl context is lost and we e
nd up drawing | 64 // you do not give gl_FragColor a value, the gl context is lost and we e
nd up drawing |
| 65 // nothing. So this fix just sets the gl_FragColor arbitrarily to 0. | 65 // nothing. So this fix just sets the gl_FragColor arbitrarily to 0. |
| 66 GrGLSLXPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder(
); | 66 GrGLSLXPFragmentBuilder* fragBuilder = args.fXPFragBuilder; |
| 67 fsBuilder->codeAppendf("%s = vec4(0);", args.fOutputPrimary); | 67 fragBuilder->codeAppendf("%s = vec4(0);", args.fOutputPrimary); |
| 68 } | 68 } |
| 69 | 69 |
| 70 void onSetData(const GrGLSLProgramDataManager&, const GrXferProcessor&) over
ride {} | 70 void onSetData(const GrGLSLProgramDataManager&, const GrXferProcessor&) over
ride {} |
| 71 | 71 |
| 72 typedef GrGLSLXferProcessor INHERITED; | 72 typedef GrGLSLXferProcessor INHERITED; |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 /////////////////////////////////////////////////////////////////////////////// | 75 /////////////////////////////////////////////////////////////////////////////// |
| 76 | 76 |
| 77 DisableColorXP::DisableColorXP() { | 77 DisableColorXP::DisableColorXP() { |
| (...skipping 24 matching lines...) Expand all Loading... |
| 102 const DstTexture* dst) const { | 102 const DstTexture* dst) const { |
| 103 return DisableColorXP::Create(); | 103 return DisableColorXP::Create(); |
| 104 } | 104 } |
| 105 | 105 |
| 106 GR_DEFINE_XP_FACTORY_TEST(GrDisableColorXPFactory); | 106 GR_DEFINE_XP_FACTORY_TEST(GrDisableColorXPFactory); |
| 107 | 107 |
| 108 const GrXPFactory* GrDisableColorXPFactory::TestCreate(GrProcessorTestData*) { | 108 const GrXPFactory* GrDisableColorXPFactory::TestCreate(GrProcessorTestData*) { |
| 109 return GrDisableColorXPFactory::Create(); | 109 return GrDisableColorXPFactory::Create(); |
| 110 } | 110 } |
| 111 | 111 |
| OLD | NEW |