aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-10-11 19:39:09 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-10-11 19:39:09 +0000
commit3ab43d5c5b4d77f46dd0266618f92e5fefce2021 (patch)
tree2950bae414b8cc85a61d350f945ccc55affd52d6 /include/core
parent5dc26b97366934ba0f896cea02a3fec027d5d5c1 (diff)
Minimize use of SkDraw's matrix in SkGpuDevice.
R=robertphillips@google.com Review URL: https://codereview.appspot.com/6604068 git-svn-id: http://skia.googlecode.com/svn/trunk@5906 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/core')
-rw-r--r--include/core/SkClipStack.h7
-rw-r--r--include/core/SkRect.h7
2 files changed, 14 insertions, 0 deletions
diff --git a/include/core/SkClipStack.h b/include/core/SkClipStack.h
index 2ab118d5a7..a67e0a5dd9 100644
--- a/include/core/SkClipStack.h
+++ b/include/core/SkClipStack.h
@@ -63,6 +63,13 @@ public:
BoundsType* boundType,
bool* isIntersectionOfRects = NULL) const;
+ /**
+ * Takes an input rect in device space and conservatively clips it to the
+ * clip-stack. If false is returned then the rect does not intersect the
+ * clip and is unmodified.
+ */
+ bool intersectRectWithClip(SkRect* devRect) const;
+
void clipDevRect(const SkIRect& ir, SkRegion::Op op) {
SkRect r;
r.set(ir);
diff --git a/include/core/SkRect.h b/include/core/SkRect.h
index 23af56006c..21a37364d4 100644
--- a/include/core/SkRect.h
+++ b/include/core/SkRect.h
@@ -481,6 +481,13 @@ struct SK_API SkRect {
fBottom = y + height;
}
+ void setWH(SkScalar width, SkScalar height) {
+ fLeft = 0;
+ fTop = 0;
+ fRight = width;
+ fBottom = height;
+ }
+
/**
* Make the largest representable rectangle
*/