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

Side by Side Diff: src/effects/gradients/SkLinearGradient.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
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 "SkLinearGradient.h" 9 #include "SkLinearGradient.h"
10 10
(...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after
518 518
519 ///////////////////////////////////////////////////////////////////// 519 /////////////////////////////////////////////////////////////////////
520 520
521 void GrGLLinearGradient::emitCode(GrGLShaderBuilder* builder, 521 void GrGLLinearGradient::emitCode(GrGLShaderBuilder* builder,
522 const GrDrawEffect&, 522 const GrDrawEffect&,
523 EffectKey key, 523 EffectKey key,
524 const char* outputColor, 524 const char* outputColor,
525 const char* inputColor, 525 const char* inputColor,
526 const TextureSamplerArray& samplers) { 526 const TextureSamplerArray& samplers) {
527 this->emitYCoordUniform(builder); 527 this->emitYCoordUniform(builder);
528 const char* coords; 528 SkString coords;
529 this->setupMatrix(builder, key, &coords); 529 this->setupMatrix(builder, key, &coords);
530 SkString t; 530 SkString t;
531 t.append(coords); 531 t.append(coords);
532 t.append(".x"); 532 t.append(".x");
533 this->emitColorLookup(builder, t.c_str(), outputColor, inputColor, samplers[ 0]); 533 this->emitColorLookup(builder, t.c_str(), outputColor, inputColor, samplers[ 0]);
534 } 534 }
535 535
536 ///////////////////////////////////////////////////////////////////// 536 /////////////////////////////////////////////////////////////////////
537 537
538 GrEffectRef* SkLinearGradient::asNewEffect(GrContext* context, const SkPaint&) c onst { 538 GrEffectRef* SkLinearGradient::asNewEffect(GrContext* context, const SkPaint&) c onst {
(...skipping 20 matching lines...) Expand all
559 str->append("SkLinearGradient ("); 559 str->append("SkLinearGradient (");
560 560
561 str->appendf("start: (%f, %f)", fStart.fX, fStart.fY); 561 str->appendf("start: (%f, %f)", fStart.fX, fStart.fY);
562 str->appendf(" end: (%f, %f) ", fEnd.fX, fEnd.fY); 562 str->appendf(" end: (%f, %f) ", fEnd.fX, fEnd.fY);
563 563
564 this->INHERITED::toString(str); 564 this->INHERITED::toString(str);
565 565
566 str->append(")"); 566 str->append(")");
567 } 567 }
568 #endif 568 #endif
OLDNEW
« no previous file with comments | « src/effects/gradients/SkGradientShaderPriv.h ('k') | src/effects/gradients/SkRadialGradient.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698