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

Unified Diff: include/core/SkRRect.h

Issue 52703003: Add SkRRect::transform. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix a comment. Use taller RRect. 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') | no next file with comments »
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..d8029bb5c72aab7420c95af3a56e7743f5e578f8 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.
+ * @param dst SkRRect to store the result. It is an error to use this,
reed1 2013/11/04 20:21:09 FYI -- we explicitly support modifying self in SkP
scroggo 2013/11/04 22:29:55 In patch set 1 I allowed modifying the SkRRect, fo
+ * which would make this function no longer const.
+ * @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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698