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

Side by Side Diff: src/gpu/GrOvalRenderer.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/GrFragmentProcessor.cpp ('k') | src/gpu/GrPathProcessor.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 "GrOvalRenderer.h" 8 #include "GrOvalRenderer.h"
9 9
10 #include "GrBatchFlushState.h" 10 #include "GrBatchFlushState.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 GrGLSLVaryingHandler* varyingHandler = args.fVaryingHandler; 106 GrGLSLVaryingHandler* varyingHandler = args.fVaryingHandler;
107 GrGLSLUniformHandler* uniformHandler = args.fUniformHandler; 107 GrGLSLUniformHandler* uniformHandler = args.fUniformHandler;
108 108
109 // emit attributes 109 // emit attributes
110 varyingHandler->emitAttributes(ce); 110 varyingHandler->emitAttributes(ce);
111 111
112 GrGLSLVertToFrag v(kVec4f_GrSLType); 112 GrGLSLVertToFrag v(kVec4f_GrSLType);
113 varyingHandler->addVarying("CircleEdge", &v); 113 varyingHandler->addVarying("CircleEdge", &v);
114 vertBuilder->codeAppendf("%s = %s;", v.vsOut(), ce.inCircleEdge()->f Name); 114 vertBuilder->codeAppendf("%s = %s;", v.vsOut(), ce.inCircleEdge()->f Name);
115 115
116 GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder; 116 GrGLSLPPFragmentBuilder* fragBuilder = args.fFragBuilder;
117 // setup pass through color 117 // setup pass through color
118 if (!ce.colorIgnored()) { 118 if (!ce.colorIgnored()) {
119 varyingHandler->addPassThroughAttribute(ce.inColor(), args.fOutp utColor); 119 varyingHandler->addPassThroughAttribute(ce.inColor(), args.fOutp utColor);
120 } 120 }
121 121
122 // Setup position 122 // Setup position
123 this->setupPosition(vertBuilder, gpArgs, ce.inPosition()->fName); 123 this->setupPosition(vertBuilder, gpArgs, ce.inPosition()->fName);
124 124
125 // emit transforms 125 // emit transforms
126 this->emitTransforms(vertBuilder, 126 this->emitTransforms(vertBuilder,
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 GrGLSLVertToFrag ellipseOffsets(kVec2f_GrSLType); 261 GrGLSLVertToFrag ellipseOffsets(kVec2f_GrSLType);
262 varyingHandler->addVarying("EllipseOffsets", &ellipseOffsets); 262 varyingHandler->addVarying("EllipseOffsets", &ellipseOffsets);
263 vertBuilder->codeAppendf("%s = %s;", ellipseOffsets.vsOut(), 263 vertBuilder->codeAppendf("%s = %s;", ellipseOffsets.vsOut(),
264 ee.inEllipseOffset()->fName); 264 ee.inEllipseOffset()->fName);
265 265
266 GrGLSLVertToFrag ellipseRadii(kVec4f_GrSLType); 266 GrGLSLVertToFrag ellipseRadii(kVec4f_GrSLType);
267 varyingHandler->addVarying("EllipseRadii", &ellipseRadii); 267 varyingHandler->addVarying("EllipseRadii", &ellipseRadii);
268 vertBuilder->codeAppendf("%s = %s;", ellipseRadii.vsOut(), 268 vertBuilder->codeAppendf("%s = %s;", ellipseRadii.vsOut(),
269 ee.inEllipseRadii()->fName); 269 ee.inEllipseRadii()->fName);
270 270
271 GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder; 271 GrGLSLPPFragmentBuilder* fragBuilder = args.fFragBuilder;
272 // setup pass through color 272 // setup pass through color
273 if (!ee.colorIgnored()) { 273 if (!ee.colorIgnored()) {
274 varyingHandler->addPassThroughAttribute(ee.inColor(), args.fOutp utColor); 274 varyingHandler->addPassThroughAttribute(ee.inColor(), args.fOutp utColor);
275 } 275 }
276 276
277 // Setup position 277 // Setup position
278 this->setupPosition(vertBuilder, gpArgs, ee.inPosition()->fName); 278 this->setupPosition(vertBuilder, gpArgs, ee.inPosition()->fName);
279 279
280 // emit transforms 280 // emit transforms
281 this->emitTransforms(vertBuilder, 281 this->emitTransforms(vertBuilder,
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 GrGLSLVertToFrag offsets0(kVec2f_GrSLType); 436 GrGLSLVertToFrag offsets0(kVec2f_GrSLType);
437 varyingHandler->addVarying("EllipseOffsets0", &offsets0); 437 varyingHandler->addVarying("EllipseOffsets0", &offsets0);
438 vertBuilder->codeAppendf("%s = %s;", offsets0.vsOut(), 438 vertBuilder->codeAppendf("%s = %s;", offsets0.vsOut(),
439 ee.inEllipseOffsets0()->fName); 439 ee.inEllipseOffsets0()->fName);
440 440
441 GrGLSLVertToFrag offsets1(kVec2f_GrSLType); 441 GrGLSLVertToFrag offsets1(kVec2f_GrSLType);
442 varyingHandler->addVarying("EllipseOffsets1", &offsets1); 442 varyingHandler->addVarying("EllipseOffsets1", &offsets1);
443 vertBuilder->codeAppendf("%s = %s;", offsets1.vsOut(), 443 vertBuilder->codeAppendf("%s = %s;", offsets1.vsOut(),
444 ee.inEllipseOffsets1()->fName); 444 ee.inEllipseOffsets1()->fName);
445 445
446 GrGLSLFragmentBuilder* fragBuilder = args.fFragBuilder; 446 GrGLSLPPFragmentBuilder* fragBuilder = args.fFragBuilder;
447 // setup pass through color 447 // setup pass through color
448 if (!ee.colorIgnored()) { 448 if (!ee.colorIgnored()) {
449 varyingHandler->addPassThroughAttribute(ee.inColor(), args.fOutp utColor); 449 varyingHandler->addPassThroughAttribute(ee.inColor(), args.fOutp utColor);
450 } 450 }
451 451
452 // Setup position 452 // Setup position
453 this->setupPosition(vertBuilder, 453 this->setupPosition(vertBuilder,
454 uniformHandler, 454 uniformHandler,
455 gpArgs, 455 gpArgs,
456 ee.inPosition()->fName, 456 ee.inPosition()->fName,
(...skipping 1601 matching lines...) Expand 10 before | Expand all | Expand 10 after
2058 } 2058 }
2059 2059
2060 DRAW_BATCH_TEST_DEFINE(RRectBatch) { 2060 DRAW_BATCH_TEST_DEFINE(RRectBatch) {
2061 SkMatrix viewMatrix = GrTest::TestMatrixRectStaysRect(random); 2061 SkMatrix viewMatrix = GrTest::TestMatrixRectStaysRect(random);
2062 GrColor color = GrRandomColor(random); 2062 GrColor color = GrRandomColor(random);
2063 const SkRRect& rrect = GrTest::TestRRectSimple(random); 2063 const SkRRect& rrect = GrTest::TestRRectSimple(random);
2064 return create_rrect_batch(color, viewMatrix, rrect, GrTest::TestStrokeRec(ra ndom)); 2064 return create_rrect_batch(color, viewMatrix, rrect, GrTest::TestStrokeRec(ra ndom));
2065 } 2065 }
2066 2066
2067 #endif 2067 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrFragmentProcessor.cpp ('k') | src/gpu/GrPathProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698