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 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1090 if (*this->getColors(0) != *s.getColors(0) || | 1090 if (*this->getColors(0) != *s.getColors(0) || |
1091 *this->getColors(1) != *s.getColors(1)) { | 1091 *this->getColors(1) != *s.getColors(1)) { |
1092 return false; | 1092 return false; |
1093 } | 1093 } |
1094 } else if (kThree_ColorType == fColorType) { | 1094 } else if (kThree_ColorType == fColorType) { |
1095 if (*this->getColors(0) != *s.getColors(0) || | 1095 if (*this->getColors(0) != *s.getColors(0) || |
1096 *this->getColors(1) != *s.getColors(1) || | 1096 *this->getColors(1) != *s.getColors(1) || |
1097 *this->getColors(2) != *s.getColors(2)) { | 1097 *this->getColors(2) != *s.getColors(2)) { |
1098 return false; | 1098 return false; |
1099 } | 1099 } |
| 1100 } else { |
| 1101 if (fYCoord != s.getYCoord()) { |
| 1102 return false; |
| 1103 } |
1100 } | 1104 } |
1101 | 1105 |
1102 return fTextureAccess.getTexture() == s.fTextureAccess.getTexture() && | 1106 return fTextureAccess.getTexture() == s.fTextureAccess.getTexture() && |
1103 fTextureAccess.getParams().getTileModeX() == | 1107 fTextureAccess.getParams().getTileModeX() == |
1104 s.fTextureAccess.getParams().getTileModeX() && | 1108 s.fTextureAccess.getParams().getTileModeX() && |
1105 this->useAtlas() == s.useAtlas() && | 1109 this->useAtlas() == s.useAtlas() && |
1106 fYCoord == s.getYCoord() && | |
1107 fCoordTransform.getMatrix().cheapEqualTo(s.fCoordTransform.getMatrix
()); | 1110 fCoordTransform.getMatrix().cheapEqualTo(s.fCoordTransform.getMatrix
()); |
1108 } | 1111 } |
1109 | 1112 |
1110 return false; | 1113 return false; |
1111 } | 1114 } |
1112 | 1115 |
1113 void GrGradientEffect::getConstantColorComponents(GrColor* color, uint32_t* vali
dFlags) const { | 1116 void GrGradientEffect::getConstantColorComponents(GrColor* color, uint32_t* vali
dFlags) const { |
1114 if (fIsOpaque && (kA_GrColorComponentFlag & *validFlags) && 0xff == GrColorU
npackA(*color)) { | 1117 if (fIsOpaque && (kA_GrColorComponentFlag & *validFlags) && 0xff == GrColorU
npackA(*color)) { |
1115 *validFlags = kA_GrColorComponentFlag; | 1118 *validFlags = kA_GrColorComponentFlag; |
1116 } else { | 1119 } else { |
(...skipping 19 matching lines...) Expand all Loading... |
1136 (*stops)[i] = stop; | 1139 (*stops)[i] = stop; |
1137 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st
op) : 1.f; | 1140 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st
op) : 1.f; |
1138 } | 1141 } |
1139 } | 1142 } |
1140 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM
odeCount)); | 1143 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM
odeCount)); |
1141 | 1144 |
1142 return outColors; | 1145 return outColors; |
1143 } | 1146 } |
1144 | 1147 |
1145 #endif | 1148 #endif |
OLD | NEW |