Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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; |
|
robertphillips
2013/08/28 14:48:44
The ".c_str()" shouldn't be necessary here.
bsalomon
2013/08/28 15:39:59
Done.
| |
| 531 t.append(coords); | 531 t.append(coords.c_str()); |
| 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 { |
| 539 SkASSERT(NULL != context); | 539 SkASSERT(NULL != context); |
| 540 SkMatrix matrix; | 540 SkMatrix matrix; |
| 541 if (!this->getLocalMatrix().invert(&matrix)) { | 541 if (!this->getLocalMatrix().invert(&matrix)) { |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 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 |
| OLD | NEW |