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

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

Issue 1404433002: Remove image usage type enum. Use GrTextureParams instead. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix no gpu build Created 5 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/SkTableColorFilter.cpp ('k') | src/gpu/GrTextureMaker.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 "SkGradientShaderPriv.h" 8 #include "SkGradientShaderPriv.h"
9 #include "SkLinearGradient.h" 9 #include "SkLinearGradient.h"
10 #include "SkRadialGradient.h" 10 #include "SkRadialGradient.h"
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1125 GrTextureParams params; 1125 GrTextureParams params;
1126 params.setFilterMode(GrTextureParams::kBilerp_FilterMode); 1126 params.setFilterMode(GrTextureParams::kBilerp_FilterMode);
1127 params.setTileModeX(tileMode); 1127 params.setTileModeX(tileMode);
1128 1128
1129 fRow = fAtlas->lockRow(bitmap); 1129 fRow = fAtlas->lockRow(bitmap);
1130 if (-1 != fRow) { 1130 if (-1 != fRow) {
1131 fYCoord = fAtlas->getYOffset(fRow) + SK_ScalarHalf * fAtlas->getNorm alizedTexelHeight(); 1131 fYCoord = fAtlas->getYOffset(fRow) + SK_ScalarHalf * fAtlas->getNorm alizedTexelHeight();
1132 fCoordTransform.reset(kCoordSet, matrix, fAtlas->getTexture(), param s.filterMode()); 1132 fCoordTransform.reset(kCoordSet, matrix, fAtlas->getTexture(), param s.filterMode());
1133 fTextureAccess.reset(fAtlas->getTexture(), params); 1133 fTextureAccess.reset(fAtlas->getTexture(), params);
1134 } else { 1134 } else {
1135 SkAutoTUnref<GrTexture> texture(GrRefCachedBitmapTexture(ctx, bitmap , &params)); 1135 SkAutoTUnref<GrTexture> texture(GrRefCachedBitmapTexture(ctx, bitmap , params));
1136 if (!texture) { 1136 if (!texture) {
1137 return; 1137 return;
1138 } 1138 }
1139 fCoordTransform.reset(kCoordSet, matrix, texture, params.filterMode( )); 1139 fCoordTransform.reset(kCoordSet, matrix, texture, params.filterMode( ));
1140 fTextureAccess.reset(texture, params); 1140 fTextureAccess.reset(texture, params);
1141 fYCoord = SK_ScalarHalf; 1141 fYCoord = SK_ScalarHalf;
1142 } 1142 }
1143 this->addTextureAccess(&fTextureAccess); 1143 this->addTextureAccess(&fTextureAccess);
1144 } 1144 }
1145 this->addCoordTransform(&fCoordTransform); 1145 this->addCoordTransform(&fCoordTransform);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
1206 (*stops)[i] = stop; 1206 (*stops)[i] = stop;
1207 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;
1208 } 1208 }
1209 } 1209 }
1210 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM odeCount)); 1210 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM odeCount));
1211 1211
1212 return outColors; 1212 return outColors;
1213 } 1213 }
1214 1214
1215 #endif 1215 #endif
OLDNEW
« no previous file with comments | « src/effects/SkTableColorFilter.cpp ('k') | src/gpu/GrTextureMaker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698