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

Unified Diff: src/effects/gradients/SkGradientShader.cpp

Issue 2343703003: Revert of Bundle common arguments to GrGradientEffect creation (Closed)
Patch Set: Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/effects/gradients/SkGradientShaderPriv.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/effects/gradients/SkGradientShader.cpp
diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp
index 14e67842b337b3addb15f45e51630fae65541c52..eccc21ac6e4cbdb68452e70d19cfe47c4f4f2d5e 100644
--- a/src/effects/gradients/SkGradientShader.cpp
+++ b/src/effects/gradients/SkGradientShader.cpp
@@ -1332,8 +1332,10 @@
/////////////////////////////////////////////////////////////////////
-GrGradientEffect::GrGradientEffect(const CreateArgs& args) {
- const SkGradientShaderBase& shader(*args.fShader);
+GrGradientEffect::GrGradientEffect(GrContext* ctx,
+ const SkGradientShaderBase& shader,
+ const SkMatrix& matrix,
+ SkShader::TileMode tileMode) {
fIsOpaque = shader.isOpaque();
@@ -1352,7 +1354,7 @@
}
#if GR_GL_USE_ACCURATE_HARD_STOP_GRADIENTS
- fTileMode = args.fTileMode;
+ fTileMode = tileMode;
#endif
switch (fColorType) {
@@ -1372,7 +1374,7 @@
fPremulType = kAfterInterp_PremulType;
}
- fCoordTransform.reset(kCoordSet, *args.fMatrix);
+ fCoordTransform.reset(kCoordSet, matrix);
break;
case kTexture_ColorType:
@@ -1387,8 +1389,8 @@
desc.fWidth = bitmap.width();
desc.fHeight = 32;
desc.fRowHeight = bitmap.height();
- desc.fContext = args.fContext;
- desc.fConfig = SkImageInfo2GrPixelConfig(bitmap.info(), *args.fContext->caps());
+ desc.fContext = ctx;
+ desc.fConfig = SkImageInfo2GrPixelConfig(bitmap.info(), *ctx->caps());
fAtlas = GrTextureStripAtlas::GetAtlas(desc);
SkASSERT(fAtlas);
@@ -1396,22 +1398,21 @@
// y-clamp.
GrTextureParams params;
params.setFilterMode(GrTextureParams::kBilerp_FilterMode);
- params.setTileModeX(args.fTileMode);
+ params.setTileModeX(tileMode);
fRow = fAtlas->lockRow(bitmap);
if (-1 != fRow) {
fYCoord = fAtlas->getYOffset(fRow)+SK_ScalarHalf*fAtlas->getNormalizedTexelHeight();
- fCoordTransform.reset(kCoordSet, *args.fMatrix, fAtlas->getTexture(),
- params.filterMode());
+ fCoordTransform.reset(kCoordSet, matrix, fAtlas->getTexture(), params.filterMode());
fTextureAccess.reset(fAtlas->getTexture(), params);
} else {
SkAutoTUnref<GrTexture> texture(
- GrRefCachedBitmapTexture(args.fContext, bitmap, params,
+ GrRefCachedBitmapTexture(ctx, bitmap, params,
SkSourceGammaTreatment::kRespect));
if (!texture) {
return;
}
- fCoordTransform.reset(kCoordSet, *args.fMatrix, texture, params.filterMode());
+ fCoordTransform.reset(kCoordSet, matrix, texture, params.filterMode());
fTextureAccess.reset(texture, params);
fYCoord = SK_ScalarHalf;
}
« no previous file with comments | « no previous file | src/effects/gradients/SkGradientShaderPriv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698