зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1296301 - use getClipDeviceBounds instead of getClipBounds in DrawTargetSkia. r=jrmuizel
MozReview-Commit-ID: BEIAGS0hLzB
This commit is contained in:
Родитель
4d6c4f875f
Коммит
1c19e4af27
|
@ -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 {
|
||||
|
|
Загрузка…
Ссылка в новой задаче