8#ifndef SkRecordPattern_DEFINED
9#define SkRecordPattern_DEFINED
23 Is() : fPtr(nullptr) {}
53 fPaint = AsPtr(
draw->paint);
72 template <
typename T>
static T* AsPtr(
T&
x) {
return &
x; }
89 fPaint = AsPtr(
draw->paint);
102 template <
typename T>
112 template <
typename T>
static T* AsPtr(
T&
x) {
return &
x; }
118template <
typename Matcher>
120 template <
typename T>
125template <
typename First,
typename... Rest>
127 template <
typename T>
130template <
typename First>
132 template <
typename T>
138template <
typename Matcher>
140 template <
typename T>
158template <
typename First,
typename... Rest>
164 i = this->matchFirst(&fFirst, record,
i);
165 return i > 0 ? fRest.match(record,
i) : 0;
181 template <
typename T>
T*
first() {
return fFirst.get(); }
182 template <
typename T>
T*
second() {
return fRest.template first<T>(); }
183 template <
typename T>
T*
third() {
return fRest.template second<T>(); }
184 template <
typename T>
T*
fourth() {
return fRest.template third<T>(); }
188 template <
typename T>
189 int matchFirst(
T* first,
SkRecord* record,
int i) {
190 if (i < record->
count()) {
191 if (record->
mutate(
i, *first)) {
199 template <
typename T>
200 int matchFirst(Greedy<T>* first,
SkRecord* record,
int i) {
201 while (i < record->
count()) {
202 if (!record->
mutate(
i, *first)) {
211 Pattern<Rest...> fRest;
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
auto mutate(int i, F &&f) -> decltype(f((SkRecords::NoOp *) nullptr))
std::enable_if_t<(T::kTags &kDrawWithPaint_Tag)==kDrawWithPaint_Tag &&!(T::kTags &kMultiDraw_Tag), bool > operator()(T *draw)
std::enable_if_t<(T::kTags &kDrawWithPaint_Tag)==kDraw_Tag &&!(T::kTags &kMultiDraw_Tag), bool > operator()(T *draw)
std::enable_if_t<!(T::kTags &kDraw_Tag)||(T::kTags &kMultiDraw_Tag), bool > operator()(T *draw)
SK_ALWAYS_INLINE int match(SkRecord *record, int i)
SK_ALWAYS_INLINE bool search(SkRecord *record, int *begin, int *end)
int match(SkRecord *, int i)
static const char * begin(const StringSlice &s)
sk_sp< const sktext::gpu::Slug > slug kDraw_Tag kHasImage_Tag kHasPaint_Tag kMultiDraw_Tag
unsigned useCenter kDraw_Tag