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

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

Issue 264843006: create struct to hold all the params passed around for shader::context (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: address review comments Created 6 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
« no previous file with comments | « src/effects/SkTransparentShader.cpp ('k') | src/effects/gradients/SkGradientShaderPriv.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 * Copyright 2006 The Android Open Source Project 2 * Copyright 2006 The Android Open Source Project
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkGradientShaderPriv.h" 8 #include "SkGradientShaderPriv.h"
9 #include "SkLinearGradient.h" 9 #include "SkLinearGradient.h"
10 #include "SkRadialGradient.h" 10 #include "SkRadialGradient.h"
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 246
247 void SkGradientShaderBase::flipGradientColors() { 247 void SkGradientShaderBase::flipGradientColors() {
248 FlipGradientColors(fOrigColors, fRecs, fOrigColors, fRecs, fColorCount); 248 FlipGradientColors(fOrigColors, fRecs, fOrigColors, fRecs, fColorCount);
249 } 249 }
250 250
251 bool SkGradientShaderBase::isOpaque() const { 251 bool SkGradientShaderBase::isOpaque() const {
252 return fColorsAreOpaque; 252 return fColorsAreOpaque;
253 } 253 }
254 254
255 SkGradientShaderBase::GradientShaderBaseContext::GradientShaderBaseContext( 255 SkGradientShaderBase::GradientShaderBaseContext::GradientShaderBaseContext(
256 const SkGradientShaderBase& shader, const SkBitmap& device, 256 const SkGradientShaderBase& shader, const ContextRec& rec)
257 const SkPaint& paint, const SkMatrix& matrix) 257 : INHERITED(shader, rec)
258 : INHERITED(shader, device, paint, matrix)
259 , fCache(shader.refCache(getPaintAlpha())) 258 , fCache(shader.refCache(getPaintAlpha()))
260 { 259 {
261 const SkMatrix& inverse = this->getTotalInverse(); 260 const SkMatrix& inverse = this->getTotalInverse();
262 261
263 fDstToIndex.setConcat(shader.fPtsToUnit, inverse); 262 fDstToIndex.setConcat(shader.fPtsToUnit, inverse);
264 263
265 fDstToIndexProc = fDstToIndex.getMapXYProc(); 264 fDstToIndexProc = fDstToIndex.getMapXYProc();
266 fDstToIndexClass = (uint8_t)SkShader::Context::ComputeMatrixClass(fDstToInde x); 265 fDstToIndexClass = (uint8_t)SkShader::Context::ComputeMatrixClass(fDstToInde x);
267 266
268 // now convert our colors in to PMColors 267 // now convert our colors in to PMColors
(...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after
1211 (*stops)[i] = stop; 1210 (*stops)[i] = stop;
1212 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st op) : 1.f; 1211 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st op) : 1.f;
1213 } 1212 }
1214 } 1213 }
1215 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM odeCount)); 1214 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM odeCount));
1216 1215
1217 return outColors; 1216 return outColors;
1218 } 1217 }
1219 1218
1220 #endif 1219 #endif
OLDNEW
« no previous file with comments | « src/effects/SkTransparentShader.cpp ('k') | src/effects/gradients/SkGradientShaderPriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698