| Index: src/xps/SkXPSDevice.cpp
|
| diff --git a/src/xps/SkXPSDevice.cpp b/src/xps/SkXPSDevice.cpp
|
| index febd0278ffeae21a00253f49006f79e09cc759f3..90fc68091cb0bc5283cbb0d720fee0baa54d5698 100644
|
| --- a/src/xps/SkXPSDevice.cpp
|
| +++ b/src/xps/SkXPSDevice.cpp
|
| @@ -35,6 +35,7 @@
|
| #include "SkPathEffect.h"
|
| #include "SkPathOps.h"
|
| #include "SkPoint.h"
|
| +#include "SkRasterClip.h"
|
| #include "SkRasterizer.h"
|
| #include "SkSFNTHeader.h"
|
| #include "SkShader.h"
|
| @@ -1210,7 +1211,7 @@ void SkXPSDevice::internalDrawRect(const SkDraw& d,
|
| bool transformRect,
|
| const SkPaint& paint) {
|
| //Exit early if there is nothing to draw.
|
| - if (d.fClip->isEmpty() ||
|
| + if (d.fRC->isEmpty() ||
|
| (paint.getAlpha() == 0 && paint.getXfermode() == nullptr)) {
|
| return;
|
| }
|
| @@ -1526,7 +1527,7 @@ void SkXPSDevice::drawPath(const SkDraw& d,
|
| SkTCopyOnFirstWrite<SkPaint> paint(origPaint);
|
|
|
| // nothing to draw
|
| - if (d.fClip->isEmpty() ||
|
| + if (d.fRC->isEmpty() ||
|
| (paint->getAlpha() == 0 && paint->getXfermode() == nullptr)) {
|
| return;
|
| }
|
| @@ -1609,7 +1610,7 @@ void SkXPSDevice::drawPath(const SkDraw& d,
|
| this->convertToPpm(filter,
|
| &matrix,
|
| &ppuScale,
|
| - d.fClip->getBounds(),
|
| + d.fRC->getBounds(),
|
| &clipIRect);
|
|
|
| SkMask* mask = nullptr;
|
| @@ -1647,7 +1648,7 @@ void SkXPSDevice::drawPath(const SkDraw& d,
|
| this->convertToPpm(filter,
|
| &matrix,
|
| &ppuScale,
|
| - d.fClip->getBounds(),
|
| + d.fRC->getBounds(),
|
| &clipIRect);
|
|
|
| //[Fillable-path -> Pixel-path]
|
| @@ -1765,7 +1766,13 @@ void SkXPSDevice::drawPath(const SkDraw& d,
|
|
|
| HRESULT SkXPSDevice::clip(IXpsOMVisual* xpsVisual, const SkDraw& d) {
|
| SkPath clipPath;
|
| - SkAssertResult(d.fClip->getBoundaryPath(&clipPath));
|
| + if (d.fRC->isBW()) {
|
| + SkAssertResult(d.fRC->bwRgn().getBoundaryPath(&clipPath));
|
| + } else {
|
| + // Don't have a way to turn a AAClip into a path, so we just use the bounds.
|
| + // TODO: consider using fClipStack instead?
|
| + clipPath.addRect(SkRect::Make(d.fRC->getBounds()));
|
| + }
|
|
|
| return this->clipToPath(xpsVisual, clipPath, XPS_FILL_RULE_EVENODD);
|
| }
|
| @@ -1797,7 +1804,7 @@ HRESULT SkXPSDevice::clipToPath(IXpsOMVisual* xpsVisual,
|
|
|
| void SkXPSDevice::drawBitmap(const SkDraw& d, const SkBitmap& bitmap,
|
| const SkMatrix& matrix, const SkPaint& paint) {
|
| - if (d.fClip->isEmpty()) {
|
| + if (d.fRC->isEmpty()) {
|
| return;
|
| }
|
|
|
|
|