Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Unified Diff: src/xps/SkXPSDevice.cpp

Issue 1925693002: remove 'deprecated' region from SkDraw (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update dox Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/utils/SkCanvasStateUtils.cpp ('k') | tests/AAClipTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « src/utils/SkCanvasStateUtils.cpp ('k') | tests/AAClipTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698