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

Side by Side Diff: src/gpu/GrDefaultGeoProcFactory.cpp

Issue 1416423003: Make GrGLSLProgramBuilder base class for ProgramBuilder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: nit 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/effects/gradients/SkSweepGradient.cpp ('k') | src/gpu/GrOvalRenderer.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 "GrDefaultGeoProcFactory.h" 8 #include "GrDefaultGeoProcFactory.h"
9 9
10 #include "GrInvariantOutput.h" 10 #include "GrInvariantOutput.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 bool coverageWillBeIgnored() const { return fCoverageWillBeIgnored; } 54 bool coverageWillBeIgnored() const { return fCoverageWillBeIgnored; }
55 bool hasVertexCoverage() const { return SkToBool(fInCoverage); } 55 bool hasVertexCoverage() const { return SkToBool(fInCoverage); }
56 56
57 class GLProcessor : public GrGLGeometryProcessor { 57 class GLProcessor : public GrGLGeometryProcessor {
58 public: 58 public:
59 GLProcessor() 59 GLProcessor()
60 : fViewMatrix(SkMatrix::InvalidMatrix()), fColor(GrColor_ILLEGAL), f Coverage(0xff) {} 60 : fViewMatrix(SkMatrix::InvalidMatrix()), fColor(GrColor_ILLEGAL), f Coverage(0xff) {}
61 61
62 void onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) override { 62 void onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) override {
63 const DefaultGeoProc& gp = args.fGP.cast<DefaultGeoProc>(); 63 const DefaultGeoProc& gp = args.fGP.cast<DefaultGeoProc>();
64 GrGLGPBuilder* pb = args.fPB; 64 GrGLSLGPBuilder* pb = args.fPB;
65 GrGLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder(); 65 GrGLVertexBuilder* vsBuilder = pb->getVertexShaderBuilder();
66 GrGLFragmentBuilder* fs = args.fPB->getFragmentShaderBuilder(); 66 GrGLFragmentBuilder* fs = args.fPB->getFragmentShaderBuilder();
67 67
68 // emit attributes 68 // emit attributes
69 vsBuilder->emitAttributes(gp); 69 vsBuilder->emitAttributes(gp);
70 70
71 // Setup pass through color 71 // Setup pass through color
72 if (!gp.colorIgnored()) { 72 if (!gp.colorIgnored()) {
73 if (gp.hasVertexColor()) { 73 if (gp.hasVertexColor()) {
74 pb->addPassThroughAttribute(gp.inColor(), args.fOutputColor) ; 74 pb->addPassThroughAttribute(gp.inColor(), args.fOutputColor) ;
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 } 310 }
311 311
312 if (localCoords.hasLocalMatrix()) { 312 if (localCoords.hasLocalMatrix()) {
313 invert.preConcat(*localCoords.fMatrix); 313 invert.preConcat(*localCoords.fMatrix);
314 } 314 }
315 } 315 }
316 316
317 LocalCoords inverted(LocalCoords::kUsePosition_Type, &invert); 317 LocalCoords inverted(LocalCoords::kUsePosition_Type, &invert);
318 return Create(color, coverage, inverted, SkMatrix::I()); 318 return Create(color, coverage, inverted, SkMatrix::I());
319 } 319 }
OLDNEW
« no previous file with comments | « src/effects/gradients/SkSweepGradient.cpp ('k') | src/gpu/GrOvalRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698