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

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

Issue 1287263005: change asABitmap to isABitmap on shader (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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
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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 218
219 int index = fi >> (16 - kCache16Bits); 219 int index = fi >> (16 - kCache16Bits);
220 *dstC++ = cache[toggle + index]; 220 *dstC++ = cache[toggle + index];
221 toggle = next_dither_toggle16(toggle); 221 toggle = next_dither_toggle16(toggle);
222 222
223 dstX += SK_Scalar1; 223 dstX += SK_Scalar1;
224 } while (--count != 0); 224 } while (--count != 0);
225 } 225 }
226 } 226 }
227 227
228 SkShader::BitmapType SkRadialGradient::asABitmap(SkBitmap* bitmap,
229 SkMatrix* matrix, SkShader::TileMode* xy) const {
230 if (bitmap) {
231 this->getGradientTableBitmap(bitmap);
232 }
233 if (matrix) {
234 matrix->setScale(SkIntToScalar(kCache32Count),
235 SkIntToScalar(kCache32Count));
236 matrix->preConcat(fPtsToUnit);
237 }
238 if (xy) {
239 xy[0] = fTileMode;
240 xy[1] = kClamp_TileMode;
241 }
242 return kRadial_BitmapType;
243 }
244
245 SkShader::GradientType SkRadialGradient::asAGradient(GradientInfo* info) const { 228 SkShader::GradientType SkRadialGradient::asAGradient(GradientInfo* info) const {
246 if (info) { 229 if (info) {
247 commonAsAGradient(info); 230 commonAsAGradient(info);
248 info->fPoint[0] = fCenter; 231 info->fPoint[0] = fCenter;
249 info->fRadius[0] = fRadius; 232 info->fRadius[0] = fRadius;
250 } 233 }
251 return kRadial_GradientType; 234 return kRadial_GradientType;
252 } 235 }
253 236
254 SkFlattenable* SkRadialGradient::CreateProc(SkReadBuffer& buffer) { 237 SkFlattenable* SkRadialGradient::CreateProc(SkReadBuffer& buffer) {
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 str->appendScalar(fCenter.fY); 561 str->appendScalar(fCenter.fY);
579 str->append(") radius: "); 562 str->append(") radius: ");
580 str->appendScalar(fRadius); 563 str->appendScalar(fRadius);
581 str->append(" "); 564 str->append(" ");
582 565
583 this->INHERITED::toString(str); 566 this->INHERITED::toString(str);
584 567
585 str->append(")"); 568 str->append(")");
586 } 569 }
587 #endif 570 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698