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

Side by Side Diff: src/gpu/gl/builders/GrGLProgramBuilder.cpp

Issue 778783002: Use texture size to determine precision of texture coord varyings (Closed) Base URL: https://skia.googlesource.com/skia.git@defaultp
Patch Set: include skrandom.h in new gm cpp 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 | « src/gpu/gl/builders/GrGLProgramBuilder.h ('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 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 "GrGLProgramBuilder.h" 8 #include "GrGLProgramBuilder.h"
9 #include "gl/GrGLProgram.h" 9 #include "gl/GrGLProgram.h"
10 #include "gl/GrGLSLPrettyPrint.h" 10 #include "gl/GrGLSLPrettyPrint.h"
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 if (0 != t) { 406 if (0 != t) {
407 suffixedVaryingName.append(varyingName); 407 suffixedVaryingName.append(varyingName);
408 suffixedVaryingName.appendf("_%i", t); 408 suffixedVaryingName.appendf("_%i", t);
409 varyingName = suffixedVaryingName.c_str(); 409 varyingName = suffixedVaryingName.c_str();
410 } 410 }
411 411
412 bool useLocalCoords = kLocal_GrCoordSet == processor->coordTransform(t). sourceCoords(); 412 bool useLocalCoords = kLocal_GrCoordSet == processor->coordTransform(t). sourceCoords();
413 const char* coords = useLocalCoords ? fVS.localCoords() : fVS.positionCo ords(); 413 const char* coords = useLocalCoords ? fVS.localCoords() : fVS.positionCo ords();
414 414
415 GrGLVertToFrag v(varyingType); 415 GrGLVertToFrag v(varyingType);
416 this->addCoordVarying(varyingName, &v, uniName, coords); 416 this->addVarying(varyingName, &v, processor->coordTransform(t).precision ());
417 fCoordVaryings.push_back(TransformVarying(v, uniName, coords));
417 418
418 SkASSERT(kVec2f_GrSLType == varyingType || kVec3f_GrSLType == varyingTyp e); 419 SkASSERT(kVec2f_GrSLType == varyingType || kVec3f_GrSLType == varyingTyp e);
419 SkNEW_APPEND_TO_TARRAY(outCoords, GrGLProcessor::TransformedCoords, 420 SkNEW_APPEND_TO_TARRAY(outCoords, GrGLProcessor::TransformedCoords,
420 (SkString(v.fsIn()), varyingType)); 421 (SkString(v.fsIn()), varyingType));
421 } 422 }
422 } 423 }
423 424
424 void GrGLProgramBuilder::emitSamplers(const GrProcessor& processor, 425 void GrGLProgramBuilder::emitSamplers(const GrProcessor& processor,
425 GrGLProcessor::TextureSamplerArray* outSam plers, 426 GrGLProcessor::TextureSamplerArray* outSam plers,
426 GrGLInstalledProc* ip) { 427 GrGLInstalledProc* ip) {
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 } 547 }
547 548
548 //////////////////////////////////////////////////////////////////////////////// /////////////////// 549 //////////////////////////////////////////////////////////////////////////////// ///////////////////
549 550
550 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() { 551 GrGLInstalledFragProcs::~GrGLInstalledFragProcs() {
551 int numProcs = fProcs.count(); 552 int numProcs = fProcs.count();
552 for (int e = 0; e < numProcs; ++e) { 553 for (int e = 0; e < numProcs; ++e) {
553 SkDELETE(fProcs[e]); 554 SkDELETE(fProcs[e]);
554 } 555 }
555 } 556 }
OLDNEW
« no previous file with comments | « src/gpu/gl/builders/GrGLProgramBuilder.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698