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

Side by Side Diff: src/effects/gradients/SkRadialGradient.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/SkRadialGradient.h ('k') | src/effects/gradients/SkSweepGradient.h » ('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 "SkRadialGradient.h" 9 #include "SkRadialGradient.h"
10 #include "SkRadialGradient_Table.h" 10 #include "SkRadialGradient_Table.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 void shadeSpan16_radial_repeat(SkScalar fx, SkScalar dx, SkScalar fy, SkScalar d y, 138 void shadeSpan16_radial_repeat(SkScalar fx, SkScalar dx, SkScalar fy, SkScalar d y,
139 uint16_t* SK_RESTRICT dstC, const uint16_t* SK_RE STRICT cache, 139 uint16_t* SK_RESTRICT dstC, const uint16_t* SK_RE STRICT cache,
140 int toggle, int count) { 140 int toggle, int count) {
141 shadeSpan16_radial<repeat_tileproc_nonstatic>(fx, dx, fy, dy, dstC, cache, t oggle, count); 141 shadeSpan16_radial<repeat_tileproc_nonstatic>(fx, dx, fy, dy, dstC, cache, t oggle, count);
142 } 142 }
143 143
144 } // namespace 144 } // namespace
145 145
146 ///////////////////////////////////////////////////////////////////// 146 /////////////////////////////////////////////////////////////////////
147 147
148 SkRadialGradient::SkRadialGradient(const SkPoint& center, SkScalar radius, 148 SkRadialGradient::SkRadialGradient(const SkPoint& center, SkScalar radius, const Descriptor& desc)
149 const Descriptor& desc, const SkMatrix* local Matrix) 149 : SkGradientShaderBase(desc)
150 : SkGradientShaderBase(desc, localMatrix), 150 , fCenter(center)
151 fCenter(center), 151 , fRadius(radius)
152 fRadius(radius)
153 { 152 {
154 // make sure our table is insync with our current #define for kSQRT_TABLE_SI ZE 153 // make sure our table is insync with our current #define for kSQRT_TABLE_SI ZE
155 SkASSERT(sizeof(gSqrt8Table) == kSQRT_TABLE_SIZE); 154 SkASSERT(sizeof(gSqrt8Table) == kSQRT_TABLE_SIZE);
156 155
157 rad_to_unit_matrix(center, radius, &fPtsToUnit); 156 rad_to_unit_matrix(center, radius, &fPtsToUnit);
158 } 157 }
159 158
160 size_t SkRadialGradient::contextSize() const { 159 size_t SkRadialGradient::contextSize() const {
161 return sizeof(RadialGradientContext); 160 return sizeof(RadialGradientContext);
162 } 161 }
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
609 str->appendScalar(fCenter.fY); 608 str->appendScalar(fCenter.fY);
610 str->append(") radius: "); 609 str->append(") radius: ");
611 str->appendScalar(fRadius); 610 str->appendScalar(fRadius);
612 str->append(" "); 611 str->append(" ");
613 612
614 this->INHERITED::toString(str); 613 this->INHERITED::toString(str);
615 614
616 str->append(")"); 615 str->append(")");
617 } 616 }
618 #endif 617 #endif
OLDNEW
« no previous file with comments | « src/effects/gradients/SkRadialGradient.h ('k') | src/effects/gradients/SkSweepGradient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698