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

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

Issue 461643002: add localMatrix to gradient Descriptor (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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
« no previous file with comments | « src/effects/gradients/SkTwoPointRadialGradient.h ('k') | no next file » | 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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 *dstC++ = cache[index >> SkGradientShaderBase::kCache32Shift]; 160 *dstC++ = cache[index >> SkGradientShaderBase::kCache32Shift];
161 fx += dx; 161 fx += dx;
162 fy += dy; 162 fy += dy;
163 b += db; 163 b += db;
164 } 164 }
165 } 165 }
166 } 166 }
167 167
168 ///////////////////////////////////////////////////////////////////// 168 /////////////////////////////////////////////////////////////////////
169 169
170 SkTwoPointRadialGradient::SkTwoPointRadialGradient( 170 SkTwoPointRadialGradient::SkTwoPointRadialGradient(const SkPoint& start, SkScala r startRadius,
171 const SkPoint& start, SkScalar startRadius, 171 const SkPoint& end, SkScalar endRadius,
172 const SkPoint& end, SkScalar endRadius, 172 const Descriptor& desc)
173 const Descriptor& desc, const SkMatrix* localMatrix) 173 : SkGradientShaderBase(desc)
174 : SkGradientShaderBase(desc, localMatrix), 174 , fCenter1(start)
175 fCenter1(start), 175 , fCenter2(end)
176 fCenter2(end), 176 , fRadius1(startRadius)
177 fRadius1(startRadius), 177 , fRadius2(endRadius)
178 fRadius2(endRadius) { 178 {
179 init(); 179 init();
180 } 180 }
181 181
182 SkShader::BitmapType SkTwoPointRadialGradient::asABitmap( 182 SkShader::BitmapType SkTwoPointRadialGradient::asABitmap(
183 SkBitmap* bitmap, 183 SkBitmap* bitmap,
184 SkMatrix* matrix, 184 SkMatrix* matrix,
185 SkShader::TileMode* xy) const { 185 SkShader::TileMode* xy) const {
186 if (bitmap) { 186 if (bitmap) {
187 this->getGradientTableBitmap(bitmap); 187 this->getGradientTableBitmap(bitmap);
188 } 188 }
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after
705 #else 705 #else
706 706
707 bool SkTwoPointRadialGradient::asNewEffect(GrContext* context, const SkPaint& pa int, 707 bool SkTwoPointRadialGradient::asNewEffect(GrContext* context, const SkPaint& pa int,
708 const SkMatrix* localMatrix, GrColor* paintColor, 708 const SkMatrix* localMatrix, GrColor* paintColor,
709 GrEffect** effect) const { 709 GrEffect** effect) const {
710 SkDEBUGFAIL("Should not call in GPU-less build"); 710 SkDEBUGFAIL("Should not call in GPU-less build");
711 return false; 711 return false;
712 } 712 }
713 713
714 #endif 714 #endif
OLDNEW
« no previous file with comments | « src/effects/gradients/SkTwoPointRadialGradient.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698