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

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

Issue 1688543002: Initial linear gradient 4f impl (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 10 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 * 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 "Sk4fLinearGradient.h"
8 #include "SkGradientShaderPriv.h" 9 #include "SkGradientShaderPriv.h"
9 #include "SkLinearGradient.h" 10 #include "SkLinearGradient.h"
10 #include "SkRadialGradient.h" 11 #include "SkRadialGradient.h"
11 #include "SkTwoPointConicalGradient.h" 12 #include "SkTwoPointConicalGradient.h"
12 #include "SkSweepGradient.h" 13 #include "SkSweepGradient.h"
13 14
14 void SkGradientShaderBase::Descriptor::flatten(SkWriteBuffer& buffer) const { 15 void SkGradientShaderBase::Descriptor::flatten(SkWriteBuffer& buffer) const {
15 buffer.writeColorArray(fColors, fCount); 16 buffer.writeColorArray(fColors, fCount);
16 if (fPos) { 17 if (fPos) {
17 buffer.writeBool(true); 18 buffer.writeBool(true);
(...skipping 1185 matching lines...) Expand 10 before | Expand all | Expand 10 after
1203 (*stops)[i] = stop; 1204 (*stops)[i] = stop;
1204 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st op) : 1.f; 1205 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st op) : 1.f;
1205 } 1206 }
1206 } 1207 }
1207 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM odeCount)); 1208 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM odeCount));
1208 1209
1209 return outColors; 1210 return outColors;
1210 } 1211 }
1211 1212
1212 #endif 1213 #endif
OLDNEW
« no previous file with comments | « src/effects/gradients/Sk4fLinearGradient.cpp ('k') | src/effects/gradients/SkGradientShaderPriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698