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

Unified Diff: src/core/SkPictureRecord.cpp

Issue 183453002: add new onClip* methods to SkCanvas (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: remove debug Created 6 years, 10 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/core/SkPictureRecord.h ('k') | src/pipe/SkGPipeWrite.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPictureRecord.cpp
===================================================================
--- src/core/SkPictureRecord.cpp (revision 13622)
+++ src/core/SkPictureRecord.cpp (working copy)
@@ -847,14 +847,14 @@
}
#endif
-bool SkPictureRecord::clipRect(const SkRect& rect, SkRegion::Op op, bool doAA) {
+void SkPictureRecord::onClipRect(const SkRect& rect, SkRegion::Op op, ClipEdgeStyle edgeStyle) {
#ifdef SK_COLLAPSE_MATRIX_CLIP_STATE
fMCMgr.clipRect(rect, op, doAA);
#else
- this->recordClipRect(rect, op, doAA);
+ this->recordClipRect(rect, op, kSoft_ClipEdgeStyle == edgeStyle);
#endif
- return this->INHERITED::clipRect(rect, op, doAA);
+ this->INHERITED::onClipRect(rect, op, edgeStyle);
}
int SkPictureRecord::recordClipRect(const SkRect& rect, SkRegion::Op op, bool doAA) {
@@ -878,20 +878,17 @@
return offset;
}
-bool SkPictureRecord::clipRRect(const SkRRect& rrect, SkRegion::Op op, bool doAA) {
- if (rrect.isRect()) {
- return this->SkPictureRecord::clipRect(rrect.getBounds(), op, doAA);
- }
+void SkPictureRecord::onClipRRect(const SkRRect& rrect, SkRegion::Op op, ClipEdgeStyle edgeStyle) {
#ifdef SK_COLLAPSE_MATRIX_CLIP_STATE
fMCMgr.clipRRect(rrect, op, doAA);
#else
- this->recordClipRRect(rrect, op, doAA);
+ this->recordClipRRect(rrect, op, kSoft_ClipEdgeStyle == edgeStyle);
#endif
if (fRecordFlags & SkPicture::kUsePathBoundsForClip_RecordingFlag) {
- return this->updateClipConservativelyUsingBounds(rrect.getBounds(), op, false);
+ this->updateClipConservativelyUsingBounds(rrect.getBounds(), op, false);
} else {
- return this->INHERITED::clipRRect(rrect, op, doAA);
+ this->INHERITED::onClipRRect(rrect, op, edgeStyle);
}
}
@@ -915,25 +912,20 @@
return offset;
}
-bool SkPictureRecord::clipPath(const SkPath& path, SkRegion::Op op, bool doAA) {
+void SkPictureRecord::onClipPath(const SkPath& path, SkRegion::Op op, ClipEdgeStyle edgeStyle) {
- SkRect r;
- if (!path.isInverseFillType() && path.isRect(&r)) {
- return this->clipRect(r, op, doAA);
- }
-
#ifdef SK_COLLAPSE_MATRIX_CLIP_STATE
fMCMgr.clipPath(path, op, doAA);
#else
int pathID = this->addPathToHeap(path);
- this->recordClipPath(pathID, op, doAA);
+ this->recordClipPath(pathID, op, kSoft_ClipEdgeStyle == edgeStyle);
#endif
if (fRecordFlags & SkPicture::kUsePathBoundsForClip_RecordingFlag) {
- return this->updateClipConservativelyUsingBounds(path.getBounds(), op,
- path.isInverseFillType());
+ this->updateClipConservativelyUsingBounds(path.getBounds(), op,
+ path.isInverseFillType());
} else {
- return this->INHERITED::clipPath(path, op, doAA);
+ this->INHERITED::onClipPath(path, op, edgeStyle);
}
}
@@ -957,14 +949,14 @@
return offset;
}
-bool SkPictureRecord::clipRegion(const SkRegion& region, SkRegion::Op op) {
+void SkPictureRecord::onClipRegion(const SkRegion& region, SkRegion::Op op) {
#ifdef SK_COLLAPSE_MATRIX_CLIP_STATE
fMCMgr.clipRegion(region, op);
#else
this->recordClipRegion(region, op);
#endif
- return this->INHERITED::clipRegion(region, op);
+ this->INHERITED::onClipRegion(region, op);
}
int SkPictureRecord::recordClipRegion(const SkRegion& region, SkRegion::Op op) {
« no previous file with comments | « src/core/SkPictureRecord.h ('k') | src/pipe/SkGPipeWrite.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698