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

Unified Diff: include/gpu/GrTypes.h

Issue 2225303002: Add flag for window rectangles to GrRenderTarget (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add GrRenderTarget flag for window rectangles 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/gpu/GrRenderTarget.h ('k') | include/private/GrInstancedPipelineInfo.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrTypes.h
diff --git a/include/gpu/GrTypes.h b/include/gpu/GrTypes.h
index a0f13aa6febcbf35f8909ac486e44d3eef5f5f5b..7bc949d73c366a5f19c534d5ed0e858d2147867d 100644
--- a/include/gpu/GrTypes.h
+++ b/include/gpu/GrTypes.h
@@ -49,6 +49,27 @@
\
template <typename T> \
friend X operator & (X a, T b); \
+
+/**
+ * Defines bitwise operators that make it possible to use an enum class as a
+ * very basic bitfield.
+ */
+#define GR_MAKE_BITFIELD_CLASS_OPS(X) \
+ inline X operator | (X a, X b) { \
+ return (X) ((int)a | (int)b); \
+ } \
+ inline X& operator |= (X& a, X b) { \
+ return (a = a | b); \
+ } \
+ inline bool operator & (X a, X b) { \
+ return SkToBool((int)a & (int)b); \
+ }
+
+#define GR_DECL_BITFIELD_CLASS_OPS_FRIENDS(X) \
+ friend X operator | (X a, X b); \
+ friend X& operator |= (X& a, X b); \
+ friend bool operator & (X a, X b);
+
////////////////////////////////////////////////////////////////////////////////
// compile time versions of min/max
« no previous file with comments | « include/gpu/GrRenderTarget.h ('k') | include/private/GrInstancedPipelineInfo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698