make the filter mode for GrTextureAccess an enum so we can plumb down
the paint's filter modes to the GPU
BUG=
R=bsalomon@google.com
Review URL: https://codereview.chromium.org/20362002
git-svn-id: http://skia.googlecode.com/svn/trunk@10368 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 3951d91..0d98ecd 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -306,7 +306,7 @@
const GrCacheID& cacheID,
void* srcData,
size_t rowBytes,
- bool needsFiltering) {
+ bool filter) {
SkAutoTUnref<GrTexture> clampedTexture(this->findAndRefTexture(desc, cacheID, NULL));
if (NULL == clampedTexture) {
clampedTexture.reset(this->createTexture(NULL, desc, cacheID, srcData, rowBytes));
@@ -333,7 +333,8 @@
// if filtering is not desired then we want to ensure all
// texels in the resampled image are copies of texels from
// the original.
- GrTextureParams params(SkShader::kClamp_TileMode, needsFiltering);
+ GrTextureParams params(SkShader::kClamp_TileMode, filter ? GrTextureParams::kBilerp_FilterMode :
+ GrTextureParams::kNone_FilterMode);
drawState->addColorTextureEffect(clampedTexture, SkMatrix::I(), params);
drawState->setVertexAttribs<gVertexAttribs>(SK_ARRAY_COUNT(gVertexAttribs));
@@ -384,7 +385,7 @@
if (GrTexture::NeedsResizing(resourceKey)) {
texture = this->createResizedTexture(desc, cacheID,
srcData, rowBytes,
- GrTexture::NeedsFiltering(resourceKey));
+ GrTexture::NeedsBilerp(resourceKey));
} else {
texture= fGpu->createTexture(desc, srcData, rowBytes);
}