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

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

Issue 22340010: Refactor GrGLUniformManager::UniformHandle to initialize itself by default (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: description Created 7 years, 4 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 "SkTwoPointRadialGradient.h" 9 #include "SkTwoPointRadialGradient.h"
10 10
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 } 369 }
370 370
371 ///////////////////////////////////////////////////////////////////// 371 /////////////////////////////////////////////////////////////////////
372 372
373 #if SK_SUPPORT_GPU 373 #if SK_SUPPORT_GPU
374 374
375 #include "GrTBackendEffectFactory.h" 375 #include "GrTBackendEffectFactory.h"
376 376
377 // For brevity 377 // For brevity
378 typedef GrGLUniformManager::UniformHandle UniformHandle; 378 typedef GrGLUniformManager::UniformHandle UniformHandle;
379 static const UniformHandle kInvalidUniformHandle = GrGLUniformManager::kInvalidU niformHandle;
380 379
381 class GrGLRadial2Gradient : public GrGLGradientEffect { 380 class GrGLRadial2Gradient : public GrGLGradientEffect {
382 381
383 public: 382 public:
384 383
385 GrGLRadial2Gradient(const GrBackendEffectFactory& factory, const GrDrawEffec t&); 384 GrGLRadial2Gradient(const GrBackendEffectFactory& factory, const GrDrawEffec t&);
386 virtual ~GrGLRadial2Gradient() { } 385 virtual ~GrGLRadial2Gradient() { }
387 386
388 virtual void emitCode(GrGLShaderBuilder*, 387 virtual void emitCode(GrGLShaderBuilder*,
389 const GrDrawEffect&, 388 const GrDrawEffect&,
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
509 tm)); 508 tm));
510 SkPaint paint; 509 SkPaint paint;
511 return shader->asNewEffect(context, paint); 510 return shader->asNewEffect(context, paint);
512 } 511 }
513 512
514 ///////////////////////////////////////////////////////////////////// 513 /////////////////////////////////////////////////////////////////////
515 514
516 GrGLRadial2Gradient::GrGLRadial2Gradient(const GrBackendEffectFactory& factory, 515 GrGLRadial2Gradient::GrGLRadial2Gradient(const GrBackendEffectFactory& factory,
517 const GrDrawEffect& drawEffect) 516 const GrDrawEffect& drawEffect)
518 : INHERITED(factory) 517 : INHERITED(factory)
519 , fVSParamUni(kInvalidUniformHandle)
520 , fFSParamUni(kInvalidUniformHandle)
521 , fVSVaryingName(NULL) 518 , fVSVaryingName(NULL)
522 , fFSVaryingName(NULL) 519 , fFSVaryingName(NULL)
523 , fCachedCenter(SK_ScalarMax) 520 , fCachedCenter(SK_ScalarMax)
524 , fCachedRadius(-SK_ScalarMax) 521 , fCachedRadius(-SK_ScalarMax)
525 , fCachedPosRoot(0) { 522 , fCachedPosRoot(0) {
526 523
527 const GrRadial2Gradient& data = drawEffect.castEffect<GrRadial2Gradient>(); 524 const GrRadial2Gradient& data = drawEffect.castEffect<GrRadial2Gradient>();
528 fIsDegenerate = data.isDegenerate(); 525 fIsDegenerate = data.isDegenerate();
529 } 526 }
530 527
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 } 705 }
709 706
710 #else 707 #else
711 708
712 GrEffectRef* SkTwoPointRadialGradient::asNewEffect(GrContext*, const SkPaint&) c onst { 709 GrEffectRef* SkTwoPointRadialGradient::asNewEffect(GrContext*, const SkPaint&) c onst {
713 SkDEBUGFAIL("Should not call in GPU-less build"); 710 SkDEBUGFAIL("Should not call in GPU-less build");
714 return NULL; 711 return NULL;
715 } 712 }
716 713
717 #endif 714 #endif
OLDNEW
« no previous file with comments | « src/effects/gradients/SkTwoPointConicalGradient.cpp ('k') | src/gpu/effects/GrConvolutionEffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698