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

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

Issue 15733007: use Descriptor struct to encapsulate all the common paramaeters between our various gradient types.… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 7 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 b += db; 163 b += db;
164 } 164 }
165 } 165 }
166 } 166 }
167 167
168 ///////////////////////////////////////////////////////////////////// 168 /////////////////////////////////////////////////////////////////////
169 169
170 SkTwoPointRadialGradient::SkTwoPointRadialGradient( 170 SkTwoPointRadialGradient::SkTwoPointRadialGradient(
171 const SkPoint& start, SkScalar startRadius, 171 const SkPoint& start, SkScalar startRadius,
172 const SkPoint& end, SkScalar endRadius, 172 const SkPoint& end, SkScalar endRadius,
173 const SkColor colors[], const SkScalar pos[], 173 const Descriptor& desc)
174 int colorCount, SkShader::TileMode mode, 174 : SkGradientShaderBase(desc),
175 SkUnitMapper* mapper)
176 : SkGradientShaderBase(colors, pos, colorCount, mode, mapper),
177 fCenter1(start), 175 fCenter1(start),
178 fCenter2(end), 176 fCenter2(end),
179 fRadius1(startRadius), 177 fRadius1(startRadius),
180 fRadius2(endRadius) { 178 fRadius2(endRadius) {
181 init(); 179 init();
182 } 180 }
183 181
184 SkShader::BitmapType SkTwoPointRadialGradient::asABitmap( 182 SkShader::BitmapType SkTwoPointRadialGradient::asABitmap(
185 SkBitmap* bitmap, 183 SkBitmap* bitmap,
186 SkMatrix* matrix, 184 SkMatrix* matrix,
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 } 708 }
711 709
712 #else 710 #else
713 711
714 GrEffectRef* SkTwoPointRadialGradient::asNewEffect(GrContext*, const SkPaint&) c onst { 712 GrEffectRef* SkTwoPointRadialGradient::asNewEffect(GrContext*, const SkPaint&) c onst {
715 SkDEBUGFAIL("Should not call in GPU-less build"); 713 SkDEBUGFAIL("Should not call in GPU-less build");
716 return NULL; 714 return NULL;
717 } 715 }
718 716
719 #endif 717 #endif
OLDNEW
« src/effects/gradients/SkRadialGradient.h ('K') | « src/effects/gradients/SkTwoPointRadialGradient.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698