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

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: Fix DM compilation 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
« no previous file with comments | « src/effects/SkTableColorFilter.cpp ('k') | src/effects/gradients/SkLinearGradient.h » ('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 "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(
1135 GrRefCachedBitmapTexture(ctx, bitmap, params, SkSourceGammaTreat ment::kRespect));
1135 if (!texture) { 1136 if (!texture) {
1136 return; 1137 return;
1137 } 1138 }
1138 fCoordTransform.reset(kCoordSet, matrix, texture, params.filterMode( )); 1139 fCoordTransform.reset(kCoordSet, matrix, texture, params.filterMode( ));
1139 fTextureAccess.reset(texture, params); 1140 fTextureAccess.reset(texture, params);
1140 fYCoord = SK_ScalarHalf; 1141 fYCoord = SK_ScalarHalf;
1141 } 1142 }
1142 this->addTextureAccess(&fTextureAccess); 1143 this->addTextureAccess(&fTextureAccess);
1143 } 1144 }
1144 this->addCoordTransform(&fCoordTransform); 1145 this->addCoordTransform(&fCoordTransform);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1205 (*stops)[i] = stop; 1206 (*stops)[i] = stop;
1206 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st op) : 1.f; 1207 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st op) : 1.f;
1207 } 1208 }
1208 } 1209 }
1209 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM odeCount)); 1210 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM odeCount));
1210 1211
1211 return outColors; 1212 return outColors;
1212 } 1213 }
1213 1214
1214 #endif 1215 #endif
OLDNEW
« no previous file with comments | « src/effects/SkTableColorFilter.cpp ('k') | src/effects/gradients/SkLinearGradient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698