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

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

Issue 20362002: make the filter mode for GrTextureAccess an enum so we can plumb down (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: fall back to mipmaps for HQ sampling (for now) Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « src/effects/SkGpuBlurUtils.cpp ('k') | src/gpu/GrClipMaskManager.cpp » ('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 896 matching lines...) Expand 10 before | Expand all | Expand 10 after
907 desc.fWidth = bitmap.width(); 907 desc.fWidth = bitmap.width();
908 desc.fHeight = 32; 908 desc.fHeight = 32;
909 desc.fRowHeight = bitmap.height(); 909 desc.fRowHeight = bitmap.height();
910 desc.fContext = ctx; 910 desc.fContext = ctx;
911 desc.fConfig = SkBitmapConfig2GrPixelConfig(bitmap.config()); 911 desc.fConfig = SkBitmapConfig2GrPixelConfig(bitmap.config());
912 fAtlas = GrTextureStripAtlas::GetAtlas(desc); 912 fAtlas = GrTextureStripAtlas::GetAtlas(desc);
913 GrAssert(NULL != fAtlas); 913 GrAssert(NULL != fAtlas);
914 914
915 // We always filter the gradient table. Each table is one row of a texture, so always y-clamp. 915 // We always filter the gradient table. Each table is one row of a texture, so always y-clamp.
916 GrTextureParams params; 916 GrTextureParams params;
917 params.setBilerp(true); 917 params.setFilterMode(GrTextureParams::kBilerp_FilterMode);
918 params.setTileModeX(tileMode); 918 params.setTileModeX(tileMode);
919 919
920 fRow = fAtlas->lockRow(bitmap); 920 fRow = fAtlas->lockRow(bitmap);
921 if (-1 != fRow) { 921 if (-1 != fRow) {
922 fYCoord = fAtlas->getYOffset(fRow) + SK_ScalarHalf * 922 fYCoord = fAtlas->getYOffset(fRow) + SK_ScalarHalf *
923 fAtlas->getVerticalScaleFactor(); 923 fAtlas->getVerticalScaleFactor();
924 fTextureAccess.reset(fAtlas->getTexture(), params); 924 fTextureAccess.reset(fAtlas->getTexture(), params);
925 } else { 925 } else {
926 GrTexture* texture = GrLockAndRefCachedBitmapTexture(ctx, bitmap, &param s); 926 GrTexture* texture = GrLockAndRefCachedBitmapTexture(ctx, bitmap, &param s);
927 fTextureAccess.reset(texture, params); 927 fTextureAccess.reset(texture, params);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
977 (*stops)[i] = stop; 977 (*stops)[i] = stop;
978 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st op) : 1.f; 978 stop = i < outColors - 1 ? stop + random->nextUScalar1() * (1.f - st op) : 1.f;
979 } 979 }
980 } 980 }
981 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM odeCount)); 981 *tm = static_cast<SkShader::TileMode>(random->nextULessThan(SkShader::kTileM odeCount));
982 982
983 return outColors; 983 return outColors;
984 } 984 }
985 985
986 #endif 986 #endif
OLDNEW
« no previous file with comments | « src/effects/SkGpuBlurUtils.cpp ('k') | src/gpu/GrClipMaskManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698