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

Side by Side Diff: src/gpu/GrPathProcessor.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
« no previous file with comments | « src/gpu/GrOvalRenderer.cpp ('k') | src/gpu/batches/GrAAConvexPathRenderer.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 2013 Google Inc. 2 * Copyright 2013 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 "GrPathProcessor.h" 8 #include "GrPathProcessor.h"
9 9
10 #include "gl/GrGLGpu.h" 10 #include "gl/GrGLGpu.h"
11 #include "glsl/GrGLSLCaps.h" 11 #include "glsl/GrGLSLCaps.h"
12 #include "glsl/GrGLSLFragmentShaderBuilder.h" 12 #include "glsl/GrGLSLFragmentShaderBuilder.h"
13 #include "glsl/GrGLSLProcessorTypes.h" 13 #include "glsl/GrGLSLProcessorTypes.h"
14 #include "glsl/GrGLSLUniformHandler.h" 14 #include "glsl/GrGLSLUniformHandler.h"
15 #include "glsl/GrGLSLVarying.h" 15 #include "glsl/GrGLSLVarying.h"
16 16
17 class GrGLPathProcessor : public GrGLSLPrimitiveProcessor { 17 class GrGLPathProcessor : public GrGLSLPrimitiveProcessor {
18 public: 18 public:
19 GrGLPathProcessor() : fColor(GrColor_ILLEGAL) {} 19 GrGLPathProcessor() : fColor(GrColor_ILLEGAL) {}
20 20
21 static void GenKey(const GrPathProcessor& pathProc, 21 static void GenKey(const GrPathProcessor& pathProc,
22 const GrGLSLCaps&, 22 const GrGLSLCaps&,
23 GrProcessorKeyBuilder* b) { 23 GrProcessorKeyBuilder* b) {
24 b->add32(SkToInt(pathProc.overrides().readsColor()) | 24 b->add32(SkToInt(pathProc.overrides().readsColor()) |
25 (SkToInt(pathProc.overrides().readsCoverage()) << 1) | 25 (SkToInt(pathProc.overrides().readsCoverage()) << 1) |
26 (SkToInt(pathProc.viewMatrix().hasPerspective()) << 2)); 26 (SkToInt(pathProc.viewMatrix().hasPerspective()) << 2));
27 } 27 }
28 28
29 void emitCode(EmitArgs& args) override { 29 void emitCode(EmitArgs& args) override {
30 GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder; 30 GrGLSLPPFragmentBuilder* fragBuilder = args.fFragBuilder;
31 const GrPathProcessor& pathProc = args.fGP.cast<GrPathProcessor>(); 31 const GrPathProcessor& pathProc = args.fGP.cast<GrPathProcessor>();
32 32
33 if (!pathProc.viewMatrix().hasPerspective()) { 33 if (!pathProc.viewMatrix().hasPerspective()) {
34 args.fVaryingHandler->setNoPerspective(); 34 args.fVaryingHandler->setNoPerspective();
35 } 35 }
36 36
37 // emit transforms 37 // emit transforms
38 this->emitTransforms(args.fVaryingHandler, args.fTransformsIn, args.fTra nsformsOut); 38 this->emitTransforms(args.fVaryingHandler, args.fTransformsIn, args.fTra nsformsOut);
39 39
40 // Setup uniform color 40 // Setup uniform color
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 135
136 void GrPathProcessor::getGLSLProcessorKey(const GrGLSLCaps& caps, 136 void GrPathProcessor::getGLSLProcessorKey(const GrGLSLCaps& caps,
137 GrProcessorKeyBuilder* b) const { 137 GrProcessorKeyBuilder* b) const {
138 GrGLPathProcessor::GenKey(*this, caps, b); 138 GrGLPathProcessor::GenKey(*this, caps, b);
139 } 139 }
140 140
141 GrGLSLPrimitiveProcessor* GrPathProcessor::createGLSLInstance(const GrGLSLCaps& caps) const { 141 GrGLSLPrimitiveProcessor* GrPathProcessor::createGLSLInstance(const GrGLSLCaps& caps) const {
142 SkASSERT(caps.pathRenderingSupport()); 142 SkASSERT(caps.pathRenderingSupport());
143 return new GrGLPathProcessor(); 143 return new GrGLPathProcessor();
144 } 144 }
OLDNEW
« no previous file with comments | « src/gpu/GrOvalRenderer.cpp ('k') | src/gpu/batches/GrAAConvexPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698