Chromium Code Reviews| Index: src/core/SkBitmapProcShader.cpp |
| diff --git a/src/core/SkBitmapProcShader.cpp b/src/core/SkBitmapProcShader.cpp |
| index 76ccb512b47d490f0432613ce243c62fb11717c9..46891cd33ec5b151238e528587abd880c0c55d65 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,25 @@ 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 " |
|
bsalomon
2013/07/25 17:41:48
can we log the error but just continue using mips?
humper
2013/07/25 18:18:13
sure. Done.
|
| + "filtering on the GPU."); |
| + return NULL; |
| + } |
| + GrTextureParams params(tm, textureFilterMode); |
| GrTexture* texture = GrLockAndRefCachedBitmapTexture(context, fRawBitmap, ¶ms); |
| if (NULL == texture) { |