| Index: src/gpu/SkGpuDevice.cpp
|
| diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
|
| index ce02f2c55fc97fa76beba1068cc36ae9277b44c6..27c98efb8bccb46fe4692eec789f02d42af116e7 100644
|
| --- a/src/gpu/SkGpuDevice.cpp
|
| +++ b/src/gpu/SkGpuDevice.cpp
|
| @@ -1196,8 +1196,7 @@ void SkGpuDevice::drawBitmapCommon(const SkDraw& draw,
|
| break;
|
| case SkPaint::kHigh_FilterLevel: {
|
| // Minification can look bad with the bicubic effect.
|
| - if (fContext->getMatrix().getMinStretch() >= SK_Scalar1 &&
|
| - (flags & SkCanvas::kBleed_DrawBitmapRectFlag)) {
|
| + if (fContext->getMatrix().getMinStretch() >= SK_Scalar1) {
|
| // We will install an effect that does the filtering in the shader.
|
| textureFilterMode = GrTextureParams::kNone_FilterMode;
|
| tileFilterPad = GrBicubicEffect::kFilterTexelPad;
|
| @@ -1280,8 +1279,6 @@ void SkGpuDevice::drawTiledBitmap(const SkBitmap& bitmap,
|
| // but stay within the bitmap bounds
|
| iClampRect = SkIRect::MakeWH(bitmap.width(), bitmap.height());
|
| } else {
|
| - SkASSERT(!bicubic); // Bicubic is not supported with non-bleed yet.
|
| -
|
| // In texture-domain/clamp mode we only want to expand the
|
| // tile on edges interior to "srcRect" (i.e., we want to
|
| // not bleed across the original clamped edges)
|
| @@ -1379,12 +1376,11 @@ void SkGpuDevice::internalDrawBitmap(const SkBitmap& bitmap,
|
|
|
| bool needsTextureDomain = false;
|
| if (!(flags & SkCanvas::kBleed_DrawBitmapRectFlag) &&
|
| - params.filterMode() != GrTextureParams::kNone_FilterMode) {
|
| - SkASSERT(!bicubic);
|
| - // Need texture domain if drawing a sub rect.
|
| + (bicubic || params.filterMode() != GrTextureParams::kNone_FilterMode)) {
|
| + // Need texture domain if drawing a sub rect
|
| needsTextureDomain = srcRect.width() < bitmap.width() ||
|
| srcRect.height() < bitmap.height();
|
| - if (needsTextureDomain && fContext->getMatrix().rectStaysRect()) {
|
| + if (!bicubic && needsTextureDomain && fContext->getMatrix().rectStaysRect()) {
|
| const SkMatrix& matrix = fContext->getMatrix();
|
| // sampling is axis-aligned
|
| SkRect transformedRect;
|
| @@ -1420,11 +1416,15 @@ void SkGpuDevice::internalDrawBitmap(const SkBitmap& bitmap,
|
| top = bottom = SkScalarHalf(paintRect.top() + paintRect.bottom());
|
| }
|
| textureDomain.setLTRB(left, top, right, bottom);
|
| - effect.reset(GrTextureDomainEffect::Create(texture,
|
| - SkMatrix::I(),
|
| - textureDomain,
|
| - GrTextureDomain::kClamp_Mode,
|
| - params.filterMode()));
|
| + if (bicubic) {
|
| + effect.reset(GrBicubicEffect::Create(texture, SkMatrix::I(), textureDomain));
|
| + } else {
|
| + effect.reset(GrTextureDomainEffect::Create(texture,
|
| + SkMatrix::I(),
|
| + textureDomain,
|
| + GrTextureDomain::kClamp_Mode,
|
| + params.filterMode()));
|
| + }
|
| } else if (bicubic) {
|
| SkASSERT(GrTextureParams::kNone_FilterMode == params.filterMode());
|
| SkShader::TileMode tileModes[2] = { params.getTileModeX(), params.getTileModeY() };
|
|
|