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

Unified Diff: src/record/SkRecordTraits.h

Issue 263063002: Add pattern matchers for SkRecord (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: init pointers 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 | « src/record/SkRecordPattern.h ('k') | src/utils/SkTLogic.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/record/SkRecordTraits.h
diff --git a/src/record/SkRecordTraits.h b/src/record/SkRecordTraits.h
deleted file mode 100644
index 570a717e92a0663aab4abbb04ad061e2161e69c9..0000000000000000000000000000000000000000
--- a/src/record/SkRecordTraits.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#include "SkRecords.h"
-#include "SkTLogic.h"
-
-// Type traits that are useful for working with SkRecords.
-
-namespace SkRecords {
-
-namespace {
-
-// Abstracts away whether the T is optional or not.
-template <typename T> const T* as_ptr(const SkRecords::Optional<T>& x) { return x; }
-template <typename T> const T* as_ptr(const T& x) { return &x; }
-
-} // namespace
-
-// Gets the paint from any command that may have one.
-template <typename Command> const SkPaint* GetPaint(const Command& x) { return as_ptr(x.paint); }
-
-// Have a paint? You are a draw command!
-template <typename Command> struct IsDraw {
- SK_CREATE_MEMBER_DETECTOR(paint);
- static const bool value = HasMember_paint<Command>::value;
-};
-
-// Have a clip op? You are a clip command.
-template <typename Command> struct IsClip {
- SK_CREATE_MEMBER_DETECTOR(op);
- static const bool value = HasMember_op<Command>::value;
-};
-
-} // namespace SkRecords
« no previous file with comments | « src/record/SkRecordPattern.h ('k') | src/utils/SkTLogic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698