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

Unified Diff: src/gpu/GrContext.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: Created 7 years, 5 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
Index: src/gpu/GrContext.cpp
diff --git a/src/gpu/GrContext.cpp b/src/gpu/GrContext.cpp
index 3951d919e62f73939977a9c09beb6ba73d7c521b..72ecc59246537ca517e15b6e3d1e58670239ea4f 100644
--- a/src/gpu/GrContext.cpp
+++ b/src/gpu/GrContext.cpp
@@ -306,7 +306,7 @@ GrTexture* GrContext::createResizedTexture(const GrTextureDesc& desc,
const GrCacheID& cacheID,
void* srcData,
size_t rowBytes,
- bool needsFiltering) {
+ GrTextureParams::FilterMode filterMode) {
SkAutoTUnref<GrTexture> clampedTexture(this->findAndRefTexture(desc, cacheID, NULL));
if (NULL == clampedTexture) {
clampedTexture.reset(this->createTexture(NULL, desc, cacheID, srcData, rowBytes));
@@ -333,7 +333,7 @@ GrTexture* GrContext::createResizedTexture(const GrTextureDesc& desc,
// 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, filterMode);
bsalomon 2013/07/25 17:41:48 Actually I think we just want to set knone or kbil
drawState->addColorTextureEffect(clampedTexture, SkMatrix::I(), params);
drawState->setVertexAttribs<gVertexAttribs>(SK_ARRAY_COUNT(gVertexAttribs));
@@ -382,9 +382,15 @@ GrTexture* GrContext::createTexture(const GrTextureParams* params,
GrTexture* texture;
if (GrTexture::NeedsResizing(resourceKey)) {
+ GrTextureParams::FilterMode textureFilterMode = GrTextureParams::kNone_FilterMode;
+ if (GrTexture::NeedsBilerp(resourceKey)) {
+ textureFilterMode = GrTextureParams::kBilerp_FilterMode;
+ } else if (GrTexture::NeedsMipMap(resourceKey)) {
+ textureFilterMode = GrTextureParams::kMipMap_FilterMode;
+ }
texture = this->createResizedTexture(desc, cacheID,
srcData, rowBytes,
- GrTexture::NeedsFiltering(resourceKey));
+ textureFilterMode);
} else {
texture= fGpu->createTexture(desc, srcData, rowBytes);
}

Powered by Google App Engine
This is Rietveld 408576698