| OLD | NEW |
| 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 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1173 } | 1173 } |
| 1174 this->addCoordTransform(&fCoordTransform); | 1174 this->addCoordTransform(&fCoordTransform); |
| 1175 } | 1175 } |
| 1176 | 1176 |
| 1177 GrGradientEffect::~GrGradientEffect() { | 1177 GrGradientEffect::~GrGradientEffect() { |
| 1178 if (this->useAtlas()) { | 1178 if (this->useAtlas()) { |
| 1179 fAtlas->unlockRow(fRow); | 1179 fAtlas->unlockRow(fRow); |
| 1180 } | 1180 } |
| 1181 } | 1181 } |
| 1182 | 1182 |
| 1183 bool GrGradientEffect::onIsEqual(const GrProcessor& processor) const { | 1183 bool GrGradientEffect::onIsEqual(const GrFragmentProcessor& processor) const { |
| 1184 const GrGradientEffect& s = processor.cast<GrGradientEffect>(); | 1184 const GrGradientEffect& s = processor.cast<GrGradientEffect>(); |
| 1185 | 1185 |
| 1186 if (this->fColorType == s.getColorType()){ | 1186 if (this->fColorType == s.getColorType()){ |
| 1187 | 1187 |
| 1188 if (SkGradientShaderBase::kTwo_GpuColorType == fColorType) { | 1188 if (SkGradientShaderBase::kTwo_GpuColorType == fColorType) { |
| 1189 if (*this->getColors(0) != *s.getColors(0) || | 1189 if (*this->getColors(0) != *s.getColors(0) || |
| 1190 *this->getColors(1) != *s.getColors(1)) { | 1190 *this->getColors(1) != *s.getColors(1)) { |
| 1191 return false; | 1191 return false; |
| 1192 } | 1192 } |
| 1193 } else if (SkGradientShaderBase::kThree_GpuColorType == fColorType) { | 1193 } else if (SkGradientShaderBase::kThree_GpuColorType == fColorType) { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1238 (*stops)[i] = stop; | 1238 (*stops)[i] = stop; |
| 1239 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st
op) : 1.f; | 1239 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st
op) : 1.f; |
| 1240 } | 1240 } |
| 1241 } | 1241 } |
| 1242 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM
odeCount)); | 1242 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM
odeCount)); |
| 1243 | 1243 |
| 1244 return outColors; | 1244 return outColors; |
| 1245 } | 1245 } |
| 1246 | 1246 |
| 1247 #endif | 1247 #endif |
| OLD | NEW |