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

Unified Diff: src/core/SkClipStack.cpp

Issue 269693003: SkClipStack::Element tweaks. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Rebased Created 6 years, 6 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/SkCanvas.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkClipStack.cpp
diff --git a/src/core/SkClipStack.cpp b/src/core/SkClipStack.cpp
index b60a6c961d24977e6e3857df10585cda0b1bcf61..d087592b173c3fbaaacc5441075b283929a26813 100644
--- a/src/core/SkClipStack.cpp
+++ b/src/core/SkClipStack.cpp
@@ -1,10 +1,11 @@
-
/*
* Copyright 2011 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
+
+#include "SkCanvas.h"
#include "SkClipStack.h"
#include "SkPath.h"
#include "SkThread.h"
@@ -66,6 +67,25 @@ bool SkClipStack::Element::operator== (const Element& element) const {
}
}
+void SkClipStack::Element::replay(SkCanvasClipVisitor* visitor) const {
+ static const SkRect kEmptyRect = { 0, 0, 0, 0 };
+
+ switch (fType) {
+ case kPath_Type:
+ visitor->clipPath(this->getPath(), this->getOp(), this->isAA());
+ break;
+ case kRRect_Type:
+ visitor->clipRRect(this->getRRect(), this->getOp(), this->isAA());
+ break;
+ case kRect_Type:
+ visitor->clipRect(this->getRect(), this->getOp(), this->isAA());
+ break;
+ case kEmpty_Type:
+ visitor->clipRect(kEmptyRect, SkRegion::kIntersect_Op, false);
+ break;
+ }
+}
+
void SkClipStack::Element::invertShapeFillType() {
switch (fType) {
case kRect_Type:
« no previous file with comments | « src/core/SkCanvas.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698