Bug 1296301 - use getClipDeviceBounds instead of getClipBounds in DrawTargetSkia. r=jrmuizel

MozReview-Commit-ID: BEIAGS0hLzB
This commit is contained in:
Lee Salzman 2016-08-18 11:25:38 -04:00
Родитель 4d6c4f875f
Коммит 1c19e4af27
1 изменённых файлов: 12 добавлений и 3 удалений

Просмотреть файл

@ -398,11 +398,20 @@ SetPaintPattern(SkPaint& aPaint, const Pattern& aPattern, Float aAlpha = 1.0)
static inline Rect
GetClipBounds(SkCanvas *aCanvas)
{
SkRect clipBounds;
if (!aCanvas->getClipBounds(&clipBounds)) {
// Use a manually transformed getClipDeviceBounds instead of
// getClipBounds because getClipBounds inflates the the bounds
// by a pixel in each direction to compensate for antialiasing.
SkIRect deviceBounds;
if (!aCanvas->getClipDeviceBounds(&deviceBounds)) {
return Rect();
}
return SkRectToRect(clipBounds);
SkMatrix inverseCTM;
if (!aCanvas->getTotalMatrix().invert(&inverseCTM)) {
return Rect();
}
SkRect localBounds;
inverseCTM.mapRect(&localBounds, SkRect::Make(deviceBounds));
return SkRectToRect(localBounds);
}
struct AutoPaintSetup {