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

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

Issue 654273002: Push isEqual/onIsEqual down from GrProcessor to subclasses. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 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/SkTableColorFilter.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 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
OLDNEW
« no previous file with comments | « src/effects/SkTableColorFilter.cpp ('k') | src/effects/gradients/SkGradientShaderPriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698