aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pipe
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-02-28 15:28:02 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-02-28 15:28:02 +0000
commit03fc3b4f67a115e4a7945d173856a6c80b09311e (patch)
tree76665d4141136cb091f7c9e3e5d3bdc2342cdfa2 /src/pipe
parentd85f32ca40475fb246dd8ca93abaf1c3db0389e1 (diff)
Revert of r13620 (add new onClip* methods to SkCanvas - https://codereview.chromium.org/183453002/) due to broken Chrome Canary and failing tests.
git-svn-id: http://skia.googlecode.com/svn/trunk@13622 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/pipe')
-rw-r--r--src/pipe/SkGPipeWrite.cpp47
1 files changed, 19 insertions, 28 deletions
diff --git a/src/pipe/SkGPipeWrite.cpp b/src/pipe/SkGPipeWrite.cpp
index 43209f644b..879ce8288b 100644
--- a/src/pipe/SkGPipeWrite.cpp
+++ b/src/pipe/SkGPipeWrite.cpp
@@ -240,6 +240,11 @@ public:
virtual bool skew(SkScalar sx, SkScalar sy) SK_OVERRIDE;
virtual bool concat(const SkMatrix& matrix) SK_OVERRIDE;
virtual void setMatrix(const SkMatrix& matrix) SK_OVERRIDE;
+ virtual bool clipRect(const SkRect&, SkRegion::Op op, bool doAntiAlias = false) SK_OVERRIDE;
+ virtual bool clipRRect(const SkRRect&, SkRegion::Op op, bool doAntiAlias = false) SK_OVERRIDE;
+ virtual bool clipPath(const SkPath& path, SkRegion::Op op,
+ bool doAntiAlias = false) SK_OVERRIDE;
+ virtual bool clipRegion(const SkRegion& region, SkRegion::Op op) SK_OVERRIDE;
virtual void clear(SkColor) SK_OVERRIDE;
virtual void drawPaint(const SkPaint& paint) SK_OVERRIDE;
virtual void drawPoints(PointMode, size_t count, const SkPoint pts[],
@@ -289,11 +294,6 @@ public:
protected:
virtual void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) SK_OVERRIDE;
- virtual void onClipRect(const SkRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
- virtual void onClipRRect(const SkRRect&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
- virtual void onClipPath(const SkPath&, SkRegion::Op, ClipEdgeStyle) SK_OVERRIDE;
- virtual void onClipRegion(const SkRegion&, SkRegion::Op) SK_OVERRIDE;
-
private:
enum {
kNoSaveLayer = -1,
@@ -635,56 +635,47 @@ void SkGPipeCanvas::setMatrix(const SkMatrix& matrix) {
this->INHERITED::setMatrix(matrix);
}
-void SkGPipeCanvas::onClipRect(const SkRect& rect, SkRegion::Op rgnOp,
- ClipEdgeStyle edgeStyle) {
+bool SkGPipeCanvas::clipRect(const SkRect& rect, SkRegion::Op rgnOp,
+ bool doAntiAlias) {
NOTIFY_SETUP(this);
if (this->needOpBytes(sizeof(SkRect))) {
- unsigned flags = 0;
- if (kSoft_ClipEdgeStyle == edgeStyle) {
- flags = kClip_HasAntiAlias_DrawOpFlag;
- }
+ unsigned flags = doAntiAlias & kClip_HasAntiAlias_DrawOpFlag;
this->writeOp(kClipRect_DrawOp, flags, rgnOp);
fWriter.writeRect(rect);
}
- this->INHERITED::onClipRect(rect, rgnOp, edgeStyle);
+ return this->INHERITED::clipRect(rect, rgnOp, doAntiAlias);
}
-void SkGPipeCanvas::onClipRRect(const SkRRect& rrect, SkRegion::Op rgnOp,
- ClipEdgeStyle edgeStyle) {
+bool SkGPipeCanvas::clipRRect(const SkRRect& rrect, SkRegion::Op rgnOp,
+ bool doAntiAlias) {
NOTIFY_SETUP(this);
if (this->needOpBytes(kSizeOfFlatRRect)) {
- unsigned flags = 0;
- if (kSoft_ClipEdgeStyle == edgeStyle) {
- flags = kClip_HasAntiAlias_DrawOpFlag;
- }
+ unsigned flags = doAntiAlias & kClip_HasAntiAlias_DrawOpFlag;
this->writeOp(kClipRRect_DrawOp, flags, rgnOp);
fWriter.writeRRect(rrect);
}
- this->INHERITED::onClipRRect(rrect, rgnOp, edgeStyle);
+ return this->INHERITED::clipRRect(rrect, rgnOp, doAntiAlias);
}
-void SkGPipeCanvas::onClipPath(const SkPath& path, SkRegion::Op rgnOp,
- ClipEdgeStyle edgeStyle) {
+bool SkGPipeCanvas::clipPath(const SkPath& path, SkRegion::Op rgnOp,
+ bool doAntiAlias) {
NOTIFY_SETUP(this);
if (this->needOpBytes(path.writeToMemory(NULL))) {
- unsigned flags = 0;
- if (kSoft_ClipEdgeStyle == edgeStyle) {
- flags = kClip_HasAntiAlias_DrawOpFlag;
- }
+ unsigned flags = doAntiAlias & kClip_HasAntiAlias_DrawOpFlag;
this->writeOp(kClipPath_DrawOp, flags, rgnOp);
fWriter.writePath(path);
}
// we just pass on the bounds of the path
- this->INHERITED::onClipRect(path.getBounds(), rgnOp, edgeStyle);
+ return this->INHERITED::clipRect(path.getBounds(), rgnOp, doAntiAlias);
}
-void SkGPipeCanvas::onClipRegion(const SkRegion& region, SkRegion::Op rgnOp) {
+bool SkGPipeCanvas::clipRegion(const SkRegion& region, SkRegion::Op rgnOp) {
NOTIFY_SETUP(this);
if (this->needOpBytes(region.writeToMemory(NULL))) {
this->writeOp(kClipRegion_DrawOp, 0, rgnOp);
fWriter.writeRegion(region);
}
- this->INHERITED::onClipRegion(region, rgnOp);
+ return this->INHERITED::clipRegion(region, rgnOp);
}
///////////////////////////////////////////////////////////////////////////////