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

Unified Diff: include/core/SkCanvas.h

Issue 303373003: Add an OR operator overload for SaveFlags to avoid extra static casts. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: spacing Created 6 years, 7 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/SkCanvas.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkCanvas.h
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index 81dcfe19b0fcfeca4c22815de439b7d6acc0c31d..7da0b3d766469ed9c88993b0d8f90af4525c8150 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -1507,4 +1507,16 @@ private:
size_t fRowBytes;
};
+static inline SkCanvas::SaveFlags operator|(const SkCanvas::SaveFlags lhs,
+ const SkCanvas::SaveFlags rhs) {
+ return static_cast<SkCanvas::SaveFlags>(lhs | rhs);
+}
+
+static inline SkCanvas::SaveFlags& operator|=(SkCanvas::SaveFlags& lhs,
+ const SkCanvas::SaveFlags rhs) {
+ lhs = lhs | rhs;
+ return lhs;
+}
+
+
#endif
« no previous file with comments | « no previous file | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698