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

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

Issue 2037413002: Add SkSourceGammaTreatment enum so we know how to create mips (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Remove leftover comments Created 4 years, 6 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
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 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after
1124 GrTextureParams params; 1124 GrTextureParams params;
1125 params.setFilterMode(GrTextureParams::kBilerp_FilterMode); 1125 params.setFilterMode(GrTextureParams::kBilerp_FilterMode);
1126 params.setTileModeX(tileMode); 1126 params.setTileModeX(tileMode);
1127 1127
1128 fRow = fAtlas->lockRow(bitmap); 1128 fRow = fAtlas->lockRow(bitmap);
1129 if (-1 != fRow) { 1129 if (-1 != fRow) {
1130 fYCoord = fAtlas->getYOffset(fRow) + SK_ScalarHalf * fAtlas->getNorm alizedTexelHeight(); 1130 fYCoord = fAtlas->getYOffset(fRow) + SK_ScalarHalf * fAtlas->getNorm alizedTexelHeight();
1131 fCoordTransform.reset(kCoordSet, matrix, fAtlas->getTexture(), param s.filterMode()); 1131 fCoordTransform.reset(kCoordSet, matrix, fAtlas->getTexture(), param s.filterMode());
1132 fTextureAccess.reset(fAtlas->getTexture(), params); 1132 fTextureAccess.reset(fAtlas->getTexture(), params);
1133 } else { 1133 } else {
1134 SkAutoTUnref<GrTexture> texture(GrRefCachedBitmapTexture(ctx, bitmap , params)); 1134 SkAutoTUnref<GrTexture> texture(GrRefCachedBitmapTexture(ctx, bitmap , params, false));
1135 if (!texture) { 1135 if (!texture) {
1136 return; 1136 return;
1137 } 1137 }
1138 fCoordTransform.reset(kCoordSet, matrix, texture, params.filterMode( )); 1138 fCoordTransform.reset(kCoordSet, matrix, texture, params.filterMode( ));
1139 fTextureAccess.reset(texture, params); 1139 fTextureAccess.reset(texture, params);
1140 fYCoord = SK_ScalarHalf; 1140 fYCoord = SK_ScalarHalf;
1141 } 1141 }
1142 this->addTextureAccess(&fTextureAccess); 1142 this->addTextureAccess(&fTextureAccess);
1143 } 1143 }
1144 this->addCoordTransform(&fCoordTransform); 1144 this->addCoordTransform(&fCoordTransform);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1205 (*stops)[i] = stop; 1205 (*stops)[i] = stop;
1206 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st op) : 1.f; 1206 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st op) : 1.f;
1207 } 1207 }
1208 } 1208 }
1209 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM odeCount)); 1209 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM odeCount));
1210 1210
1211 return outColors; 1211 return outColors;
1212 } 1212 }
1213 1213
1214 #endif 1214 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698