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

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

Issue 657923002: Make GrFragmentProcessor auto-compare coord xforms. (Closed) Base URL: https://skia.googlesource.com/skia.git@key
Patch Set: Add \! 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/SkPerlinNoiseShader.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 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 return fTextureAccess.getTexture() == s.fTextureAccess.getTexture() &&
1206 fTextureAccess.getParams().getTileModeX() == 1206 fTextureAccess.getParams().getTileModeX() ==
1207 s.fTextureAccess.getParams().getTileModeX() && 1207 s.fTextureAccess.getParams().getTileModeX() &&
1208 this->useAtlas() == s.useAtlas() && 1208 this->useAtlas() == s.useAtlas();
1209 fCoordTransform.getMatrix().cheapEqualTo(s.fCoordTransform.getMatrix ());
1210 } 1209 }
1211 1210
1212 return false; 1211 return false;
1213 } 1212 }
1214 1213
1215 void GrGradientEffect::onComputeInvariantOutput(InvariantOutput* inout) const { 1214 void GrGradientEffect::onComputeInvariantOutput(InvariantOutput* inout) const {
1216 if (fIsOpaque) { 1215 if (fIsOpaque) {
1217 inout->mulByUnknownOpaqueColor(); 1216 inout->mulByUnknownOpaqueColor();
1218 } else { 1217 } else {
1219 inout->mulByUnknownColor(); 1218 inout->mulByUnknownColor();
(...skipping 18 matching lines...) Expand all
1238 (*stops)[i] = stop; 1237 (*stops)[i] = stop;
1239 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st op) : 1.f; 1238 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st op) : 1.f;
1240 } 1239 }
1241 } 1240 }
1242 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM odeCount)); 1241 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM odeCount));
1243 1242
1244 return outColors; 1243 return outColors;
1245 } 1244 }
1246 1245
1247 #endif 1246 #endif
OLDNEW
« no previous file with comments | « src/effects/SkPerlinNoiseShader.cpp ('k') | src/gpu/GrProcessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698