skia2/tools/path_utils.h
skia.committer@gmail.com c1f224ac07 Sanitizing source files in Skia_Periodic_House_Keeping
git-svn-id: http://skia.googlecode.com/svn/trunk@6721 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-12-08 02:01:38 +00:00

48 lines
1.5 KiB
C++

/*
* Copyright 2012 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef path_utils_DEFINED
#define path_utils_DEFINED
class SkFILEWStream;
class SkPath;
namespace sk_tools {
// These utilities help write paths to a .cpp file in a compileable form.
// To use call them in the order:
// dump_path_prefix - once per program invocation
// dump_path - once for each path of interest
// dump_path_suffix - once per program invocation
//
// The output system relies on a global current path ID and assumes that
// only one set of aggregation arrays will be written per program
// invocation. These utilities are not thread safe.
// Write of the headers needed to compile the resulting .cpp file
void dump_path_prefix(SkFILEWStream* pathStream);
// Write out a single path in the form:
// static const int numPts# = ...;
// SkPoint pts#[] = { ... };
// static const int numVerbs# = ...;
// uint8_t verbs#[] = { ... };
// Where # is a globally unique identifier
void dump_path(SkFILEWStream* pathStream, const SkPath& path);
// Write out structures to aggregate info about the written paths:
// int numPaths = ...;
// int sizes[] = {
// numPts#, numVerbs#,
// ...
// };
// const SkPoint* points[] = { pts#, ... };
// const uint8_t* verbs[] = { verbs#, ... };
void dump_path_suffix(SkFILEWStream* pathStream);
}
#endif