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

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

Issue 654313002: Auto-compare GrProcessors' texture accesses in isEqual(). (Closed) Base URL: https://skia.googlesource.com/skia.git@xformcomp
Patch Set: update 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/gpu/GrProcessor.cpp » ('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 1184 matching lines...) Expand 10 before | Expand all | Expand 10 after
1195 *this->getColors(1) != *s.getColors(1) || 1195 *this->getColors(1) != *s.getColors(1) ||
1196 *this->getColors(2) != *s.getColors(2)) { 1196 *this->getColors(2) != *s.getColors(2)) {
1197 return false; 1197 return false;
1198 } 1198 }
1199 } else { 1199 } else {
1200 if (fYCoord != s.getYCoord()) { 1200 if (fYCoord != s.getYCoord()) {
1201 return false; 1201 return false;
1202 } 1202 }
1203 } 1203 }
1204 1204
1205 return fTextureAccess.getTexture() == s.fTextureAccess.getTexture() && 1205 SkASSERT(this->useAtlas() == s.useAtlas());
1206 fTextureAccess.getParams().getTileModeX() == 1206 return true;
1207 s.fTextureAccess.getParams().getTileModeX() &&
1208 this->useAtlas() == s.useAtlas();
1209 } 1207 }
1210 1208
1211 return false; 1209 return false;
1212 } 1210 }
1213 1211
1214 void GrGradientEffect::onComputeInvariantOutput(InvariantOutput* inout) const { 1212 void GrGradientEffect::onComputeInvariantOutput(InvariantOutput* inout) const {
1215 if (fIsOpaque) { 1213 if (fIsOpaque) {
1216 inout->mulByUnknownOpaqueColor(); 1214 inout->mulByUnknownOpaqueColor();
1217 } else { 1215 } else {
1218 inout->mulByUnknownColor(); 1216 inout->mulByUnknownColor();
(...skipping 18 matching lines...) Expand all
1237 (*stops)[i] = stop; 1235 (*stops)[i] = stop;
1238 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st op) : 1.f; 1236 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st op) : 1.f;
1239 } 1237 }
1240 } 1238 }
1241 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM odeCount)); 1239 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM odeCount));
1242 1240
1243 return outColors; 1241 return outColors;
1244 } 1242 }
1245 1243
1246 #endif 1244 #endif
OLDNEW
« no previous file with comments | « src/effects/SkTableColorFilter.cpp ('k') | src/gpu/GrProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698