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

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

Issue 22854005: GPU Gradients (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: remove dead line of code 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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 virtual ~GrGLRadialGradient() { } 477 virtual ~GrGLRadialGradient() { }
478 478
479 virtual void emitCode(GrGLShaderBuilder*, 479 virtual void emitCode(GrGLShaderBuilder*,
480 const GrDrawEffect&, 480 const GrDrawEffect&,
481 EffectKey, 481 EffectKey,
482 const char* outputColor, 482 const char* outputColor,
483 const char* inputColor, 483 const char* inputColor,
484 const TextureSamplerArray&) SK_OVERRIDE; 484 const TextureSamplerArray&) SK_OVERRIDE;
485 485
486 static EffectKey GenKey(const GrDrawEffect& drawEffect, const GrGLCaps&) { 486 static EffectKey GenKey(const GrDrawEffect& drawEffect, const GrGLCaps&) {
487 return GenMatrixKey(drawEffect); 487 return GenBaseGradientKey(drawEffect);
488 } 488 }
489 489
490 private: 490 private:
491 491
492 typedef GrGLGradientEffect INHERITED; 492 typedef GrGLGradientEffect INHERITED;
493 493
494 }; 494 };
495 495
496 ///////////////////////////////////////////////////////////////////// 496 /////////////////////////////////////////////////////////////////////
497 497
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 } 551 }
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->emitUniforms(builder, key);
562 SkString 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->emitColor(builder, t.c_str(), key, outputColor, inputColor, samplers);
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 {
573 SkASSERT(NULL != context); 573 SkASSERT(NULL != context);
574 574
575 SkMatrix matrix; 575 SkMatrix matrix;
576 if (!this->getLocalMatrix().invert(&matrix)) { 576 if (!this->getLocalMatrix().invert(&matrix)) {
577 return NULL; 577 return NULL;
(...skipping 21 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