Index: src/gpu/SkGpuDevice.cpp |
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp |
index 9cf5b25d7814a2063f378e4ac47603e73c06abe1..fb0fffd65c4a48b56590b0664fc3b570027e1f08 100644 |
--- a/src/gpu/SkGpuDevice.cpp |
+++ b/src/gpu/SkGpuDevice.cpp |
@@ -845,13 +845,18 @@ static bool has_aligned_samples(const SkRect& srcRect, |
static bool may_color_bleed(const SkRect& srcRect, |
const SkRect& transformedRect, |
- const SkMatrix& m) { |
+ const SkMatrix& m, |
+ bool isMSAA) { |
// Only gets called if has_aligned_samples returned false. |
// So we can assume that sampling is axis aligned but not texel aligned. |
SkASSERT(!has_aligned_samples(srcRect, transformedRect)); |
SkRect innerSrcRect(srcRect), innerTransformedRect, |
outerTransformedRect(transformedRect); |
- innerSrcRect.inset(SK_ScalarHalf, SK_ScalarHalf); |
+ if (isMSAA) { |
+ innerSrcRect.inset(SK_Scalar1, SK_Scalar1); |
+ } else { |
+ innerSrcRect.inset(SK_ScalarHalf, SK_ScalarHalf); |
+ } |
m.mapRect(&innerTransformedRect, innerSrcRect); |
// The gap between outerTransformedRect and innerTransformedRect |
@@ -872,7 +877,8 @@ static bool needs_texture_domain(const SkBitmap& bitmap, |
const SkRect& srcRect, |
GrTextureParams ¶ms, |
const SkMatrix& contextMatrix, |
- bool bicubic) { |
+ bool bicubic, |
+ bool isMSAA) { |
bool needsTextureDomain = false; |
GrTexture* tex = bitmap.getTexture(); |
int width = tex ? tex->width() : bitmap.width(); |
@@ -891,7 +897,8 @@ static bool needs_texture_domain(const SkBitmap& bitmap, |
params.setFilterMode(GrTextureParams::kNone_FilterMode); |
needsTextureDomain = false; |
} else { |
- needsTextureDomain = may_color_bleed(srcRect, transformedRect, contextMatrix); |
+ needsTextureDomain = may_color_bleed(srcRect, transformedRect, |
+ contextMatrix, isMSAA); |
} |
} |
} |
@@ -1072,7 +1079,8 @@ void SkGpuDevice::drawBitmapCommon(const SkDraw& draw, |
srcRect, |
params, |
viewM, |
- doBicubic); |
+ doBicubic, |
+ fRenderTarget->isUnifiedMultisampled()); |
this->internalDrawBitmap(bitmap, |
viewM, |
srcRect, |
@@ -1153,11 +1161,10 @@ void SkGpuDevice::drawTiledBitmap(const SkBitmap& bitmap, |
// now offset it to make it "local" to our tmp bitmap |
tileR.offset(-offset.fX, -offset.fY); |
GrTextureParams paramsTemp = params; |
- bool needsTextureDomain = needs_texture_domain(bitmap, |
- srcRect, |
- paramsTemp, |
- viewM, |
- bicubic); |
+ bool needsTextureDomain = needs_texture_domain( |
+ bitmap, srcRect, paramsTemp, |
+ viewM, bicubic, |
+ fRenderTarget->isUnifiedMultisampled()); |
this->internalDrawBitmap(tmpB, |
viewM, |
tileR, |