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

Unified Diff: src/core/SkBitmapProcShader.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, 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
« no previous file with comments | « include/gpu/GrTextureAccess.h ('k') | src/effects/SkGpuBlurUtils.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkBitmapProcShader.cpp
diff --git a/src/core/SkBitmapProcShader.cpp b/src/core/SkBitmapProcShader.cpp
index 76ccb512b47d490f0432613ce243c62fb11717c9..7fff799c117bd8f260698b3c8880800be3fe6ec7 100644
--- a/src/core/SkBitmapProcShader.cpp
+++ b/src/core/SkBitmapProcShader.cpp
@@ -9,6 +9,7 @@
#include "SkColorPriv.h"
#include "SkFlattenableBuffers.h"
#include "SkPixelRef.h"
+#include "SkErrorInternals.h"
bool SkBitmapProcShader::CanDo(const SkBitmap& bm, TileMode tx, TileMode ty) {
switch (bm.config()) {
@@ -353,7 +354,27 @@ GrEffectRef* SkBitmapProcShader::asNewEffect(GrContext* context, const SkPaint&
};
// Must set wrap and filter on the sampler before requesting a texture.
- GrTextureParams params(tm, paint.isFilterBitmap());
+ SkPaint::FilterLevel paintFilterLevel = paint.getFilterLevel();
+ GrTextureParams::FilterMode textureFilterMode;
+ switch(paintFilterLevel) {
+ case SkPaint::kNone_FilterLevel:
+ textureFilterMode = GrTextureParams::kNone_FilterMode;
+ break;
+ case SkPaint::kLow_FilterLevel:
+ textureFilterMode = GrTextureParams::kBilerp_FilterMode;
+ break;
+ case SkPaint::kMedium_FilterLevel:
+ textureFilterMode = GrTextureParams::kMipMap_FilterMode;
+ break;
+ case SkPaint::kHigh_FilterLevel:
+ SkErrorInternals::SetError( kInvalidPaint_SkError,
+ "Sorry, I don't yet support high quality "
+ "filtering on the GPU; falling back to "
+ "MIPMaps.");
+ textureFilterMode = GrTextureParams::kMipMap_FilterMode;
+ break;
+ }
+ GrTextureParams params(tm, textureFilterMode);
GrTexture* texture = GrLockAndRefCachedBitmapTexture(context, fRawBitmap, &params);
if (NULL == texture) {
« no previous file with comments | « include/gpu/GrTextureAccess.h ('k') | src/effects/SkGpuBlurUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698