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

Unified Diff: include/core/SkRRect.h

Issue 52703003: Add SkRRect::transform. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 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 | « no previous file | src/core/SkRRect.cpp » ('j') | src/core/SkRRect.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkRRect.h
diff --git a/include/core/SkRRect.h b/include/core/SkRRect.h
index 32d62856bc90fddec1a33196f8f691ce8506de68..77e109d45b948eff171ac1373247e5b60fb6dae1 100644
--- a/include/core/SkRRect.h
+++ b/include/core/SkRRect.h
@@ -12,6 +12,7 @@
#include "SkPoint.h"
class SkPath;
+class SkMatrix;
// Path forward:
// core work
@@ -277,6 +278,17 @@ public:
*/
uint32_t readFromMemory(const void* buffer);
+ /**
+ * Transform by the specified matrix, and put the result in dst.
+ *
+ * @param matrix SkMatrix specifying the transform. Must only contain
+ * scale and/or translate, or this call will fail.
robertphillips 2013/10/30 23:55:02 this is a const method?! Are we really going to al
scroggo 2013/10/31 17:40:35 This seemed like an odd pattern to me, but I was k
+ * @param dst SkRRect to store the result. If NULL, the transform will
+ * be performed on this.
+ * @return true on success, false on failure. If false, dst is unmodified.
+ */
+ bool transform(const SkMatrix& matrix, SkRRect* dst) const;
+
private:
SkRect fRect;
// Radii order is UL, UR, LR, LL. Use Corner enum to index into fRadii[]
« no previous file with comments | « no previous file | src/core/SkRRect.cpp » ('j') | src/core/SkRRect.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698