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/SkTwoPointRadialGradient.cpp

Issue 26190003: Potentially optimize some GrGLEffects for known input color values (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 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/SkTwoPointConicalGradient.cpp ('k') | src/gpu/GrAAConvexPathRenderer.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 "SkTwoPointRadialGradient.h" 9 #include "SkTwoPointRadialGradient.h"
10 10
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 381
382 public: 382 public:
383 383
384 GrGLRadial2Gradient(const GrBackendEffectFactory& factory, const GrDrawEffec t&); 384 GrGLRadial2Gradient(const GrBackendEffectFactory& factory, const GrDrawEffec t&);
385 virtual ~GrGLRadial2Gradient() { } 385 virtual ~GrGLRadial2Gradient() { }
386 386
387 virtual void emitCode(GrGLShaderBuilder*, 387 virtual void emitCode(GrGLShaderBuilder*,
388 const GrDrawEffect&, 388 const GrDrawEffect&,
389 EffectKey, 389 EffectKey,
390 const char* outputColor, 390 const char* outputColor,
391 const char* inputColor, 391 const GrGLSLExpr4& inputColor,
392 const TransformedCoordsArray&, 392 const TransformedCoordsArray&,
393 const TextureSamplerArray&) SK_OVERRIDE; 393 const TextureSamplerArray&) SK_OVERRIDE;
394 virtual void setData(const GrGLUniformManager&, const GrDrawEffect&) SK_OVER RIDE; 394 virtual void setData(const GrGLUniformManager&, const GrDrawEffect&) SK_OVER RIDE;
395 395
396 static EffectKey GenKey(const GrDrawEffect&, const GrGLCaps& caps); 396 static EffectKey GenKey(const GrDrawEffect&, const GrGLCaps& caps);
397 397
398 protected: 398 protected:
399 399
400 UniformHandle fParamUni; 400 UniformHandle fParamUni;
401 401
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 , fCachedPosRoot(0) { 535 , fCachedPosRoot(0) {
536 536
537 const GrRadial2Gradient& data = drawEffect.castEffect<GrRadial2Gradient>(); 537 const GrRadial2Gradient& data = drawEffect.castEffect<GrRadial2Gradient>();
538 fIsDegenerate = data.isDegenerate(); 538 fIsDegenerate = data.isDegenerate();
539 } 539 }
540 540
541 void GrGLRadial2Gradient::emitCode(GrGLShaderBuilder* builder, 541 void GrGLRadial2Gradient::emitCode(GrGLShaderBuilder* builder,
542 const GrDrawEffect& drawEffect, 542 const GrDrawEffect& drawEffect,
543 EffectKey key, 543 EffectKey key,
544 const char* outputColor, 544 const char* outputColor,
545 const char* inputColor, 545 const GrGLSLExpr4& inputColor,
546 const TransformedCoordsArray& coords, 546 const TransformedCoordsArray& coords,
547 const TextureSamplerArray& samplers) { 547 const TextureSamplerArray& samplers) {
548 548
549 this->emitUniforms(builder, key); 549 this->emitUniforms(builder, key);
550 fParamUni = builder->addUniformArray(GrGLShaderBuilder::kFragment_Visibility , 550 fParamUni = builder->addUniformArray(GrGLShaderBuilder::kFragment_Visibility ,
551 kFloat_GrSLType, "Radial2FSParams", 6); 551 kFloat_GrSLType, "Radial2FSParams", 6);
552 552
553 SkString cName("c"); 553 SkString cName("c");
554 SkString ac4Name("ac4"); 554 SkString ac4Name("ac4");
555 SkString rootName("root"); 555 SkString rootName("root");
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 } 682 }
683 683
684 #else 684 #else
685 685
686 GrEffectRef* SkTwoPointRadialGradient::asNewEffect(GrContext*, const SkPaint&) c onst { 686 GrEffectRef* SkTwoPointRadialGradient::asNewEffect(GrContext*, const SkPaint&) c onst {
687 SkDEBUGFAIL("Should not call in GPU-less build"); 687 SkDEBUGFAIL("Should not call in GPU-less build");
688 return NULL; 688 return NULL;
689 } 689 }
690 690
691 #endif 691 #endif
OLDNEW
« no previous file with comments | « src/effects/gradients/SkTwoPointConicalGradient.cpp ('k') | src/gpu/GrAAConvexPathRenderer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698