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

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

Issue 23706003: Fix case where GrGLEffectMatrix gives back a dangling ptr for the coords var name. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Rob's comments Created 7 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 | Annotate | Revision Log
« no previous file with comments | « src/effects/gradients/SkLinearGradient.cpp ('k') | src/effects/gradients/SkSweepGradient.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 /* 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 "SkRadialGradient.h" 9 #include "SkRadialGradient.h"
10 #include "SkRadialGradient_Table.h" 10 #include "SkRadialGradient_Table.h"
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 552
553 ///////////////////////////////////////////////////////////////////// 553 /////////////////////////////////////////////////////////////////////
554 554
555 void GrGLRadialGradient::emitCode(GrGLShaderBuilder* builder, 555 void GrGLRadialGradient::emitCode(GrGLShaderBuilder* builder,
556 const GrDrawEffect&, 556 const GrDrawEffect&,
557 EffectKey key, 557 EffectKey key,
558 const char* outputColor, 558 const char* outputColor,
559 const char* inputColor, 559 const char* inputColor,
560 const TextureSamplerArray& samplers) { 560 const TextureSamplerArray& samplers) {
561 this->emitYCoordUniform(builder); 561 this->emitYCoordUniform(builder);
562 const char* coords; 562 SkString coords;
563 this->setupMatrix(builder, key, &coords); 563 this->setupMatrix(builder, key, &coords);
564 SkString t("length("); 564 SkString t("length(");
565 t.append(coords); 565 t.append(coords);
566 t.append(")"); 566 t.append(")");
567 this->emitColorLookup(builder, t.c_str(), outputColor, inputColor, samplers[ 0]); 567 this->emitColorLookup(builder, t.c_str(), outputColor, inputColor, samplers[ 0]);
568 } 568 }
569 569
570 ///////////////////////////////////////////////////////////////////// 570 /////////////////////////////////////////////////////////////////////
571 571
572 GrEffectRef* SkRadialGradient::asNewEffect(GrContext* context, const SkPaint&) c onst { 572 GrEffectRef* SkRadialGradient::asNewEffect(GrContext* context, const SkPaint&) c onst {
(...skipping 26 matching lines...) Expand all
599 str->appendScalar(fCenter.fY); 599 str->appendScalar(fCenter.fY);
600 str->append(") radius: "); 600 str->append(") radius: ");
601 str->appendScalar(fRadius); 601 str->appendScalar(fRadius);
602 str->append(" "); 602 str->append(" ");
603 603
604 this->INHERITED::toString(str); 604 this->INHERITED::toString(str);
605 605
606 str->append(")"); 606 str->append(")");
607 } 607 }
608 #endif 608 #endif
OLDNEW
« no previous file with comments | « src/effects/gradients/SkLinearGradient.cpp ('k') | src/effects/gradients/SkSweepGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698