blob: 938bb87fdc2a120f7be039a8a00c8c910e5381a2 [file] [log] [blame]
Brian Osman7c979f52019-02-12 13:27:51 -05001/*
2* Copyright 2019 Google LLC
3*
4* Use of this source code is governed by a BSD-style license that can be
5* found in the LICENSE file.
6*/
7
8#include "SkReflected.h"
9
Brian Osmanbdcdf1a2019-03-04 10:55:22 -050010#include "SkCurve.h"
11
Brian Osman7c979f52019-02-12 13:27:51 -050012SkSTArray<16, const SkReflected::Type*, true> SkReflected::gTypes;
13
Brian Osmanb77d5022019-03-06 11:08:48 -050014void SkReflected::VisitTypes(std::function<void(const Type*)> visitor) {
Brian Osman7c979f52019-02-12 13:27:51 -050015 for (const Type* type : gTypes) {
Brian Osmanb77d5022019-03-06 11:08:48 -050016 visitor(type);
Brian Osman7c979f52019-02-12 13:27:51 -050017 }
18}
Brian Osmanbdcdf1a2019-03-04 10:55:22 -050019
20void SkFieldVisitor::visit(const char* name, SkCurve& c) {
21 this->enterObject(name);
22 c.visitFields(this);
23 this->exitObject();
24}