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

Side by Side Diff: src/effects/gradients/SkTwoPointRadialGradient.cpp

Issue 551253004: Changes to remove program effects builder (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase 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
OLDNEW
1 1
2 /* 2 /*
3 * Copyright 2012 Google Inc. 3 * Copyright 2012 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkTwoPointRadialGradient.h" 9 #include "SkTwoPointRadialGradient.h"
10 10
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
591 SkString p5; 591 SkString p5;
592 builder->getUniformVariable(fParamUni).appendArrayAccess(0, &p0); 592 builder->getUniformVariable(fParamUni).appendArrayAccess(0, &p0);
593 builder->getUniformVariable(fParamUni).appendArrayAccess(1, &p1); 593 builder->getUniformVariable(fParamUni).appendArrayAccess(1, &p1);
594 builder->getUniformVariable(fParamUni).appendArrayAccess(2, &p2); 594 builder->getUniformVariable(fParamUni).appendArrayAccess(2, &p2);
595 builder->getUniformVariable(fParamUni).appendArrayAccess(3, &p3); 595 builder->getUniformVariable(fParamUni).appendArrayAccess(3, &p3);
596 builder->getUniformVariable(fParamUni).appendArrayAccess(4, &p4); 596 builder->getUniformVariable(fParamUni).appendArrayAccess(4, &p4);
597 builder->getUniformVariable(fParamUni).appendArrayAccess(5, &p5); 597 builder->getUniformVariable(fParamUni).appendArrayAccess(5, &p5);
598 598
599 GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder(); 599 GrGLFragmentShaderBuilder* fsBuilder = builder->getFragmentShaderBuilder();
600 // We interpolate the linear component in coords[1]. 600 // We interpolate the linear component in coords[1].
601 SkASSERT(coords[0].type() == coords[1].type()); 601 SkASSERT(coords[0].getType() == coords[1].getType());
602 const char* coords2D; 602 const char* coords2D;
603 SkString bVar; 603 SkString bVar;
604 if (kVec3f_GrSLType == coords[0].type()) { 604 if (kVec3f_GrSLType == coords[0].getType()) {
605 fsBuilder->codeAppendf("\tvec3 interpolants = vec3(%s.xy, %s.x) / %s.z;\ n", 605 fsBuilder->codeAppendf("\tvec3 interpolants = vec3(%s.xy, %s.x) / %s.z;\ n",
606 coords[0].c_str(), coords[1].c_str(), coords[0].c _str()); 606 coords[0].c_str(), coords[1].c_str(), coords[0].c _str());
607 coords2D = "interpolants.xy"; 607 coords2D = "interpolants.xy";
608 bVar = "interpolants.z"; 608 bVar = "interpolants.z";
609 } else { 609 } else {
610 coords2D = coords[0].c_str(); 610 coords2D = coords[0].c_str();
611 bVar.printf("%s.x", coords[1].c_str()); 611 bVar.printf("%s.x", coords[1].c_str());
612 } 612 }
613 613
614 // c = (x^2)+(y^2) - params[4] 614 // c = (x^2)+(y^2) - params[4]
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 #else 721 #else
722 722
723 bool SkTwoPointRadialGradient::asNewEffect(GrContext* context, const SkPaint& pa int, 723 bool SkTwoPointRadialGradient::asNewEffect(GrContext* context, const SkPaint& pa int,
724 const SkMatrix* localMatrix, GrColor* paintColor, 724 const SkMatrix* localMatrix, GrColor* paintColor,
725 GrEffect** effect) const { 725 GrEffect** effect) const {
726 SkDEBUGFAIL("Should not call in GPU-less build"); 726 SkDEBUGFAIL("Should not call in GPU-less build");
727 return false; 727 return false;
728 } 728 }
729 729
730 #endif 730 #endif
OLDNEW
« no previous file with comments | « src/effects/gradients/SkTwoPointConicalGradient_gpu.cpp ('k') | src/gpu/effects/GrConfigConversionEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698