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

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

Issue 2100223003: Check PremulType during GrGradientEffect::onIsEqual (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 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 | « no previous file | no next file » | 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 "Sk4fLinearGradient.h" 8 #include "Sk4fLinearGradient.h"
9 #include "SkGradientShaderPriv.h" 9 #include "SkGradientShaderPriv.h"
10 #include "SkLinearGradient.h" 10 #include "SkLinearGradient.h"
(...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1150 fAtlas->unlockRow(fRow); 1150 fAtlas->unlockRow(fRow);
1151 } 1151 }
1152 } 1152 }
1153 1153
1154 bool GrGradientEffect::onIsEqual(const GrFragmentProcessor& processor) const { 1154 bool GrGradientEffect::onIsEqual(const GrFragmentProcessor& processor) const {
1155 const GrGradientEffect& s = processor.cast<GrGradientEffect>(); 1155 const GrGradientEffect& s = processor.cast<GrGradientEffect>();
1156 1156
1157 if (this->fColorType == s.getColorType()){ 1157 if (this->fColorType == s.getColorType()){
1158 1158
1159 if (SkGradientShaderBase::kTwo_GpuColorType == fColorType) { 1159 if (SkGradientShaderBase::kTwo_GpuColorType == fColorType) {
1160 if (*this->getColors(0) != *s.getColors(0) || 1160 if (this->getPremulType() != s.getPremulType() ||
1161 *this->getColors(0) != *s.getColors(0) ||
1161 *this->getColors(1) != *s.getColors(1)) { 1162 *this->getColors(1) != *s.getColors(1)) {
1162 return false; 1163 return false;
1163 } 1164 }
1164 } else if (SkGradientShaderBase::kThree_GpuColorType == fColorType) { 1165 } else if (SkGradientShaderBase::kThree_GpuColorType == fColorType) {
1165 if (*this->getColors(0) != *s.getColors(0) || 1166 if (this->getPremulType() != s.getPremulType() ||
1167 *this->getColors(0) != *s.getColors(0) ||
1166 *this->getColors(1) != *s.getColors(1) || 1168 *this->getColors(1) != *s.getColors(1) ||
1167 *this->getColors(2) != *s.getColors(2)) { 1169 *this->getColors(2) != *s.getColors(2)) {
1168 return false; 1170 return false;
1169 } 1171 }
1170 } else { 1172 } else {
1171 if (fYCoord != s.getYCoord()) { 1173 if (fYCoord != s.getYCoord()) {
1172 return false; 1174 return false;
1173 } 1175 }
1174 } 1176 }
1175 1177
(...skipping 30 matching lines...) Expand all
1206 (*stops)[i] = stop; 1208 (*stops)[i] = stop;
1207 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st op) : 1.f; 1209 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st op) : 1.f;
1208 } 1210 }
1209 } 1211 }
1210 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM odeCount)); 1212 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM odeCount));
1211 1213
1212 return outColors; 1214 return outColors;
1213 } 1215 }
1214 1216
1215 #endif 1217 #endif
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698