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

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

Issue 1709153002: Add more specialized fragment builders (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Make MSVC happy Created 4 years, 10 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
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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 bool hasVertexCoverage() const { return SkToBool(fInCoverage); } 58 bool hasVertexCoverage() const { return SkToBool(fInCoverage); }
59 59
60 class GLSLProcessor : public GrGLSLGeometryProcessor { 60 class GLSLProcessor : public GrGLSLGeometryProcessor {
61 public: 61 public:
62 GLSLProcessor() 62 GLSLProcessor()
63 : fViewMatrix(SkMatrix::InvalidMatrix()), fColor(GrColor_ILLEGAL), f Coverage(0xff) {} 63 : fViewMatrix(SkMatrix::InvalidMatrix()), fColor(GrColor_ILLEGAL), f Coverage(0xff) {}
64 64
65 void onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) override { 65 void onEmitCode(EmitArgs& args, GrGPArgs* gpArgs) override {
66 const DefaultGeoProc& gp = args.fGP.cast<DefaultGeoProc>(); 66 const DefaultGeoProc& gp = args.fGP.cast<DefaultGeoProc>();
67 GrGLSLVertexBuilder* vertBuilder = args.fVertBuilder; 67 GrGLSLVertexBuilder* vertBuilder = args.fVertBuilder;
68 GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder; 68 GrGLSLPPFragmentBuilder* fragBuilder = args.fFragBuilder;
69 GrGLSLVaryingHandler* varyingHandler = args.fVaryingHandler; 69 GrGLSLVaryingHandler* varyingHandler = args.fVaryingHandler;
70 GrGLSLUniformHandler* uniformHandler = args.fUniformHandler; 70 GrGLSLUniformHandler* uniformHandler = args.fUniformHandler;
71 71
72 // emit attributes 72 // emit attributes
73 varyingHandler->emitAttributes(gp); 73 varyingHandler->emitAttributes(gp);
74 74
75 // Setup pass through color 75 // Setup pass through color
76 if (!gp.colorIgnored()) { 76 if (!gp.colorIgnored()) {
77 if (gp.hasVertexColor()) { 77 if (gp.hasVertexColor()) {
78 varyingHandler->addPassThroughAttribute(gp.inColor(), args.f OutputColor); 78 varyingHandler->addPassThroughAttribute(gp.inColor(), args.f OutputColor);
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 } 334 }
335 335
336 if (localCoords.hasLocalMatrix()) { 336 if (localCoords.hasLocalMatrix()) {
337 invert.preConcat(*localCoords.fMatrix); 337 invert.preConcat(*localCoords.fMatrix);
338 } 338 }
339 } 339 }
340 340
341 LocalCoords inverted(LocalCoords::kUsePosition_Type, &invert); 341 LocalCoords inverted(LocalCoords::kUsePosition_Type, &invert);
342 return Create(color, coverage, inverted, SkMatrix::I()); 342 return Create(color, coverage, inverted, SkMatrix::I());
343 } 343 }
OLDNEW
« no previous file with comments | « src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp ('k') | src/gpu/GrFragmentProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698