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/effects/GrBezierEffect.cpp

Issue 776953002: bug fix for cubic low precision (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years 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 | « expectations/gm/ignored-tests.txt ('k') | no next file » | 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 "GrBezierEffect.h" 8 #include "GrBezierEffect.h"
9 9
10 #include "gl/builders/GrGLProgramBuilder.h" 10 #include "gl/builders/GrGLProgramBuilder.h"
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 : INHERITED (factory) { 314 : INHERITED (factory) {
315 const GrCubicEffect& ce = processor.cast<GrCubicEffect>(); 315 const GrCubicEffect& ce = processor.cast<GrCubicEffect>();
316 fEdgeType = ce.getEdgeType(); 316 fEdgeType = ce.getEdgeType();
317 } 317 }
318 318
319 void GrGLCubicEffect::emitCode(const EmitArgs& args) { 319 void GrGLCubicEffect::emitCode(const EmitArgs& args) {
320 GrGLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder(); 320 GrGLVertexBuilder* vsBuilder = args.fPB->getVertexShaderBuilder();
321 const GrCubicEffect& gp = args.fGP.cast<GrCubicEffect>(); 321 const GrCubicEffect& gp = args.fGP.cast<GrCubicEffect>();
322 322
323 GrGLVertToFrag v(kVec4f_GrSLType); 323 GrGLVertToFrag v(kVec4f_GrSLType);
324 args.fPB->addVarying("CubicCoeffs", &v); 324 args.fPB->addVarying("CubicCoeffs", &v, GrGLShaderVar::kHigh_Precision);
325 vsBuilder->codeAppendf("%s = %s;", v.vsOut(), gp.inCubicCoeffs()->fName); 325 vsBuilder->codeAppendf("%s = %s;", v.vsOut(), gp.inCubicCoeffs()->fName);
326 326
327 // setup coord outputs 327 // setup coord outputs
328 vsBuilder->codeAppendf("%s = %s;", vsBuilder->positionCoords(), gp.inPositio n()->fName); 328 vsBuilder->codeAppendf("%s = %s;", vsBuilder->positionCoords(), gp.inPositio n()->fName);
329 vsBuilder->codeAppendf("%s = %s;", vsBuilder->localCoords(), gp.inPosition() ->fName); 329 vsBuilder->codeAppendf("%s = %s;", vsBuilder->localCoords(), gp.inPosition() ->fName);
330 330
331 // setup position varying 331 // setup position varying
332 vsBuilder->codeAppendf("%s = %s * vec3(%s, 1);", vsBuilder->glPosition(), vs Builder->uViewM(), 332 vsBuilder->codeAppendf("%s = %s * vec3(%s, 1);", vsBuilder->glPosition(), vs Builder->uViewM(),
333 gp.inPosition()->fName); 333 gp.inPosition()->fName);
334 334
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 GrTexture*[]) { 456 GrTexture*[]) {
457 GrGeometryProcessor* gp; 457 GrGeometryProcessor* gp;
458 do { 458 do {
459 GrPrimitiveEdgeType edgeType = static_cast<GrPrimitiveEdgeType>( 459 GrPrimitiveEdgeType edgeType = static_cast<GrPrimitiveEdgeType>(
460 random->nextULessThan(kGrPro cessorEdgeTypeCnt)); 460 random->nextULessThan(kGrPro cessorEdgeTypeCnt));
461 gp = GrCubicEffect::Create(edgeType, caps); 461 gp = GrCubicEffect::Create(edgeType, caps);
462 } while (NULL == gp); 462 } while (NULL == gp);
463 return gp; 463 return gp;
464 } 464 }
465 465
OLDNEW
« no previous file with comments | « expectations/gm/ignored-tests.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698