Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(56)

Side by Side Diff: src/gpu/effects/GrDisableColorXP.cpp

Issue 823053003: Fix for disabled color writes xp on n6 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "gl/builders/GrGLFragmentShaderBuilder.h"
12 #include "gl/builders/GrGLProgramBuilder.h"
11 13
12 class GrGLDisableColorXP : public GrGLXferProcessor { 14 class GrGLDisableColorXP : public GrGLXferProcessor {
13 public: 15 public:
14 GrGLDisableColorXP(const GrProcessor&) {} 16 GrGLDisableColorXP(const GrProcessor&) {}
15 17
16 ~GrGLDisableColorXP() SK_OVERRIDE {} 18 ~GrGLDisableColorXP() SK_OVERRIDE {}
17 19
18 void emitCode(const EmitArgs& args) SK_OVERRIDE {} 20 void emitCode(const EmitArgs& args) SK_OVERRIDE {
21 // This emit code should be empty. However, on the nexus 6 there is a dr iver bug where if
22 // you do not give gl_FragColor a value, the gl context is lost and we e nd up drawing
23 // nothing. So this fix just sets the gl_FragColor arbitrarily to 0.
24 GrGLFPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
25 fsBuilder->codeAppendf("%s = vec4(0);", args.fOutputPrimary);
26 }
19 27
20 void setData(const GrGLProgramDataManager&, const GrXferProcessor&) SK_OVERR IDE {} 28 void setData(const GrGLProgramDataManager&, const GrXferProcessor&) SK_OVERR IDE {}
21 29
22 static void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBuilde r*) {} 30 static void GenKey(const GrProcessor&, const GrGLCaps&, GrProcessorKeyBuilde r*) {}
23 31
24 private: 32 private:
25 typedef GrGLXferProcessor INHERITED; 33 typedef GrGLXferProcessor INHERITED;
26 }; 34 };
27 35
28 /////////////////////////////////////////////////////////////////////////////// 36 ///////////////////////////////////////////////////////////////////////////////
(...skipping 27 matching lines...) Expand all
56 64
57 GR_DEFINE_XP_FACTORY_TEST(GrDisableColorXPFactory); 65 GR_DEFINE_XP_FACTORY_TEST(GrDisableColorXPFactory);
58 66
59 GrXPFactory* GrDisableColorXPFactory::TestCreate(SkRandom* random, 67 GrXPFactory* GrDisableColorXPFactory::TestCreate(SkRandom* random,
60 GrContext*, 68 GrContext*,
61 const GrDrawTargetCaps&, 69 const GrDrawTargetCaps&,
62 GrTexture*[]) { 70 GrTexture*[]) {
63 return GrDisableColorXPFactory::Create(); 71 return GrDisableColorXPFactory::Create();
64 } 72 }
65 73
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698