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

Unified Diff: include/core/SkRRect.h

Issue 2241273003: Attempt to throw away rrect clips of rrects. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: fix int to scalar warnings Created 4 years, 4 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 | « include/core/SkClipStack.h ('k') | include/gpu/GrClip.h » ('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 d025412d646ddc7028ea1c9e80784122d5579839..64db2f317b9467d6ba895c0f488caf13416ade9c 100644
--- a/include/core/SkRRect.h
+++ b/include/core/SkRRect.h
@@ -47,6 +47,10 @@ class SkMatrix;
*/
class SK_API SkRRect {
public:
+ SkRRect() { /* unititialized */ }
+ SkRRect(const SkRRect&) = default;
+ SkRRect& operator=(const SkRRect&) = default;
+
/**
* Enum to capture the various possible subtypes of RR. Accessed
* by type(). The subtypes become progressively less restrictive.
@@ -274,6 +278,10 @@ public:
fRect.offset(dx, dy);
}
+ SkRRect SK_WARN_UNUSED_RESULT makeOffset(SkScalar dx, SkScalar dy) const {
+ return SkRRect(fRect.makeOffset(dx, dy), fRadii, fType);
+ }
+
/**
* Returns true if 'rect' is wholy inside the RR, and both
* are not empty.
@@ -322,6 +330,11 @@ public:
void dumpHex() const { this->dump(true); }
private:
+ SkRRect(const SkRect& rect, const SkVector radii[4], int32_t type)
+ : fRect(rect)
+ , fRadii{radii[0], radii[1], radii[2], radii[3]}
+ , fType(type) {}
+
SkRect fRect;
// Radii order is UL, UR, LR, LL. Use Corner enum to index into fRadii[]
SkVector fRadii[4];
« no previous file with comments | « include/core/SkClipStack.h ('k') | include/gpu/GrClip.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698