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

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

Issue 1428543003: Create GLSL base class for ProgramDataManager (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add space Created 5 years, 1 month 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 | « src/gpu/effects/GrDashingEffect.cpp ('k') | src/gpu/effects/GrDistanceFieldGeoProc.cpp » ('j') | 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" 11 #include "gl/builders/GrGLFragmentShaderBuilder.h"
12 #include "gl/builders/GrGLProgramBuilder.h" 12 #include "gl/builders/GrGLProgramBuilder.h"
13 #include "glsl/GrGLSLProgramDataManager.h"
13 14
14 /** 15 /**
15 * This xfer processor disables color writing. Thus color and coverage and ignor ed and no blending 16 * This xfer processor disables color writing. Thus color and coverage and ignor ed and no blending
16 * occurs. This XP is usful for things like stenciling. 17 * occurs. This XP is usful for things like stenciling.
17 */ 18 */
18 class DisableColorXP : public GrXferProcessor { 19 class DisableColorXP : public GrXferProcessor {
19 public: 20 public:
20 static GrXferProcessor* Create() { return new DisableColorXP; } 21 static GrXferProcessor* Create() { return new DisableColorXP; }
21 22
22 ~DisableColorXP() override {}; 23 ~DisableColorXP() override {};
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 60
60 private: 61 private:
61 void emitOutputsForBlendState(const EmitArgs& args) override { 62 void emitOutputsForBlendState(const EmitArgs& args) override {
62 // 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
63 // 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
64 // 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.
65 GrGLXPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder(); 66 GrGLXPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
66 fsBuilder->codeAppendf("%s = vec4(0);", args.fOutputPrimary); 67 fsBuilder->codeAppendf("%s = vec4(0);", args.fOutputPrimary);
67 } 68 }
68 69
69 void onSetData(const GrGLProgramDataManager&, const GrXferProcessor&) overri de {} 70 void onSetData(const GrGLSLProgramDataManager&, const GrXferProcessor&) over ride {}
70 71
71 typedef GrGLXferProcessor INHERITED; 72 typedef GrGLXferProcessor INHERITED;
72 }; 73 };
73 74
74 /////////////////////////////////////////////////////////////////////////////// 75 ///////////////////////////////////////////////////////////////////////////////
75 76
76 DisableColorXP::DisableColorXP() { 77 DisableColorXP::DisableColorXP() {
77 this->initClassID<DisableColorXP>(); 78 this->initClassID<DisableColorXP>();
78 } 79 }
79 80
(...skipping 21 matching lines...) Expand all
101 const DstTexture* dst) const { 102 const DstTexture* dst) const {
102 return DisableColorXP::Create(); 103 return DisableColorXP::Create();
103 } 104 }
104 105
105 GR_DEFINE_XP_FACTORY_TEST(GrDisableColorXPFactory); 106 GR_DEFINE_XP_FACTORY_TEST(GrDisableColorXPFactory);
106 107
107 const GrXPFactory* GrDisableColorXPFactory::TestCreate(GrProcessorTestData*) { 108 const GrXPFactory* GrDisableColorXPFactory::TestCreate(GrProcessorTestData*) {
108 return GrDisableColorXPFactory::Create(); 109 return GrDisableColorXPFactory::Create();
109 } 110 }
110 111
OLDNEW
« no previous file with comments | « src/gpu/effects/GrDashingEffect.cpp ('k') | src/gpu/effects/GrDistanceFieldGeoProc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698