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

Side by Side Diff: src/gpu/effects/GrBezierEffect.cpp

Issue 522303004: Add option to add precision to varyings in shader (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Change param to fsPrecision Created 6 years, 3 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 | « no previous file | src/gpu/gl/builders/GrGLFragmentShaderBuilder.h » ('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 "gl/builders/GrGLProgramBuilder.h" 8 #include "gl/builders/GrGLProgramBuilder.h"
9 #include "GrBezierEffect.h" 9 #include "GrBezierEffect.h"
10 10
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 void GrGLCubicEffect::emitCode(GrGLFullProgramBuilder* builder, 335 void GrGLCubicEffect::emitCode(GrGLFullProgramBuilder* builder,
336 const GrDrawEffect& drawEffect, 336 const GrDrawEffect& drawEffect,
337 const GrEffectKey& key, 337 const GrEffectKey& key,
338 const char* outputColor, 338 const char* outputColor,
339 const char* inputColor, 339 const char* inputColor,
340 const TransformedCoordsArray&, 340 const TransformedCoordsArray&,
341 const TextureSamplerArray& samplers) { 341 const TextureSamplerArray& samplers) {
342 const char *vsName, *fsName; 342 const char *vsName, *fsName;
343 343
344 builder->addVarying(kVec4f_GrSLType, "CubicCoeffs", 344 builder->addVarying(kVec4f_GrSLType, "CubicCoeffs",
345 &vsName, &fsName); 345 &vsName, &fsName, GrGLShaderVar::kHigh_Precision);
346 346
347 GrGLVertexShaderBuilder* vsBuilder = builder->getVertexShaderBuilder(); 347 GrGLVertexShaderBuilder* vsBuilder = builder->getVertexShaderBuilder();
348 const SkString* attr0Name = 348 const SkString* attr0Name =
349 vsBuilder->getEffectAttributeName(drawEffect.getVertexAttribIndices()[0] ); 349 vsBuilder->getEffectAttributeName(drawEffect.getVertexAttribIndices()[0] );
350 vsBuilder->codeAppendf("%s = %s;", vsName, attr0Name->c_str()); 350 vsBuilder->codeAppendf("%s = %s;", vsName, attr0Name->c_str());
351 351
352 GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder(); 352 GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
353 353
354 GrGLShaderVar edgeAlpha("edgeAlpha", kFloat_GrSLType, 0, GrGLShaderVar::kHig h_Precision); 354 GrGLShaderVar edgeAlpha("edgeAlpha", kFloat_GrSLType, 0, GrGLShaderVar::kHig h_Precision);
355 GrGLShaderVar dklmdx("dklmdx", kVec3f_GrSLType, 0, GrGLShaderVar::kHigh_Prec ision); 355 GrGLShaderVar dklmdx("dklmdx", kVec3f_GrSLType, 0, GrGLShaderVar::kHigh_Prec ision);
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 GrTexture*[]) { 471 GrTexture*[]) {
472 GrEffect* effect; 472 GrEffect* effect;
473 do { 473 do {
474 GrEffectEdgeType edgeType = static_cast<GrEffectEdgeType>( 474 GrEffectEdgeType edgeType = static_cast<GrEffectEdgeType>(
475 random->nextULessThan(kGrEff ectEdgeTypeCnt)); 475 random->nextULessThan(kGrEff ectEdgeTypeCnt));
476 effect = GrCubicEffect::Create(edgeType, caps); 476 effect = GrCubicEffect::Create(edgeType, caps);
477 } while (NULL == effect); 477 } while (NULL == effect);
478 return effect; 478 return effect;
479 } 479 }
480 480
OLDNEW
« no previous file with comments | « no previous file | src/gpu/gl/builders/GrGLFragmentShaderBuilder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698