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

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

Issue 1110033004: Make XPFragmentBuilder only Builder with access to DstCopy. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 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 | « src/gpu/effects/GrConvolutionEffect.cpp ('k') | src/gpu/effects/GrCustomXfermode.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 /* 2 /*
3 * Copyright 2014 Google Inc. 3 * Copyright 2014 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "effects/GrCoverageSetOpXP.h" 9 #include "effects/GrCoverageSetOpXP.h"
10 #include "GrColor.h" 10 #include "GrColor.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 static void GenKey(const GrProcessor& processor, const GrGLSLCaps& caps, 67 static void GenKey(const GrProcessor& processor, const GrGLSLCaps& caps,
68 GrProcessorKeyBuilder* b) { 68 GrProcessorKeyBuilder* b) {
69 const CoverageSetOpXP& xp = processor.cast<CoverageSetOpXP>(); 69 const CoverageSetOpXP& xp = processor.cast<CoverageSetOpXP>();
70 uint32_t key = xp.invertCoverage() ? 0x0 : 0x1; 70 uint32_t key = xp.invertCoverage() ? 0x0 : 0x1;
71 b->add32(key); 71 b->add32(key);
72 }; 72 };
73 73
74 private: 74 private:
75 void onEmitCode(const EmitArgs& args) override { 75 void onEmitCode(const EmitArgs& args) override {
76 const CoverageSetOpXP& xp = args.fXP.cast<CoverageSetOpXP>(); 76 const CoverageSetOpXP& xp = args.fXP.cast<CoverageSetOpXP>();
77 GrGLFPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder(); 77 GrGLXPFragmentBuilder* fsBuilder = args.fPB->getFragmentShaderBuilder();
78 78
79 if (xp.invertCoverage()) { 79 if (xp.invertCoverage()) {
80 fsBuilder->codeAppendf("%s = 1.0 - %s;", args.fOutputPrimary, args.f InputCoverage); 80 fsBuilder->codeAppendf("%s = 1.0 - %s;", args.fOutputPrimary, args.f InputCoverage);
81 } else { 81 } else {
82 fsBuilder->codeAppendf("%s = %s;", args.fOutputPrimary, args.fInputC overage); 82 fsBuilder->codeAppendf("%s = %s;", args.fOutputPrimary, args.fInputC overage);
83 } 83 }
84 } 84 }
85 85
86 void onSetData(const GrGLProgramDataManager&, const GrXferProcessor&) overri de {}; 86 void onSetData(const GrGLProgramDataManager&, const GrXferProcessor&) overri de {};
87 87
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 252
253 GrXPFactory* GrCoverageSetOpXPFactory::TestCreate(SkRandom* random, 253 GrXPFactory* GrCoverageSetOpXPFactory::TestCreate(SkRandom* random,
254 GrContext*, 254 GrContext*,
255 const GrDrawTargetCaps&, 255 const GrDrawTargetCaps&,
256 GrTexture*[]) { 256 GrTexture*[]) {
257 SkRegion::Op regionOp = SkRegion::Op(random->nextULessThan(SkRegion::kLastOp + 1)); 257 SkRegion::Op regionOp = SkRegion::Op(random->nextULessThan(SkRegion::kLastOp + 1));
258 bool invertCoverage = random->nextBool(); 258 bool invertCoverage = random->nextBool();
259 return GrCoverageSetOpXPFactory::Create(regionOp, invertCoverage); 259 return GrCoverageSetOpXPFactory::Create(regionOp, invertCoverage);
260 } 260 }
261 261
OLDNEW
« no previous file with comments | « src/gpu/effects/GrConvolutionEffect.cpp ('k') | src/gpu/effects/GrCustomXfermode.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698