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 "gl/GrGLXferProcessor.h" | 10 #include "gl/GrGLXferProcessor.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 ~GLDisableColorXP() override {} | 60 ~GLDisableColorXP() override {} |
61 | 61 |
62 static void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuil
der*) {} | 62 static void GenKey(const GrProcessor&, const GrGLSLCaps&, GrProcessorKeyBuil
der*) {} |
63 | 63 |
64 private: | 64 private: |
65 void onEmitCode(const EmitArgs& args) override { | 65 void onEmitCode(const EmitArgs& args) override { |
66 // This emit code should be empty. However, on the nexus 6 there is a dr
iver bug where if | 66 // This emit code should be empty. However, on the nexus 6 there is a dr
iver bug where if |
67 // you do not give gl_FragColor a value, the gl context is lost and we e
nd up drawing | 67 // you do not give gl_FragColor a value, the gl context is lost and we e
nd up drawing |
68 // nothing. So this fix just sets the gl_FragColor arbitrarily to 0. | 68 // nothing. So this fix just sets the gl_FragColor arbitrarily to 0. |
69 GrGLFPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder(); | 69 GrGLXPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder(); |
70 fsBuilder->codeAppendf("%s = vec4(0);", args.fOutputPrimary); | 70 fsBuilder->codeAppendf("%s = vec4(0);", args.fOutputPrimary); |
71 } | 71 } |
72 | 72 |
73 void onSetData(const GrGLProgramDataManager&, const GrXferProcessor&) overri
de {} | 73 void onSetData(const GrGLProgramDataManager&, const GrXferProcessor&) overri
de {} |
74 | 74 |
75 typedef GrGLXferProcessor INHERITED; | 75 typedef GrGLXferProcessor INHERITED; |
76 }; | 76 }; |
77 | 77 |
78 /////////////////////////////////////////////////////////////////////////////// | 78 /////////////////////////////////////////////////////////////////////////////// |
79 | 79 |
(...skipping 29 matching lines...) Expand all Loading... |
109 | 109 |
110 GR_DEFINE_XP_FACTORY_TEST(GrDisableColorXPFactory); | 110 GR_DEFINE_XP_FACTORY_TEST(GrDisableColorXPFactory); |
111 | 111 |
112 GrXPFactory* GrDisableColorXPFactory::TestCreate(SkRandom* random, | 112 GrXPFactory* GrDisableColorXPFactory::TestCreate(SkRandom* random, |
113 GrContext*, | 113 GrContext*, |
114 const GrDrawTargetCaps&, | 114 const GrDrawTargetCaps&, |
115 GrTexture*[]) { | 115 GrTexture*[]) { |
116 return GrDisableColorXPFactory::Create(); | 116 return GrDisableColorXPFactory::Create(); |
117 } | 117 } |
118 | 118 |
OLD | NEW |